@actabldesign/bellhop-react 0.0.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.
@@ -0,0 +1,168 @@
1
+ /**
2
+ * BellhopOS Table Primitives
3
+ *
4
+ * Composable table components for building static and dynamic tables.
5
+ * These primitives can be used standalone or combined with TanStack Table
6
+ * for advanced features like sorting, filtering, and pagination.
7
+ * Uses existing Bellhop components for consistency.
8
+ */
9
+ import React from 'react';
10
+ export type TableSize = 'compact' | 'default' | 'relaxed';
11
+ export type TableVariant = 'default' | 'bordered' | 'striped';
12
+ export type CellAlign = 'left' | 'center' | 'right';
13
+ export interface TableWrapperProps extends React.HTMLAttributes<HTMLDivElement> {
14
+ /** Maximum height for vertical scrolling */
15
+ maxHeight?: string | number;
16
+ /** Maximum width for horizontal scrolling */
17
+ maxWidth?: string | number;
18
+ /** Enable horizontal scrolling */
19
+ scrollX?: boolean;
20
+ /** Enable vertical scrolling */
21
+ scrollY?: boolean;
22
+ }
23
+ export declare const TableWrapper: React.ForwardRefExoticComponent<TableWrapperProps & React.RefAttributes<HTMLDivElement>>;
24
+ export interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
25
+ /** Table size variant */
26
+ size?: TableSize;
27
+ /** Table style variant */
28
+ variant?: TableVariant;
29
+ /** Show rounded corners */
30
+ rounded?: boolean;
31
+ /** Enable row hover effect */
32
+ hoverable?: boolean;
33
+ /** Enable responsive stacking on mobile */
34
+ responsive?: boolean;
35
+ /** Loading state */
36
+ loading?: boolean;
37
+ }
38
+ export declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
39
+ export interface TableCaptionProps extends React.HTMLAttributes<HTMLTableCaptionElement> {
40
+ /** Position of caption */
41
+ position?: 'top' | 'bottom';
42
+ /** Screen reader only */
43
+ srOnly?: boolean;
44
+ }
45
+ export declare const TableCaption: React.ForwardRefExoticComponent<TableCaptionProps & React.RefAttributes<HTMLTableCaptionElement>>;
46
+ export interface TableHeadProps extends React.HTMLAttributes<HTMLTableSectionElement> {
47
+ /** Make header sticky */
48
+ sticky?: boolean;
49
+ /** Use subtle styling */
50
+ subtle?: boolean;
51
+ }
52
+ export declare const TableHead: React.ForwardRefExoticComponent<TableHeadProps & React.RefAttributes<HTMLTableSectionElement>>;
53
+ export interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
54
+ }
55
+ export declare const TableBody: React.ForwardRefExoticComponent<TableBodyProps & React.RefAttributes<HTMLTableSectionElement>>;
56
+ export interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {
57
+ }
58
+ export declare const TableFooter: React.ForwardRefExoticComponent<TableFooterProps & React.RefAttributes<HTMLTableSectionElement>>;
59
+ export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
60
+ /** Row is selected */
61
+ selected?: boolean;
62
+ /** Row is clickable */
63
+ clickable?: boolean;
64
+ /** Row is expandable */
65
+ expandable?: boolean;
66
+ /** Row is expanded */
67
+ expanded?: boolean;
68
+ /** Row is a filter row */
69
+ filter?: boolean;
70
+ /** Row is an expansion content row */
71
+ expansion?: boolean;
72
+ }
73
+ export declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
74
+ export interface TableHeaderCellProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
75
+ /** Text alignment */
76
+ align?: CellAlign;
77
+ /** Column is sortable */
78
+ sortable?: boolean;
79
+ /** Current sort direction */
80
+ sortDirection?: 'asc' | 'desc' | null;
81
+ /** Shrink column to content width */
82
+ shrink?: boolean;
83
+ /** Expand column to fill space */
84
+ expand?: boolean;
85
+ /** Checkbox column */
86
+ checkbox?: boolean;
87
+ /** Actions column */
88
+ actions?: boolean;
89
+ /** Pin column to left */
90
+ pinnedLeft?: boolean;
91
+ /** Pin column to right */
92
+ pinnedRight?: boolean;
93
+ }
94
+ export declare const TableHeaderCell: React.ForwardRefExoticComponent<TableHeaderCellProps & React.RefAttributes<HTMLTableCellElement>>;
95
+ export interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
96
+ /** Text alignment */
97
+ align?: CellAlign;
98
+ /** Cell contains numeric data */
99
+ numeric?: boolean;
100
+ /** Truncate long text */
101
+ truncate?: boolean;
102
+ /** Allow text to wrap */
103
+ wrap?: boolean;
104
+ /** Shrink cell to content width */
105
+ shrink?: boolean;
106
+ /** Expand cell to fill space */
107
+ expand?: boolean;
108
+ /** Checkbox cell */
109
+ checkbox?: boolean;
110
+ /** Actions cell */
111
+ actions?: boolean;
112
+ /** Expand trigger cell */
113
+ expandTrigger?: boolean;
114
+ /** Filter cell */
115
+ filter?: boolean;
116
+ /** Expansion content cell */
117
+ expansion?: boolean;
118
+ /** Pin cell to left */
119
+ pinnedLeft?: boolean;
120
+ /** Pin cell to right */
121
+ pinnedRight?: boolean;
122
+ /** Data label for responsive mode */
123
+ dataLabel?: string;
124
+ }
125
+ export declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableCellElement>>;
126
+ export interface TableEmptyProps extends React.HTMLAttributes<HTMLDivElement> {
127
+ /** Icon to display */
128
+ icon?: React.ReactNode;
129
+ /** Title text */
130
+ title?: string;
131
+ /** Description text */
132
+ description?: string;
133
+ /** Number of columns to span */
134
+ colSpan?: number;
135
+ }
136
+ export declare const TableEmpty: React.ForwardRefExoticComponent<TableEmptyProps & React.RefAttributes<HTMLTableRowElement>>;
137
+ export interface TableActionBarProps extends React.HTMLAttributes<HTMLDivElement> {
138
+ /** Selection count to display */
139
+ selectionCount?: number;
140
+ /** Left side content */
141
+ left?: React.ReactNode;
142
+ /** Right side content */
143
+ right?: React.ReactNode;
144
+ }
145
+ export declare const TableActionBar: React.ForwardRefExoticComponent<TableActionBarProps & React.RefAttributes<HTMLDivElement>>;
146
+ export interface TablePaginationProps extends React.HTMLAttributes<HTMLDivElement> {
147
+ /** Current page (1-indexed) */
148
+ page: number;
149
+ /** Total number of pages */
150
+ totalPages: number;
151
+ /** Total number of items */
152
+ totalItems?: number;
153
+ /** Items per page */
154
+ pageSize: number;
155
+ /** Available page sizes */
156
+ pageSizeOptions?: number[];
157
+ /** Callback when page changes */
158
+ onPageChange: (page: number) => void;
159
+ /** Callback when page size changes */
160
+ onPageSizeChange?: (pageSize: number) => void;
161
+ }
162
+ export declare const TablePagination: React.ForwardRefExoticComponent<TablePaginationProps & React.RefAttributes<HTMLDivElement>>;
163
+ export interface ExpandIconProps extends React.HTMLAttributes<HTMLSpanElement> {
164
+ expanded?: boolean;
165
+ }
166
+ export declare const ExpandIcon: React.ForwardRefExoticComponent<ExpandIconProps & React.RefAttributes<HTMLSpanElement>>;
167
+ export { Table as BhTable, TableWrapper as BhTableWrapper, TableCaption as BhTableCaption, TableHead as BhThead, TableBody as BhTbody, TableFooter as BhTfoot, TableRow as BhTr, TableHeaderCell as BhTh, TableCell as BhTd, TableEmpty as BhTableEmpty, TableActionBar as BhTableActionBar, TablePagination as BhTablePagination, ExpandIcon as BhExpandIcon, };
168
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAgD,MAAM,OAAO,CAAC;AAOrE,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAC1D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAgCpD,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,kCAAkC;IAClC,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AM,WAAW,oBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,iCAAiC;IACjC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAED,eAAO,MAAM,eAAe,6FAwF3B,CAAC;AAQF,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,yFAQtB,CAAC;AAQF,OAAO,EACL,KAAK,IAAI,OAAO,EAChB,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAC9B,SAAS,IAAI,OAAO,EACpB,SAAS,IAAI,OAAO,EACpB,WAAW,IAAI,OAAO,EACtB,QAAQ,IAAI,IAAI,EAChB,eAAe,IAAI,IAAI,EACvB,SAAS,IAAI,IAAI,EACjB,UAAU,IAAI,YAAY,EAC1B,cAAc,IAAI,gBAAgB,EAClC,eAAe,IAAI,iBAAiB,EACpC,UAAU,IAAI,YAAY,GAC3B,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * BellhopOS Table Primitives
4
+ *
5
+ * Composable table components for building static and dynamic tables.
6
+ * These primitives can be used standalone or combined with TanStack Table
7
+ * for advanced features like sorting, filtering, and pagination.
8
+ * Uses existing Bellhop components for consistency.
9
+ */
10
+ import { forwardRef, createContext, useContext } from 'react';
11
+ import { BhButtonIcon } from '../stencil-generated';
12
+ // =============================================================================
13
+ // Context
14
+ // =============================================================================
15
+ const TableContext = createContext({
16
+ size: 'default',
17
+ variant: 'default',
18
+ hoverable: true,
19
+ });
20
+ const useTableContext = () => useContext(TableContext);
21
+ // =============================================================================
22
+ // Utility Functions
23
+ // =============================================================================
24
+ function clsx(...classes) {
25
+ return classes.filter(Boolean).join(' ');
26
+ }
27
+ export const TableWrapper = forwardRef(({ className, children, maxHeight, maxWidth, scrollX, scrollY, style, ...props }, ref) => {
28
+ return (_jsx("div", { ref: ref, className: clsx('bh-table-wrapper', scrollX && 'bh-table-wrapper--scroll-x', scrollY && 'bh-table-wrapper--scroll-y', className), style: {
29
+ maxHeight: maxHeight,
30
+ maxWidth: maxWidth,
31
+ ...style,
32
+ }, tabIndex: 0, ...props, children: children }));
33
+ });
34
+ TableWrapper.displayName = 'TableWrapper';
35
+ export const Table = forwardRef(({ className, children, size = 'default', variant = 'default', rounded = false, hoverable = true, responsive = false, loading = false, ...props }, ref) => {
36
+ return (_jsx(TableContext.Provider, { value: { size, variant, hoverable }, children: _jsx("table", { ref: ref, className: clsx('bh-table', `bh-table--${size}`, variant === 'bordered' && 'bh-table--bordered', variant === 'striped' && 'bh-table--striped', rounded && 'bh-table--rounded', responsive && 'bh-table--responsive', loading && 'bh-table--loading', className), ...props, children: children }) }));
37
+ });
38
+ Table.displayName = 'Table';
39
+ export const TableCaption = forwardRef(({ className, children, position = 'top', srOnly = false, ...props }, ref) => {
40
+ return (_jsx("caption", { ref: ref, className: clsx('bh-caption', position === 'bottom' && 'bh-caption--bottom', srOnly && 'bh-caption--sr-only', className), ...props, children: children }));
41
+ });
42
+ TableCaption.displayName = 'TableCaption';
43
+ export const TableHead = forwardRef(({ className, children, sticky = false, subtle = false, ...props }, ref) => {
44
+ return (_jsx("thead", { ref: ref, className: clsx('bh-thead', sticky && 'bh-thead--sticky', subtle && 'bh-thead--subtle', className), ...props, children: children }));
45
+ });
46
+ TableHead.displayName = 'TableHead';
47
+ export const TableBody = forwardRef(({ className, children, ...props }, ref) => {
48
+ return (_jsx("tbody", { ref: ref, className: clsx('bh-tbody', className), ...props, children: children }));
49
+ });
50
+ TableBody.displayName = 'TableBody';
51
+ export const TableFooter = forwardRef(({ className, children, ...props }, ref) => {
52
+ return (_jsx("tfoot", { ref: ref, className: clsx('bh-tfoot', className), ...props, children: children }));
53
+ });
54
+ TableFooter.displayName = 'TableFooter';
55
+ export const TableRow = forwardRef(({ className, children, selected = false, clickable = false, expandable = false, expanded = false, filter = false, expansion = false, ...props }, ref) => {
56
+ const { hoverable } = useTableContext();
57
+ return (_jsx("tr", { ref: ref, className: clsx('bh-tr', hoverable && 'bh-tr--hoverable', selected && 'bh-tr--selected', clickable && 'bh-tr--clickable', expandable && 'bh-tr--expandable', expanded && 'bh-tr--expanded', filter && 'bh-tr--filter', expansion && 'bh-tr--expansion', className), ...props, children: children }));
58
+ });
59
+ TableRow.displayName = 'TableRow';
60
+ export const TableHeaderCell = forwardRef(({ className, children, align = 'left', sortable = false, sortDirection = null, shrink = false, expand = false, checkbox = false, actions = false, pinnedLeft = false, pinnedRight = false, onClick, ...props }, ref) => {
61
+ const isSorted = sortDirection !== null;
62
+ return (_jsx("th", { ref: ref, className: clsx('bh-th', `bh-th--${align}`, sortable && 'bh-th--sortable', isSorted && 'bh-th--sorted', shrink && 'bh-th--shrink', expand && 'bh-th--expand', checkbox && 'bh-th--checkbox', actions && 'bh-th--actions', pinnedLeft && 'bh-th--pinned-left', pinnedRight && 'bh-th--pinned-right', className), onClick: sortable ? onClick : undefined, "aria-sort": sortDirection === 'asc'
63
+ ? 'ascending'
64
+ : sortDirection === 'desc'
65
+ ? 'descending'
66
+ : undefined, ...props, children: _jsxs("span", { className: "bh-th__content", children: [children, sortable && isSorted && (_jsx("span", { className: "bh-th__sort-icon material-symbols-outlined", children: sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward' }))] }) }));
67
+ });
68
+ TableHeaderCell.displayName = 'TableHeaderCell';
69
+ export const TableCell = forwardRef(({ className, children, align = 'left', numeric = false, truncate = false, wrap = false, shrink = false, expand = false, checkbox = false, actions = false, expandTrigger = false, filter = false, expansion = false, pinnedLeft = false, pinnedRight = false, dataLabel, ...props }, ref) => {
70
+ return (_jsx("td", { ref: ref, className: clsx('bh-td', `bh-td--${align}`, numeric && 'bh-td--numeric', truncate && 'bh-td--truncate', wrap && 'bh-td--wrap', shrink && 'bh-td--shrink', expand && 'bh-td--expand', checkbox && 'bh-td--checkbox', actions && 'bh-td--actions', expandTrigger && 'bh-td--expand-trigger', filter && 'bh-td--filter', expansion && 'bh-td--expansion', pinnedLeft && 'bh-td--pinned-left', pinnedRight && 'bh-td--pinned-right', className), "data-label": dataLabel, ...props, children: children }));
71
+ });
72
+ TableCell.displayName = 'TableCell';
73
+ export const TableEmpty = forwardRef(({ className, children, icon, title, description, colSpan = 1, ...props }, ref) => {
74
+ return (_jsx("tr", { ref: ref, children: _jsx("td", { colSpan: colSpan, children: _jsxs("div", { className: clsx('bh-table-empty', className), ...props, children: [icon && _jsx("div", { className: "bh-table-empty__icon", children: icon }), title && _jsx("div", { className: "bh-table-empty__title", children: title }), description && (_jsx("div", { className: "bh-table-empty__description", children: description })), children] }) }) }));
75
+ });
76
+ TableEmpty.displayName = 'TableEmpty';
77
+ export const TableActionBar = forwardRef(({ className, children, selectionCount, left, right, ...props }, ref) => {
78
+ const hasSelection = selectionCount !== undefined && selectionCount > 0;
79
+ return (_jsxs("div", { ref: ref, className: clsx('bh-table-action-bar', hasSelection && 'bh-table-action-bar--selected', className), ...props, children: [_jsxs("div", { className: "bh-table-action-bar__left", children: [hasSelection && (_jsxs("span", { className: "bh-table-action-bar__selection-count", children: [selectionCount, " selected"] })), left] }), _jsx("div", { className: "bh-table-action-bar__right", children: right }), children] }));
80
+ });
81
+ TableActionBar.displayName = 'TableActionBar';
82
+ export const TablePagination = forwardRef(({ className, page, totalPages, totalItems, pageSize, pageSizeOptions = [10, 25, 50, 100], onPageChange, onPageSizeChange, ...props }, ref) => {
83
+ const startItem = (page - 1) * pageSize + 1;
84
+ const endItem = Math.min(page * pageSize, totalItems || page * pageSize);
85
+ return (_jsxs("div", { ref: ref, className: clsx('bh-table-pagination', className), ...props, children: [_jsx("div", { className: "bh-table-pagination__info", children: totalItems !== undefined ? (_jsxs(_Fragment, { children: ["Showing ", startItem, " to ", endItem, " of ", totalItems, " results"] })) : (_jsxs(_Fragment, { children: ["Page ", page, " of ", totalPages] })) }), _jsxs("div", { className: "bh-table-pagination__controls", children: [onPageSizeChange && (_jsxs("div", { className: "bh-table-pagination__page-size", children: [_jsx("span", { children: "Rows per page:" }), _jsx("select", { value: pageSize, onChange: (e) => onPageSizeChange(Number(e.target.value)), className: "bh-table-pagination__select", children: pageSizeOptions.map((size) => (_jsx("option", { value: size, children: size }, size))) })] })), _jsx(BhButtonIcon, { iconName: "first_page", size: "sm", hierarchy: "quaternary", disabled: page <= 1, onBhClick: () => onPageChange(1), "aria-label": "First page" }), _jsx(BhButtonIcon, { iconName: "chevron_left", size: "sm", hierarchy: "quaternary", disabled: page <= 1, onBhClick: () => onPageChange(page - 1), "aria-label": "Previous page" }), _jsx(BhButtonIcon, { iconName: "chevron_right", size: "sm", hierarchy: "quaternary", disabled: page >= totalPages, onBhClick: () => onPageChange(page + 1), "aria-label": "Next page" }), _jsx(BhButtonIcon, { iconName: "last_page", size: "sm", hierarchy: "quaternary", disabled: page >= totalPages, onBhClick: () => onPageChange(totalPages), "aria-label": "Last page" })] })] }));
86
+ });
87
+ TablePagination.displayName = 'TablePagination';
88
+ export const ExpandIcon = forwardRef(({ className, expanded = false, ...props }, ref) => {
89
+ return (_jsx("span", { ref: ref, className: clsx('bh-expand-icon', className), ...props, children: _jsx("span", { className: "material-symbols-outlined", children: "chevron_right" }) }));
90
+ });
91
+ ExpandIcon.displayName = 'ExpandIcon';
92
+ // =============================================================================
93
+ // Exports
94
+ // =============================================================================
95
+ export { Table as BhTable, TableWrapper as BhTableWrapper, TableCaption as BhTableCaption, TableHead as BhThead, TableBody as BhTbody, TableFooter as BhTfoot, TableRow as BhTr, TableHeaderCell as BhTh, TableCell as BhTd, TableEmpty as BhTableEmpty, TableActionBar as BhTableActionBar, TablePagination as BhTablePagination, ExpandIcon as BhExpandIcon, };
package/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * BellhopOS React Components
3
+ *
4
+ * This package provides:
5
+ * 1. React wrapper components for BellhopOS Stencil web components (auto-generated)
6
+ * 2. Native React table primitives with TanStack Table integration
7
+ */
8
+ export * from './components/stencil-generated';
9
+ export type { ButtonHierarchy, ButtonIconPosition, ButtonSize, } from '@actabldesign/bellhop-core';
10
+ export { Table, TableWrapper, TableCaption, TableHead, TableBody, TableFooter, TableRow, TableHeaderCell, TableCell, TableEmpty, TableActionBar, TablePagination, ExpandIcon, BhTable, BhTableWrapper, BhTableCaption, BhThead, BhTbody, BhTfoot, BhTr, BhTh, BhTd, BhTableEmpty, BhTableActionBar, BhTablePagination, BhExpandIcon, } from './components/table';
11
+ export type { TableProps, TableWrapperProps, TableCaptionProps, TableHeadProps, TableBodyProps, TableFooterProps, TableRowProps, TableHeaderCellProps, TableCellProps, TableEmptyProps, TableActionBarProps, TablePaginationProps, ExpandIconProps, TableSize, TableVariant, CellAlign, } from './components/table';
12
+ export { DataTable, BhDataTable, useDataTable, createSelectColumn, createExpandColumn, createEditActionsColumn, } from './components/table/DataTable';
13
+ export type { DataTableProps, UseDataTableOptions, ColumnDef, SortingState, ColumnFiltersState, RowSelectionState, EditMode, EditState, EditingValues, RowChanges, DataTableColumnMeta, } from './components/table/DataTable';
14
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,gCAAgC,CAAC;AAG/C,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,UAAU,GACX,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAEL,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,eAAe,EACf,SAAS,EACT,UAAU,EACV,cAAc,EACd,eAAe,EACf,UAAU,EAEV,OAAO,EACP,cAAc,EACd,cAAc,EACd,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,SAAS,GACV,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EACL,SAAS,EACT,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,aAAa,EACb,UAAU,EACV,mBAAmB,GACpB,MAAM,8BAA8B,CAAC"}
package/index.js ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * BellhopOS React Components
3
+ *
4
+ * This package provides:
5
+ * 1. React wrapper components for BellhopOS Stencil web components (auto-generated)
6
+ * 2. Native React table primitives with TanStack Table integration
7
+ */
8
+ // Re-export all generated Stencil React components
9
+ export * from './components/stencil-generated';
10
+ // =============================================================================
11
+ // Table Primitives
12
+ // =============================================================================
13
+ export {
14
+ // Table primitives
15
+ Table, TableWrapper, TableCaption, TableHead, TableBody, TableFooter, TableRow, TableHeaderCell, TableCell, TableEmpty, TableActionBar, TablePagination, ExpandIcon,
16
+ // Aliased exports (Bh prefix)
17
+ BhTable, BhTableWrapper, BhTableCaption, BhThead, BhTbody, BhTfoot, BhTr, BhTh, BhTd, BhTableEmpty, BhTableActionBar, BhTablePagination, BhExpandIcon, } from './components/table';
18
+ // =============================================================================
19
+ // DataTable (TanStack Table integration)
20
+ // =============================================================================
21
+ export { DataTable, BhDataTable, useDataTable, createSelectColumn, createExpandColumn, createEditActionsColumn, } from './components/table/DataTable';
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@actabldesign/bellhop-react",
3
+ "version": "0.0.3+9324769",
4
+ "description": "BellhopOS React wrappers for Stencil components",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "peerDependencies": {
16
+ "react": ">=16.8.0",
17
+ "react-dom": ">=16.8.0",
18
+ "@actabldesign/bellhop-core": "^0.0.3+9324769"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/actabldesign/bellhop-dist.git",
23
+ "directory": "react"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ }
28
+ }