@raystack/apsara 0.48.0 → 0.48.2
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/dist/components/avatar/avatar.cjs +2 -3
- package/dist/components/avatar/avatar.cjs.map +1 -1
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +3 -4
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/calendar/calendar.cjs +12 -13
- package/dist/components/calendar/calendar.cjs.map +1 -1
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/calendar.js +13 -14
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/checkbox/checkbox.cjs +1 -2
- package/dist/components/checkbox/checkbox.cjs.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +2 -3
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/data-table/components/content.cjs +8 -8
- package/dist/components/data-table/components/content.cjs.map +1 -1
- package/dist/components/data-table/components/content.js +3 -3
- package/dist/components/data-table/components/content.js.map +1 -1
- package/dist/components/data-table/components/toolbar.cjs +2 -2
- package/dist/components/data-table/components/toolbar.cjs.map +1 -1
- package/dist/components/data-table/components/toolbar.d.ts.map +1 -1
- package/dist/components/data-table/components/toolbar.js +2 -2
- package/dist/components/data-table/components/toolbar.js.map +1 -1
- package/dist/components/dialog/dialog.cjs +7 -8
- package/dist/components/dialog/dialog.cjs.map +1 -1
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +8 -9
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/empty-state/empty-state.cjs +5 -5
- package/dist/components/empty-state/empty-state.cjs.map +1 -1
- package/dist/components/empty-state/empty-state.d.ts +3 -3
- package/dist/components/empty-state/empty-state.d.ts.map +1 -1
- package/dist/components/empty-state/empty-state.js +5 -5
- package/dist/components/empty-state/empty-state.js.map +1 -1
- package/dist/components/filter-chip/filter-chip.cjs +2 -2
- package/dist/components/filter-chip/filter-chip.js +2 -2
- package/dist/components/input-field/input-field.cjs +12 -13
- package/dist/components/input-field/input-field.cjs.map +1 -1
- package/dist/components/input-field/input-field.d.ts +4 -4
- package/dist/components/input-field/input-field.d.ts.map +1 -1
- package/dist/components/input-field/input-field.js +13 -14
- package/dist/components/input-field/input-field.js.map +1 -1
- package/dist/components/select/select-root.cjs +6 -0
- package/dist/components/select/select-root.cjs.map +1 -1
- package/dist/components/select/select-root.d.ts.map +1 -1
- package/dist/components/select/select-root.js +6 -0
- package/dist/components/select/select-root.js.map +1 -1
- package/dist/components/sidebar/sidebar.cjs +2 -3
- package/dist/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar.js +3 -4
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/skeleton/skeleton.cjs +3 -3
- package/dist/components/skeleton/skeleton.cjs.map +1 -1
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +3 -3
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/text-area/text-area.cjs +4 -5
- package/dist/components/text-area/text-area.cjs.map +1 -1
- package/dist/components/text-area/text-area.d.ts +2 -2
- package/dist/components/text-area/text-area.d.ts.map +1 -1
- package/dist/components/text-area/text-area.js +4 -5
- package/dist/components/text-area/text-area.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +12 -6
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
4
|
var reactIcons_esm = require('../../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
|
|
5
|
-
var index = require('../../../node_modules/.pnpm/@tanstack_react-table@8.9.2_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@tanstack/react-table/build/lib/index.cjs');
|
|
6
|
-
var
|
|
5
|
+
var index$1 = require('../../../node_modules/.pnpm/@tanstack_react-table@8.9.2_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@tanstack/react-table/build/lib/index.cjs');
|
|
6
|
+
var index = require('../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var badge = require('../../badge/badge.cjs');
|
|
9
9
|
var emptyState = require('../../empty-state/empty-state.cjs');
|
|
@@ -16,7 +16,7 @@ var useDataTable = require('../hooks/useDataTable.cjs');
|
|
|
16
16
|
function Headers({ headerGroups = [], className = '' }) {
|
|
17
17
|
return (jsxRuntime.jsxRuntimeExports.jsx(table.Table.Header, { className: className, children: headerGroups?.map(headerGroup => (jsxRuntime.jsxRuntimeExports.jsx(table.Table.Row, { children: headerGroup?.headers?.map(header => {
|
|
18
18
|
const columnDef = header.column.columnDef;
|
|
19
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(table.Table.Head, { colSpan: header.colSpan, className: columnDef.classNames?.header, style: columnDef.styles?.header, children: index.flexRender(columnDef.header, header.getContext()) }, header.id));
|
|
19
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(table.Table.Head, { colSpan: header.colSpan, className: columnDef.classNames?.header, style: columnDef.styles?.header, children: index$1.flexRender(columnDef.header, header.getContext()) }, header.id));
|
|
20
20
|
}) }, headerGroup?.id))) }));
|
|
21
21
|
}
|
|
22
22
|
function LoaderRows({ rowCount, columnCount }) {
|
|
@@ -31,15 +31,15 @@ function GroupHeader({ colSpan, data }) {
|
|
|
31
31
|
}
|
|
32
32
|
const Rows = React.forwardRef((props, lastRowRef) => {
|
|
33
33
|
const { rows = [], onRowClick, classNames } = props;
|
|
34
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, { children: rows?.map((row, index$
|
|
34
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, { children: rows?.map((row, index$2) => {
|
|
35
35
|
const isSelected = row.getIsSelected();
|
|
36
36
|
const cells = row.getVisibleCells() || [];
|
|
37
37
|
const isSectionHeadingRow = row.depth === 0 && row.getIsExpanded();
|
|
38
|
-
const isLastRow = index$
|
|
39
|
-
const rowKey = row.id + '-' + index$
|
|
40
|
-
return isSectionHeadingRow ? (jsxRuntime.jsxRuntimeExports.jsx(GroupHeader, { colSpan: cells.length, data: row.original }, rowKey)) : (jsxRuntime.jsxRuntimeExports.jsx(table.Table.Row, { className:
|
|
38
|
+
const isLastRow = index$2 === rows.length - 1;
|
|
39
|
+
const rowKey = row.id + '-' + index$2;
|
|
40
|
+
return isSectionHeadingRow ? (jsxRuntime.jsxRuntimeExports.jsx(GroupHeader, { colSpan: cells.length, data: row.original }, rowKey)) : (jsxRuntime.jsxRuntimeExports.jsx(table.Table.Row, { className: index.cx(dataTable_module.default['row'], onRowClick ? dataTable_module.default['clickable'] : '', classNames?.row), "data-state": isSelected && 'selected', ref: isLastRow ? lastRowRef : undefined, onClick: () => onRowClick?.(row.original), children: cells.map(cell => {
|
|
41
41
|
const columnDef = cell.column.columnDef;
|
|
42
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(table.Table.Cell, { className:
|
|
42
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(table.Table.Cell, { className: index.cx(dataTable_module.default['cell'], columnDef.classNames?.cell), style: columnDef.styles?.cell, children: index$1.flexRender(columnDef.cell, cell.getContext()) }, cell.id));
|
|
43
43
|
}) }, rowKey));
|
|
44
44
|
}) }));
|
|
45
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.cjs","sources":["../../../../components/data-table/components/content.tsx"],"sourcesContent":["import { TableIcon } from '@radix-ui/react-icons';\nimport type { HeaderGroup, Row } from '@tanstack/react-table';\nimport { flexRender } from '@tanstack/react-table';\nimport clsx from 'clsx';\nimport {\n ForwardedRef,\n forwardRef,\n useCallback,\n useEffect,\n useRef\n} from 'react';\n\nimport { Badge } from '../../badge';\nimport { EmptyState } from '../../empty-state';\nimport { Flex } from '../../flex';\nimport { Skeleton } from '../../skeleton';\nimport { Table } from '../../table';\nimport styles from '../data-table.module.css';\nimport {\n DataTableColumnDef,\n DataTableContentProps,\n GroupedData\n} from '../data-table.types';\nimport { useDataTable } from '../hooks/useDataTable';\n\nfunction Headers<TData>({\n headerGroups = [],\n className = ''\n}: {\n headerGroups: HeaderGroup<TData>[];\n className?: string;\n}) {\n return (\n <Table.Header className={className}>\n {headerGroups?.map(headerGroup => (\n <Table.Row key={headerGroup?.id}>\n {headerGroup?.headers?.map(header => {\n const columnDef = header.column.columnDef as DataTableColumnDef<\n TData,\n unknown\n >;\n return (\n <Table.Head\n key={header.id}\n colSpan={header.colSpan}\n className={columnDef.classNames?.header}\n style={columnDef.styles?.header}\n >\n {flexRender(columnDef.header, header.getContext())}\n </Table.Head>\n );\n })}\n </Table.Row>\n ))}\n </Table.Header>\n );\n}\n\ninterface RowsProps<TData> {\n rows: Row<TData>[];\n lastRowRef?: ForwardedRef<HTMLTableRowElement>;\n onRowClick?: (row: TData) => void;\n classNames?: {\n row?: string;\n };\n}\n\nfunction LoaderRows({\n rowCount,\n columnCount\n}: {\n rowCount: number;\n columnCount: number;\n}) {\n const rows = Array.from({ length: rowCount });\n return rows.map((_, rowIndex) => {\n const columns = Array.from({ length: columnCount });\n return (\n <Table.Row key={'loading-row-' + rowIndex}>\n {columns.map((_, colIndex) => (\n <Table.Cell key={'loading-column-' + colIndex}>\n <Skeleton />\n </Table.Cell>\n ))}\n </Table.Row>\n );\n });\n}\n\nfunction GroupHeader<TData>({\n colSpan,\n data\n}: {\n colSpan: number;\n data: GroupedData<TData>;\n}) {\n return (\n <Table.SectionHeader colSpan={colSpan}>\n <Flex gap={3} align='center'>\n {data?.label}\n {data.showGroupCount ? (\n <Badge variant='neutral'>{data?.count}</Badge>\n ) : null}\n </Flex>\n </Table.SectionHeader>\n );\n}\n\nconst Rows = forwardRef<HTMLTableRowElement, RowsProps<unknown>>(\n (props, lastRowRef) => {\n const { rows = [], onRowClick, classNames } = props;\n return (\n <>\n {rows?.map((row, index) => {\n const isSelected = row.getIsSelected();\n const cells = row.getVisibleCells() || [];\n const isSectionHeadingRow = row.depth === 0 && row.getIsExpanded();\n const isLastRow = index === rows.length - 1;\n const rowKey = row.id + '-' + index;\n return isSectionHeadingRow ? (\n <GroupHeader\n key={rowKey}\n colSpan={cells.length}\n data={row.original as GroupedData<unknown>}\n />\n ) : (\n <Table.Row\n key={rowKey}\n className={clsx(\n styles['row'],\n onRowClick ? styles['clickable'] : '',\n classNames?.row\n )}\n data-state={isSelected && 'selected'}\n ref={isLastRow ? lastRowRef : undefined}\n onClick={() => onRowClick?.(row.original)}\n >\n {cells.map(cell => {\n const columnDef = cell.column.columnDef as DataTableColumnDef<\n unknown,\n unknown\n >;\n return (\n <Table.Cell\n key={cell.id}\n className={clsx(styles['cell'], columnDef.classNames?.cell)}\n style={columnDef.styles?.cell}\n >\n {flexRender(columnDef.cell, cell.getContext())}\n </Table.Cell>\n );\n })}\n </Table.Row>\n );\n })}\n </>\n );\n }\n);\n\nconst DefaultEmptyComponent = () => (\n <EmptyState icon={<TableIcon />} heading='No Data' />\n);\n\nexport function Content({\n emptyState,\n classNames = {}\n}: DataTableContentProps) {\n const {\n onRowClick,\n table,\n mode,\n isLoading,\n loadMoreData,\n loadingRowCount = 3\n } = useDataTable();\n const headerGroups = table?.getHeaderGroups();\n const rowModel = table?.getRowModel();\n const { rows = [] } = rowModel || {};\n\n const lastRowRef = useRef<HTMLTableRowElement | null>(null);\n const observerRef = useRef<IntersectionObserver | null>(null);\n\n const handleObserver = useCallback(\n (entries: IntersectionObserverEntry[]) => {\n const target = entries[0];\n if (target.isIntersecting && !isLoading) {\n loadMoreData();\n }\n },\n [loadMoreData, isLoading]\n );\n\n useEffect(() => {\n if (mode !== 'server') return;\n\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n\n observerRef.current = new IntersectionObserver(handleObserver, {\n threshold: 0.1\n });\n const lastRow = lastRowRef.current;\n if (lastRow) {\n observerRef.current.observe(lastRow);\n }\n\n return () => {\n if (observerRef.current && lastRow) {\n observerRef.current.unobserve(lastRow);\n observerRef.current.disconnect();\n }\n };\n }, [mode, rows.length, handleObserver]);\n\n const visibleColumnsLength = table.getVisibleLeafColumns().length;\n\n return (\n <div className={classNames.root}>\n <Table className={classNames.table}>\n <Headers headerGroups={headerGroups} className={classNames.header} />\n <Table.Body className={classNames.body}>\n {rows?.length || isLoading ? (\n <>\n <Rows\n rows={rows}\n ref={lastRowRef}\n onRowClick={onRowClick}\n classNames={{\n row: classNames.row\n }}\n />\n {isLoading ? (\n <LoaderRows\n rowCount={loadingRowCount}\n columnCount={visibleColumnsLength}\n />\n ) : null}\n </>\n ) : (\n <Table.Row>\n <Table.Cell colSpan={visibleColumnsLength}>\n {emptyState || <DefaultEmptyComponent />}\n </Table.Cell>\n </Table.Row>\n )}\n </Table.Body>\n </Table>\n </div>\n );\n}\n"],"names":["_jsx","Table","flexRender","Skeleton","_jsxs","Flex","Badge","forwardRef","_Fragment","index","clsx","styles","EmptyState","TableIcon","table","useDataTable","useRef","useCallback","useEffect"],"mappings":";;;;;;;;;;;;;;;AAyBA,SAAS,OAAO,CAAQ,EACtB,YAAY,GAAG,EAAE,EACjB,SAAS,GAAG,EAAE,EAIf,EAAA;AACC,IAAA,QACEA,gCAAA,CAACC,WAAK,CAAC,MAAM,EAAC,EAAA,SAAS,EAAE,SAAS,EAC/B,QAAA,EAAA,YAAY,EAAE,GAAG,CAAC,WAAW,KAC5BD,gCAAA,CAACC,WAAK,CAAC,GAAG,EACP,EAAA,QAAA,EAAA,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAG;AAClC,gBAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,SAG/B,CAAC;gBACF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,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,UAAU,CAAC,IAAI,EAC7B,QAAA,EAAAI,iCAAA,CAACH,WAAK,EAAA,EAAC,SAAS,EAAE,UAAU,CAAC,KAAK,EAChC,QAAA,EAAA,CAAAD,gCAAA,CAAC,OAAO,EAAA,EAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC,MAAM,EAAI,CAAA,EACrEA,iCAACC,WAAK,CAAC,IAAI,EAAA,EAAC,SAAS,EAAE,UAAU,CAAC,IAAI,EACnC,QAAA,EAAA,IAAI,EAAE,MAAM,IAAI,SAAS,IACxBG,iCAAA,CAAAI,qCAAA,EAAA,EAAA,QAAA,EAAA,CACER,gCAAC,CAAA,IAAI,EACH,EAAA,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,UAAU,EACf,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE;oCACV,GAAG,EAAE,UAAU,CAAC,GAAG;iCACpB,EACD,CAAA,EACD,SAAS,IACRA,gCAAC,CAAA,UAAU,EACT,EAAA,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,oBAAoB,EAAA,CACjC,IACA,IAAI,CAAA,EAAA,CACP,KAEHA,gCAAC,CAAAC,WAAK,CAAC,GAAG,EACR,EAAA,QAAA,EAAAD,gCAAA,CAACC,WAAK,CAAC,IAAI,EAAC,EAAA,OAAO,EAAE,oBAAoB,YACtC,UAAU,IAAID,gCAAC,CAAA,qBAAqB,EAAG,EAAA,CAAA,EAAA,CAC7B,EACH,CAAA,CACb,EACU,CAAA,CAAA,EAAA,CACP,EACJ,CAAA,EACN;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"content.cjs","sources":["../../../../components/data-table/components/content.tsx"],"sourcesContent":["import { TableIcon } from '@radix-ui/react-icons';\nimport type { HeaderGroup, Row } from '@tanstack/react-table';\nimport { flexRender } from '@tanstack/react-table';\nimport { cx } from 'class-variance-authority';\nimport {\n ForwardedRef,\n forwardRef,\n useCallback,\n useEffect,\n useRef\n} from 'react';\n\nimport { Badge } from '../../badge';\nimport { EmptyState } from '../../empty-state';\nimport { Flex } from '../../flex';\nimport { Skeleton } from '../../skeleton';\nimport { Table } from '../../table';\nimport styles from '../data-table.module.css';\nimport {\n DataTableColumnDef,\n DataTableContentProps,\n GroupedData\n} from '../data-table.types';\nimport { useDataTable } from '../hooks/useDataTable';\n\nfunction Headers<TData>({\n headerGroups = [],\n className = ''\n}: {\n headerGroups: HeaderGroup<TData>[];\n className?: string;\n}) {\n return (\n <Table.Header className={className}>\n {headerGroups?.map(headerGroup => (\n <Table.Row key={headerGroup?.id}>\n {headerGroup?.headers?.map(header => {\n const columnDef = header.column.columnDef as DataTableColumnDef<\n TData,\n unknown\n >;\n return (\n <Table.Head\n key={header.id}\n colSpan={header.colSpan}\n className={columnDef.classNames?.header}\n style={columnDef.styles?.header}\n >\n {flexRender(columnDef.header, header.getContext())}\n </Table.Head>\n );\n })}\n </Table.Row>\n ))}\n </Table.Header>\n );\n}\n\ninterface RowsProps<TData> {\n rows: Row<TData>[];\n lastRowRef?: ForwardedRef<HTMLTableRowElement>;\n onRowClick?: (row: TData) => void;\n classNames?: {\n row?: string;\n };\n}\n\nfunction LoaderRows({\n rowCount,\n columnCount\n}: {\n rowCount: number;\n columnCount: number;\n}) {\n const rows = Array.from({ length: rowCount });\n return rows.map((_, rowIndex) => {\n const columns = Array.from({ length: columnCount });\n return (\n <Table.Row key={'loading-row-' + rowIndex}>\n {columns.map((_, colIndex) => (\n <Table.Cell key={'loading-column-' + colIndex}>\n <Skeleton />\n </Table.Cell>\n ))}\n </Table.Row>\n );\n });\n}\n\nfunction GroupHeader<TData>({\n colSpan,\n data\n}: {\n colSpan: number;\n data: GroupedData<TData>;\n}) {\n return (\n <Table.SectionHeader colSpan={colSpan}>\n <Flex gap={3} align='center'>\n {data?.label}\n {data.showGroupCount ? (\n <Badge variant='neutral'>{data?.count}</Badge>\n ) : null}\n </Flex>\n </Table.SectionHeader>\n );\n}\n\nconst Rows = forwardRef<HTMLTableRowElement, RowsProps<unknown>>(\n (props, lastRowRef) => {\n const { rows = [], onRowClick, classNames } = props;\n return (\n <>\n {rows?.map((row, index) => {\n const isSelected = row.getIsSelected();\n const cells = row.getVisibleCells() || [];\n const isSectionHeadingRow = row.depth === 0 && row.getIsExpanded();\n const isLastRow = index === rows.length - 1;\n const rowKey = row.id + '-' + index;\n return isSectionHeadingRow ? (\n <GroupHeader\n key={rowKey}\n colSpan={cells.length}\n data={row.original as GroupedData<unknown>}\n />\n ) : (\n <Table.Row\n key={rowKey}\n className={cx(\n styles['row'],\n onRowClick ? styles['clickable'] : '',\n classNames?.row\n )}\n data-state={isSelected && 'selected'}\n ref={isLastRow ? lastRowRef : undefined}\n onClick={() => onRowClick?.(row.original)}\n >\n {cells.map(cell => {\n const columnDef = cell.column.columnDef as DataTableColumnDef<\n unknown,\n unknown\n >;\n return (\n <Table.Cell\n key={cell.id}\n className={cx(styles['cell'], columnDef.classNames?.cell)}\n style={columnDef.styles?.cell}\n >\n {flexRender(columnDef.cell, cell.getContext())}\n </Table.Cell>\n );\n })}\n </Table.Row>\n );\n })}\n </>\n );\n }\n);\n\nconst DefaultEmptyComponent = () => (\n <EmptyState icon={<TableIcon />} heading='No Data' />\n);\n\nexport function Content({\n emptyState,\n classNames = {}\n}: DataTableContentProps) {\n const {\n onRowClick,\n table,\n mode,\n isLoading,\n loadMoreData,\n loadingRowCount = 3\n } = useDataTable();\n const headerGroups = table?.getHeaderGroups();\n const rowModel = table?.getRowModel();\n const { rows = [] } = rowModel || {};\n\n const lastRowRef = useRef<HTMLTableRowElement | null>(null);\n const observerRef = useRef<IntersectionObserver | null>(null);\n\n const handleObserver = useCallback(\n (entries: IntersectionObserverEntry[]) => {\n const target = entries[0];\n if (target.isIntersecting && !isLoading) {\n loadMoreData();\n }\n },\n [loadMoreData, isLoading]\n );\n\n useEffect(() => {\n if (mode !== 'server') return;\n\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n\n observerRef.current = new IntersectionObserver(handleObserver, {\n threshold: 0.1\n });\n const lastRow = lastRowRef.current;\n if (lastRow) {\n observerRef.current.observe(lastRow);\n }\n\n return () => {\n if (observerRef.current && lastRow) {\n observerRef.current.unobserve(lastRow);\n observerRef.current.disconnect();\n }\n };\n }, [mode, rows.length, handleObserver]);\n\n const visibleColumnsLength = table.getVisibleLeafColumns().length;\n\n return (\n <div className={classNames.root}>\n <Table className={classNames.table}>\n <Headers headerGroups={headerGroups} className={classNames.header} />\n <Table.Body className={classNames.body}>\n {rows?.length || isLoading ? (\n <>\n <Rows\n rows={rows}\n ref={lastRowRef}\n onRowClick={onRowClick}\n classNames={{\n row: classNames.row\n }}\n />\n {isLoading ? (\n <LoaderRows\n rowCount={loadingRowCount}\n columnCount={visibleColumnsLength}\n />\n ) : null}\n </>\n ) : (\n <Table.Row>\n <Table.Cell colSpan={visibleColumnsLength}>\n {emptyState || <DefaultEmptyComponent />}\n </Table.Cell>\n </Table.Row>\n )}\n </Table.Body>\n </Table>\n </div>\n );\n}\n"],"names":["_jsx","Table","flexRender","Skeleton","_jsxs","Flex","Badge","forwardRef","_Fragment","index","cx","styles","EmptyState","TableIcon","table","useDataTable","useRef","useCallback","useEffect"],"mappings":";;;;;;;;;;;;;;;AAyBA,SAAS,OAAO,CAAQ,EACtB,YAAY,GAAG,EAAE,EACjB,SAAS,GAAG,EAAE,EAIf,EAAA;AACC,IAAA,QACEA,gCAAA,CAACC,WAAK,CAAC,MAAM,EAAC,EAAA,SAAS,EAAE,SAAS,EAC/B,QAAA,EAAA,YAAY,EAAE,GAAG,CAAC,WAAW,KAC5BD,gCAAA,CAACC,WAAK,CAAC,GAAG,EACP,EAAA,QAAA,EAAA,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAG;AAClC,gBAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,SAG/B,CAAC;gBACF,QACED,iCAACC,WAAK,CAAC,IAAI,EAET,EAAA,OAAO,EAAE,M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AC7B,QAAA,EAAAI,iCAAA,CAACH,WAAK,EAAA,EAAC,SAAS,EAAE,UAAU,CAAC,KAAK,EAChC,QAAA,EAAA,CAAAD,gCAAA,CAAC,OAAO,EAAA,EAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC,MAAM,EAAI,CAAA,EACrEA,iCAACC,WAAK,CAAC,IAAI,EAAA,EAAC,SAAS,EAAE,UAAU,CAAC,IAAI,EACnC,QAAA,EAAA,IAAI,EAAE,MAAM,IAAI,SAAS,IACxBG,iCAAA,CAAAI,qCAAA,EAAA,EAAA,QAAA,EAAA,CACER,gCAAC,CAAA,IAAI,EACH,EAAA,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,UAAU,EACf,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE;oCACV,GAAG,EAAE,UAAU,CAAC,GAAG;iCACpB,EACD,CAAA,EACD,SAAS,IACRA,gCAAC,CAAA,UAAU,EACT,EAAA,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,oBAAoB,EAAA,CACjC,IACA,IAAI,CAAA,EAAA,CACP,KAEHA,gCAAC,CAAAC,WAAK,CAAC,GAAG,EACR,EAAA,QAAA,EAAAD,gCAAA,CAACC,WAAK,CAAC,IAAI,EAAC,EAAA,OAAO,EAAE,oBAAoB,YACtC,UAAU,IAAID,gCAAC,CAAA,qBAAqB,EAAG,EAAA,CAAA,EAAA,CAC7B,EACH,CAAA,CACb,EACU,CAAA,CAAA,EAAA,CACP,EACJ,CAAA,EACN;AACJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
2
|
import { TableIcon } from '../../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
|
|
3
3
|
import { flexRender } from '../../../node_modules/.pnpm/@tanstack_react-table@8.9.2_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@tanstack/react-table/build/lib/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { cx } from '../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
5
5
|
import { forwardRef, useRef, useCallback, useEffect } from 'react';
|
|
6
6
|
import { Badge } from '../../badge/badge.js';
|
|
7
7
|
import { EmptyState } from '../../empty-state/empty-state.js';
|
|
@@ -35,9 +35,9 @@ const Rows = forwardRef((props, lastRowRef) => {
|
|
|
35
35
|
const isSectionHeadingRow = row.depth === 0 && row.getIsExpanded();
|
|
36
36
|
const isLastRow = index === rows.length - 1;
|
|
37
37
|
const rowKey = row.id + '-' + index;
|
|
38
|
-
return isSectionHeadingRow ? (jsxRuntimeExports.jsx(GroupHeader, { colSpan: cells.length, data: row.original }, rowKey)) : (jsxRuntimeExports.jsx(Table.Row, { className:
|
|
38
|
+
return isSectionHeadingRow ? (jsxRuntimeExports.jsx(GroupHeader, { colSpan: cells.length, data: row.original }, rowKey)) : (jsxRuntimeExports.jsx(Table.Row, { className: cx(styles['row'], onRowClick ? styles['clickable'] : '', classNames?.row), "data-state": isSelected && 'selected', ref: isLastRow ? lastRowRef : undefined, onClick: () => onRowClick?.(row.original), children: cells.map(cell => {
|
|
39
39
|
const columnDef = cell.column.columnDef;
|
|
40
|
-
return (jsxRuntimeExports.jsx(Table.Cell, { className:
|
|
40
|
+
return (jsxRuntimeExports.jsx(Table.Cell, { className: cx(styles['cell'], columnDef.classNames?.cell), style: columnDef.styles?.cell, children: flexRender(columnDef.cell, cell.getContext()) }, cell.id));
|
|
41
41
|
}) }, rowKey));
|
|
42
42
|
}) }));
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sources":["../../../../components/data-table/components/content.tsx"],"sourcesContent":["import { TableIcon } from '@radix-ui/react-icons';\nimport type { HeaderGroup, Row } from '@tanstack/react-table';\nimport { flexRender } from '@tanstack/react-table';\nimport clsx from 'clsx';\nimport {\n ForwardedRef,\n forwardRef,\n useCallback,\n useEffect,\n useRef\n} from 'react';\n\nimport { Badge } from '../../badge';\nimport { EmptyState } from '../../empty-state';\nimport { Flex } from '../../flex';\nimport { Skeleton } from '../../skeleton';\nimport { Table } from '../../table';\nimport styles from '../data-table.module.css';\nimport {\n DataTableColumnDef,\n DataTableContentProps,\n GroupedData\n} from '../data-table.types';\nimport { useDataTable } from '../hooks/useDataTable';\n\nfunction Headers<TData>({\n headerGroups = [],\n className = ''\n}: {\n headerGroups: HeaderGroup<TData>[];\n className?: string;\n}) {\n return (\n <Table.Header className={className}>\n {headerGroups?.map(headerGroup => (\n <Table.Row key={headerGroup?.id}>\n {headerGroup?.headers?.map(header => {\n const columnDef = header.column.columnDef as DataTableColumnDef<\n TData,\n unknown\n >;\n return (\n <Table.Head\n key={header.id}\n colSpan={header.colSpan}\n className={columnDef.classNames?.header}\n style={columnDef.styles?.header}\n >\n {flexRender(columnDef.header, header.getContext())}\n </Table.Head>\n );\n })}\n </Table.Row>\n ))}\n </Table.Header>\n );\n}\n\ninterface RowsProps<TData> {\n rows: Row<TData>[];\n lastRowRef?: ForwardedRef<HTMLTableRowElement>;\n onRowClick?: (row: TData) => void;\n classNames?: {\n row?: string;\n };\n}\n\nfunction LoaderRows({\n rowCount,\n columnCount\n}: {\n rowCount: number;\n columnCount: number;\n}) {\n const rows = Array.from({ length: rowCount });\n return rows.map((_, rowIndex) => {\n const columns = Array.from({ length: columnCount });\n return (\n <Table.Row key={'loading-row-' + rowIndex}>\n {columns.map((_, colIndex) => (\n <Table.Cell key={'loading-column-' + colIndex}>\n <Skeleton />\n </Table.Cell>\n ))}\n </Table.Row>\n );\n });\n}\n\nfunction GroupHeader<TData>({\n colSpan,\n data\n}: {\n colSpan: number;\n data: GroupedData<TData>;\n}) {\n return (\n <Table.SectionHeader colSpan={colSpan}>\n <Flex gap={3} align='center'>\n {data?.label}\n {data.showGroupCount ? (\n <Badge variant='neutral'>{data?.count}</Badge>\n ) : null}\n </Flex>\n </Table.SectionHeader>\n );\n}\n\nconst Rows = forwardRef<HTMLTableRowElement, RowsProps<unknown>>(\n (props, lastRowRef) => {\n const { rows = [], onRowClick, classNames } = props;\n return (\n <>\n {rows?.map((row, index) => {\n const isSelected = row.getIsSelected();\n const cells = row.getVisibleCells() || [];\n const isSectionHeadingRow = row.depth === 0 && row.getIsExpanded();\n const isLastRow = index === rows.length - 1;\n const rowKey = row.id + '-' + index;\n return isSectionHeadingRow ? (\n <GroupHeader\n key={rowKey}\n colSpan={cells.length}\n data={row.original as GroupedData<unknown>}\n />\n ) : (\n <Table.Row\n key={rowKey}\n className={clsx(\n styles['row'],\n onRowClick ? styles['clickable'] : '',\n classNames?.row\n )}\n data-state={isSelected && 'selected'}\n ref={isLastRow ? lastRowRef : undefined}\n onClick={() => onRowClick?.(row.original)}\n >\n {cells.map(cell => {\n const columnDef = cell.column.columnDef as DataTableColumnDef<\n unknown,\n unknown\n >;\n return (\n <Table.Cell\n key={cell.id}\n className={clsx(styles['cell'], columnDef.classNames?.cell)}\n style={columnDef.styles?.cell}\n >\n {flexRender(columnDef.cell, cell.getContext())}\n </Table.Cell>\n );\n })}\n </Table.Row>\n );\n })}\n </>\n );\n }\n);\n\nconst DefaultEmptyComponent = () => (\n <EmptyState icon={<TableIcon />} heading='No Data' />\n);\n\nexport function Content({\n emptyState,\n classNames = {}\n}: DataTableContentProps) {\n const {\n onRowClick,\n table,\n mode,\n isLoading,\n loadMoreData,\n loadingRowCount = 3\n } = useDataTable();\n const headerGroups = table?.getHeaderGroups();\n const rowModel = table?.getRowModel();\n const { rows = [] } = rowModel || {};\n\n const lastRowRef = useRef<HTMLTableRowElement | null>(null);\n const observerRef = useRef<IntersectionObserver | null>(null);\n\n const handleObserver = useCallback(\n (entries: IntersectionObserverEntry[]) => {\n const target = entries[0];\n if (target.isIntersecting && !isLoading) {\n loadMoreData();\n }\n },\n [loadMoreData, isLoading]\n );\n\n useEffect(() => {\n if (mode !== 'server') return;\n\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n\n observerRef.current = new IntersectionObserver(handleObserver, {\n threshold: 0.1\n });\n const lastRow = lastRowRef.current;\n if (lastRow) {\n observerRef.current.observe(lastRow);\n }\n\n return () => {\n if (observerRef.current && lastRow) {\n observerRef.current.unobserve(lastRow);\n observerRef.current.disconnect();\n }\n };\n }, [mode, rows.length, handleObserver]);\n\n const visibleColumnsLength = table.getVisibleLeafColumns().length;\n\n return (\n <div className={classNames.root}>\n <Table className={classNames.table}>\n <Headers headerGroups={headerGroups} className={classNames.header} />\n <Table.Body className={classNames.body}>\n {rows?.length || isLoading ? (\n <>\n <Rows\n rows={rows}\n ref={lastRowRef}\n onRowClick={onRowClick}\n classNames={{\n row: classNames.row\n }}\n />\n {isLoading ? (\n <LoaderRows\n rowCount={loadingRowCount}\n columnCount={visibleColumnsLength}\n />\n ) : null}\n </>\n ) : (\n <Table.Row>\n <Table.Cell colSpan={visibleColumnsLength}>\n {emptyState || <DefaultEmptyComponent />}\n </Table.Cell>\n </Table.Row>\n )}\n </Table.Body>\n </Table>\n </div>\n );\n}\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;AAyBA,SAAS,OAAO,CAAQ,EACtB,YAAY,GAAG,EAAE,EACjB,SAAS,GAAG,EAAE,EAIf,EAAA;AACC,IAAA,QACEA,qBAAA,CAAC,KAAK,CAAC,MAAM,EAAC,EAAA,SAAS,EAAE,SAAS,EAC/B,QAAA,EAAA,YAAY,EAAE,GAAG,CAAC,WAAW,KAC5BA,qBAAA,CAAC,KAAK,CAAC,GAAG,EACP,EAAA,QAAA,EAAA,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAG;AAClC,gBAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,SAG/B,CAAC;gBACF,QACEA,sBAAC,KAAK,CAAC,IAAI,EAET,EAAA,OAAO,EAAE,MAAM,CAAC,OAAO,E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EAAE,UAAU,CAAC,KAAK,EAChC,QAAA,EAAA,CAAAD,qBAAA,CAAC,OAAO,EAAA,EAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC,MAAM,EAAI,CAAA,EACrEA,sBAAC,KAAK,CAAC,IAAI,EAAA,EAAC,SAAS,EAAE,UAAU,CAAC,IAAI,EACnC,QAAA,EAAA,IAAI,EAAE,MAAM,IAAI,SAAS,IACxBC,sBAAA,CAAAC,0BAAA,EAAA,EAAA,QAAA,EAAA,CACEF,qBAAC,CAAA,IAAI,EACH,EAAA,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,UAAU,EACf,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE;oCACV,GAAG,EAAE,UAAU,CAAC,GAAG;iCACpB,EACD,CAAA,EACD,SAAS,IACRA,qBAAC,CAAA,UAAU,EACT,EAAA,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,oBAAoB,EAAA,CACjC,IACA,IAAI,CAAA,EAAA,CACP,KAEHA,qBAAC,CAAA,KAAK,CAAC,GAAG,EACR,EAAA,QAAA,EAAAA,qBAAA,CAAC,KAAK,CAAC,IAAI,EAAC,EAAA,OAAO,EAAE,oBAAoB,YACtC,UAAU,IAAIA,qBAAC,CAAA,qBAAqB,EAAG,EAAA,CAAA,EAAA,CAC7B,EACH,CAAA,CACb,EACU,CAAA,CAAA,EAAA,CACP,EACJ,CAAA,EACN;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"content.js","sources":["../../../../components/data-table/components/content.tsx"],"sourcesContent":["import { TableIcon } from '@radix-ui/react-icons';\nimport type { HeaderGroup, Row } from '@tanstack/react-table';\nimport { flexRender } from '@tanstack/react-table';\nimport { cx } from 'class-variance-authority';\nimport {\n ForwardedRef,\n forwardRef,\n useCallback,\n useEffect,\n useRef\n} from 'react';\n\nimport { Badge } from '../../badge';\nimport { EmptyState } from '../../empty-state';\nimport { Flex } from '../../flex';\nimport { Skeleton } from '../../skeleton';\nimport { Table } from '../../table';\nimport styles from '../data-table.module.css';\nimport {\n DataTableColumnDef,\n DataTableContentProps,\n GroupedData\n} from '../data-table.types';\nimport { useDataTable } from '../hooks/useDataTable';\n\nfunction Headers<TData>({\n headerGroups = [],\n className = ''\n}: {\n headerGroups: HeaderGroup<TData>[];\n className?: string;\n}) {\n return (\n <Table.Header className={className}>\n {headerGroups?.map(headerGroup => (\n <Table.Row key={headerGroup?.id}>\n {headerGroup?.headers?.map(header => {\n const columnDef = header.column.columnDef as DataTableColumnDef<\n TData,\n unknown\n >;\n return (\n <Table.Head\n key={header.id}\n colSpan={header.colSpan}\n className={columnDef.classNames?.header}\n style={columnDef.styles?.header}\n >\n {flexRender(columnDef.header, header.getContext())}\n </Table.Head>\n );\n })}\n </Table.Row>\n ))}\n </Table.Header>\n );\n}\n\ninterface RowsProps<TData> {\n rows: Row<TData>[];\n lastRowRef?: ForwardedRef<HTMLTableRowElement>;\n onRowClick?: (row: TData) => void;\n classNames?: {\n row?: string;\n };\n}\n\nfunction LoaderRows({\n rowCount,\n columnCount\n}: {\n rowCount: number;\n columnCount: number;\n}) {\n const rows = Array.from({ length: rowCount });\n return rows.map((_, rowIndex) => {\n const columns = Array.from({ length: columnCount });\n return (\n <Table.Row key={'loading-row-' + rowIndex}>\n {columns.map((_, colIndex) => (\n <Table.Cell key={'loading-column-' + colIndex}>\n <Skeleton />\n </Table.Cell>\n ))}\n </Table.Row>\n );\n });\n}\n\nfunction GroupHeader<TData>({\n colSpan,\n data\n}: {\n colSpan: number;\n data: GroupedData<TData>;\n}) {\n return (\n <Table.SectionHeader colSpan={colSpan}>\n <Flex gap={3} align='center'>\n {data?.label}\n {data.showGroupCount ? (\n <Badge variant='neutral'>{data?.count}</Badge>\n ) : null}\n </Flex>\n </Table.SectionHeader>\n );\n}\n\nconst Rows = forwardRef<HTMLTableRowElement, RowsProps<unknown>>(\n (props, lastRowRef) => {\n const { rows = [], onRowClick, classNames } = props;\n return (\n <>\n {rows?.map((row, index) => {\n const isSelected = row.getIsSelected();\n const cells = row.getVisibleCells() || [];\n const isSectionHeadingRow = row.depth === 0 && row.getIsExpanded();\n const isLastRow = index === rows.length - 1;\n const rowKey = row.id + '-' + index;\n return isSectionHeadingRow ? (\n <GroupHeader\n key={rowKey}\n colSpan={cells.length}\n data={row.original as GroupedData<unknown>}\n />\n ) : (\n <Table.Row\n key={rowKey}\n className={cx(\n styles['row'],\n onRowClick ? styles['clickable'] : '',\n classNames?.row\n )}\n data-state={isSelected && 'selected'}\n ref={isLastRow ? lastRowRef : undefined}\n onClick={() => onRowClick?.(row.original)}\n >\n {cells.map(cell => {\n const columnDef = cell.column.columnDef as DataTableColumnDef<\n unknown,\n unknown\n >;\n return (\n <Table.Cell\n key={cell.id}\n className={cx(styles['cell'], columnDef.classNames?.cell)}\n style={columnDef.styles?.cell}\n >\n {flexRender(columnDef.cell, cell.getContext())}\n </Table.Cell>\n );\n })}\n </Table.Row>\n );\n })}\n </>\n );\n }\n);\n\nconst DefaultEmptyComponent = () => (\n <EmptyState icon={<TableIcon />} heading='No Data' />\n);\n\nexport function Content({\n emptyState,\n classNames = {}\n}: DataTableContentProps) {\n const {\n onRowClick,\n table,\n mode,\n isLoading,\n loadMoreData,\n loadingRowCount = 3\n } = useDataTable();\n const headerGroups = table?.getHeaderGroups();\n const rowModel = table?.getRowModel();\n const { rows = [] } = rowModel || {};\n\n const lastRowRef = useRef<HTMLTableRowElement | null>(null);\n const observerRef = useRef<IntersectionObserver | null>(null);\n\n const handleObserver = useCallback(\n (entries: IntersectionObserverEntry[]) => {\n const target = entries[0];\n if (target.isIntersecting && !isLoading) {\n loadMoreData();\n }\n },\n [loadMoreData, isLoading]\n );\n\n useEffect(() => {\n if (mode !== 'server') return;\n\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n\n observerRef.current = new IntersectionObserver(handleObserver, {\n threshold: 0.1\n });\n const lastRow = lastRowRef.current;\n if (lastRow) {\n observerRef.current.observe(lastRow);\n }\n\n return () => {\n if (observerRef.current && lastRow) {\n observerRef.current.unobserve(lastRow);\n observerRef.current.disconnect();\n }\n };\n }, [mode, rows.length, handleObserver]);\n\n const visibleColumnsLength = table.getVisibleLeafColumns().length;\n\n return (\n <div className={classNames.root}>\n <Table className={classNames.table}>\n <Headers headerGroups={headerGroups} className={classNames.header} />\n <Table.Body className={classNames.body}>\n {rows?.length || isLoading ? (\n <>\n <Rows\n rows={rows}\n ref={lastRowRef}\n onRowClick={onRowClick}\n classNames={{\n row: classNames.row\n }}\n />\n {isLoading ? (\n <LoaderRows\n rowCount={loadingRowCount}\n columnCount={visibleColumnsLength}\n />\n ) : null}\n </>\n ) : (\n <Table.Row>\n <Table.Cell colSpan={visibleColumnsLength}>\n {emptyState || <DefaultEmptyComponent />}\n </Table.Cell>\n </Table.Row>\n )}\n </Table.Body>\n </Table>\n </div>\n );\n}\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;AAyBA,SAAS,OAAO,CAAQ,EACtB,YAAY,GAAG,EAAE,EACjB,SAAS,GAAG,EAAE,EAIf,EAAA;AACC,IAAA,QACEA,qBAAA,CAAC,KAAK,CAAC,MAAM,EAAC,EAAA,SAAS,EAAE,SAAS,EAC/B,QAAA,EAAA,YAAY,EAAE,GAAG,CAAC,WAAW,KAC5BA,qBAAA,CAAC,KAAK,CAAC,GAAG,EACP,EAAA,QAAA,EAAA,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAG;AAClC,gBAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,SAG/B,CAAC;gBACF,QACEA,sBAAC,KAAK,CAAC,IAAI,EAET,EAAA,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,SAAS,EAAE,SAAS,CAAC,UAAU,EAAE,MAAM,EACvC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAA,QAAA,EAE9B,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,E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A,EAAC,SAAS,EAAE,UAAU,CAAC,IAAI,EACnC,QAAA,EAAA,IAAI,EAAE,MAAM,IAAI,SAAS,IACxBC,sBAAA,CAAAC,0BAAA,EAAA,EAAA,QAAA,EAAA,CACEF,qBAAC,CAAA,IAAI,EACH,EAAA,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,UAAU,EACf,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE;oCACV,GAAG,EAAE,UAAU,CAAC,GAAG;iCACpB,EACD,CAAA,EACD,SAAS,IACRA,qBAAC,CAAA,UAAU,EACT,EAAA,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,oBAAoB,EAAA,CACjC,IACA,IAAI,CAAA,EAAA,CACP,KAEHA,qBAAC,CAAA,KAAK,CAAC,GAAG,EACR,EAAA,QAAA,EAAAA,qBAAA,CAAC,KAAK,CAAC,IAAI,EAAC,EAAA,OAAO,EAAE,oBAAoB,YACtC,UAAU,IAAIA,qBAAC,CAAA,qBAAqB,EAAG,EAAA,CAAA,EAAA,CAC7B,EACH,CAAA,CACb,EACU,CAAA,CAAA,EAAA,CACP,EACJ,CAAA,EACN;AACJ;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
|
-
var
|
|
4
|
+
var index = require('../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
5
5
|
var flex = require('../../flex/flex.cjs');
|
|
6
6
|
var dataTable_module = require('../data-table.module.css.cjs');
|
|
7
7
|
var displaySettings = require('./display-settings.cjs');
|
|
8
8
|
var filters = require('./filters.cjs');
|
|
9
9
|
|
|
10
10
|
function Toolbar({ className }) {
|
|
11
|
-
return (jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { className:
|
|
11
|
+
return (jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { className: index.cx(dataTable_module.default['toolbar'], className), justify: 'between', align: 'center', children: [jsxRuntime.jsxRuntimeExports.jsx(filters.Filters, {}), jsxRuntime.jsxRuntimeExports.jsx(displaySettings.DisplaySettings, {})] }));
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
exports.Toolbar = Toolbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.cjs","sources":["../../../../components/data-table/components/toolbar.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"toolbar.cjs","sources":["../../../../components/data-table/components/toolbar.tsx"],"sourcesContent":["import { cx } from 'class-variance-authority';\nimport { Flex } from '../../flex';\nimport styles from '../data-table.module.css';\nimport { DisplaySettings } from './display-settings';\nimport { Filters } from './filters';\n\nexport function Toolbar<TData, TValue>({ className }: { className?: string }) {\n return (\n <Flex\n className={cx(styles['toolbar'], className)}\n justify='between'\n align='center'\n >\n <Filters<TData, TValue> />\n <DisplaySettings />\n </Flex>\n );\n}\n"],"names":["_jsxs","Flex","cx","styles","_jsx","Filters","DisplaySettings"],"mappings":";;;;;;;;;AAMgB,SAAA,OAAO,CAAgB,EAAE,SAAS,EAA0B,EAAA;AAC1E,IAAA,QACEA,iCAAA,CAACC,SAAI,EAAA,EACH,SAAS,EAAEC,QAAE,CAACC,wBAAM,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,EAC3C,OAAO,EAAC,SAAS,EACjB,KAAK,EAAC,QAAQ,EAEd,QAAA,EAAA,CAAAC,gCAAA,CAACC,eAAO,EAAA,EAAA,CAAkB,EAC1BD,gCAAC,CAAAE,+BAAe,EAAG,EAAA,CAAA,CAAA,EAAA,CACd,EACP;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../../components/data-table/components/toolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../../components/data-table/components/toolbar.tsx"],"names":[],"mappings":"AAMA,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAW3E"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
|
-
import {
|
|
2
|
+
import { cx } from '../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
3
3
|
import { Flex } from '../../flex/flex.js';
|
|
4
4
|
import styles from '../data-table.module.css.js';
|
|
5
5
|
import { DisplaySettings } from './display-settings.js';
|
|
6
6
|
import { Filters } from './filters.js';
|
|
7
7
|
|
|
8
8
|
function Toolbar({ className }) {
|
|
9
|
-
return (jsxRuntimeExports.jsxs(Flex, { className:
|
|
9
|
+
return (jsxRuntimeExports.jsxs(Flex, { className: cx(styles['toolbar'], className), justify: 'between', align: 'center', children: [jsxRuntimeExports.jsx(Filters, {}), jsxRuntimeExports.jsx(DisplaySettings, {})] }));
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export { Toolbar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.js","sources":["../../../../components/data-table/components/toolbar.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"toolbar.js","sources":["../../../../components/data-table/components/toolbar.tsx"],"sourcesContent":["import { cx } from 'class-variance-authority';\nimport { Flex } from '../../flex';\nimport styles from '../data-table.module.css';\nimport { DisplaySettings } from './display-settings';\nimport { Filters } from './filters';\n\nexport function Toolbar<TData, TValue>({ className }: { className?: string }) {\n return (\n <Flex\n className={cx(styles['toolbar'], className)}\n justify='between'\n align='center'\n >\n <Filters<TData, TValue> />\n <DisplaySettings />\n </Flex>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAMgB,SAAA,OAAO,CAAgB,EAAE,SAAS,EAA0B,EAAA;AAC1E,IAAA,QACEA,sBAAA,CAAC,IAAI,EAAA,EACH,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,EAC3C,OAAO,EAAC,SAAS,EACjB,KAAK,EAAC,QAAQ,EAEd,QAAA,EAAA,CAAAC,qBAAA,CAAC,OAAO,EAAA,EAAA,CAAkB,EAC1BA,qBAAC,CAAA,eAAe,EAAG,EAAA,CAAA,CAAA,EAAA,CACd,EACP;AACJ;;;;"}
|
|
@@ -3,26 +3,25 @@
|
|
|
3
3
|
var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
4
|
var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
|
|
5
5
|
var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
6
|
-
var clsx = require('../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.cjs');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var flex = require('../flex/flex.cjs');
|
|
9
8
|
var dialog_module = require('./dialog.module.css.cjs');
|
|
10
9
|
var index = require('../../node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-dialog/dist/index.cjs');
|
|
11
10
|
|
|
12
11
|
const dialogContent = index$1.cva(dialog_module.default.dialogContent);
|
|
13
|
-
const DialogContent = React.forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs(index.Portal, { children: [jsxRuntime.jsxRuntimeExports.jsx(index.Overlay, { className:
|
|
12
|
+
const DialogContent = React.forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs(index.Portal, { children: [jsxRuntime.jsxRuntimeExports.jsx(index.Overlay, { className: index$1.cx(dialog_module.default.dialogOverlay, overlayClassName, overlayBlur && dialog_module.default.overlayBlur), style: overlayStyle, "aria-hidden": 'true', role: 'presentation' }), jsxRuntime.jsxRuntimeExports.jsx(index.Content, { ref: ref, className: dialogContent({ className }), style: { width, ...props.style }, "aria-label": ariaLabel, "aria-describedby": ariaDescription ? 'dialog-description' : undefined, ...props, children: children })] })));
|
|
14
13
|
DialogContent.displayName = index.Content.displayName;
|
|
15
|
-
const DialogHeader = ({ children, className }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { justify: 'between', align: 'center', className:
|
|
16
|
-
const DialogFooter = ({ children, className }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { gap: 5, justify: 'end', className:
|
|
17
|
-
const DialogBody = ({ children, className }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { direction: 'column', gap: 3, className:
|
|
14
|
+
const DialogHeader = ({ children, className }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { justify: 'between', align: 'center', className: index$1.cx(dialog_module.default.header, className), children: children }));
|
|
15
|
+
const DialogFooter = ({ children, className }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { gap: 5, justify: 'end', className: index$1.cx(dialog_module.default.footer, className), children: children }));
|
|
16
|
+
const DialogBody = ({ children, className }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { direction: 'column', gap: 3, className: index$1.cx(dialog_module.default.body, className), children: children }));
|
|
18
17
|
function CloseButton({ className, ...props }) {
|
|
19
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(index.Close, { className:
|
|
18
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(index.Close, { className: index$1.cx(dialog_module.default.close, className), "aria-label": 'Close dialog', ...props, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.Cross1Icon, {}) }));
|
|
20
19
|
}
|
|
21
20
|
function DialogTitle({ children, className, ...props }) {
|
|
22
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(index.Title, { ...props, role: 'heading', "aria-level": 1, className:
|
|
21
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(index.Title, { ...props, role: 'heading', "aria-level": 1, className: index$1.cx(dialog_module.default.title, className), children: children }));
|
|
23
22
|
}
|
|
24
23
|
function DialogDescription({ children, className, ...props }) {
|
|
25
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(index.Description, { ...props, className:
|
|
24
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(index.Description, { ...props, className: index$1.cx(dialog_module.default.description, className), id: 'dialog-description', role: 'document', children: children }));
|
|
26
25
|
}
|
|
27
26
|
const Dialog = Object.assign(index.Root, {
|
|
28
27
|
Trigger: index.Trigger,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.cjs","sources":["../../../components/dialog/dialog.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport { VariantProps, cva } from 'class-variance-authority';\nimport {
|
|
1
|
+
{"version":3,"file":"dialog.cjs","sources":["../../../components/dialog/dialog.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport { VariantProps, cva, cx } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef\n} from 'react';\nimport { Flex } from '../flex';\nimport styles from './dialog.module.css';\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n ...props\n },\n ref\n ) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className={cx(\n styles.dialogOverlay,\n overlayClassName,\n overlayBlur && styles.overlayBlur\n )}\n style={overlayStyle}\n aria-hidden='true'\n role='presentation'\n />\n <DialogPrimitive.Content\n ref={ref}\n className={dialogContent({ className })}\n style={{ width, ...props.style }}\n aria-label={ariaLabel}\n aria-describedby={ariaDescription ? 'dialog-description' : undefined}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex\n justify='between'\n align='center'\n className={cx(styles.header, className)}\n >\n {children}\n </Flex>\n);\n\nconst DialogFooter = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex gap={5} justify='end' className={cx(styles.footer, className)}>\n {children}\n </Flex>\n);\n\nconst DialogBody = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex direction='column' gap={3} className={cx(styles.body, className)}>\n {children}\n </Flex>\n);\n\ntype CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;\nexport function CloseButton({ className, ...props }: CloseButtonProps) {\n return (\n <DialogPrimitive.Close\n className={cx(styles.close, className)}\n aria-label='Close dialog'\n {...props}\n >\n <Cross1Icon />\n </DialogPrimitive.Close>\n );\n}\n\ninterface DialogTitleProps\n extends ComponentProps<typeof DialogPrimitive.Title> {\n children: React.ReactNode;\n}\n\nfunction DialogTitle({ children, className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n {...props}\n role='heading'\n aria-level={1}\n className={cx(styles.title, className)}\n >\n {children}\n </DialogPrimitive.Title>\n );\n}\n\ninterface DialogDescriptionProps\n extends ComponentProps<typeof DialogPrimitive.Description> {\n children: React.ReactNode;\n className?: string;\n}\n\nfunction DialogDescription({\n children,\n className,\n ...props\n}: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n {...props}\n className={cx(styles.description, className)}\n id='dialog-description'\n role='document'\n >\n {children}\n </DialogPrimitive.Description>\n );\n}\n\nexport const Dialog = Object.assign(DialogPrimitive.Root, {\n Trigger: DialogPrimitive.Trigger,\n Content: DialogContent,\n Header: DialogHeader,\n Footer: DialogFooter,\n Body: DialogBody,\n Close: DialogPrimitive.Close,\n CloseButton: CloseButton,\n Title: DialogTitle,\n Description: DialogDescription\n});\n"],"names":["cva","styles","forwardRef","_jsxs","DialogPrimitive.Portal","_jsx","DialogPrimitive.Overlay","cx","DialogPrimitive.Content","Flex","DialogPrimitive.Close","Cross1Icon","DialogPrimitive.Title","DialogPrimitive.Description","DialogPrimitive.Root","DialogPrimitive.Trigger"],"mappings":";;;;;;;;;;AAYA,MAAM,aAAa,GAAGA,WAAG,CAACC,qBAAM,CAAC,aAAa,CAAC,CAAC;AAahD,MAAM,aAAa,GAAGC,gBAAU,CAI9B,CACE,EACE,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,WAAW,GAAG,KAAK,EACnB,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,MAEHC,iCAAC,CAAAC,YAAsB,EACrB,EAAA,QAAA,EAAA,CAAAC,gCAAA,CAACC,aAAuB,EAAA,EACtB,SAAS,EAAEC,UAAE,CACXN,qBAAM,CAAC,aAAa,EACpB,gBAAgB,EAChB,WAAW,IAAIA,qBAAM,CAAC,WAAW,CAClC,EACD,KAAK,EAAE,YAAY,EAAA,aAAA,EACP,MAAM,EAClB,IAAI,EAAC,cAAc,EAAA,CACnB,EACFI,gCAAA,CAACG,aAAuB,EAAA,EACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE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AQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAWxB;AAED,eAAO,MAAM,MAAM;;;;kBA1FP,MAAM,SAAS;;;;kBAgBf,MAAM,SAAS;;;;kBAYf,MAAM,SAAS;;;;;;;CAwEzB,CAAC"}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
2
|
import { Cross1Icon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
|
|
3
|
-
import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
4
|
-
import { clsx } from '../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js';
|
|
3
|
+
import { cx, cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
5
4
|
import { forwardRef } from 'react';
|
|
6
5
|
import { Flex } from '../flex/flex.js';
|
|
7
6
|
import styles from './dialog.module.css.js';
|
|
8
7
|
import { Portal, Overlay, Content, Root, Trigger, Close, Title, Description } from '../../node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-dialog/dist/index.js';
|
|
9
8
|
|
|
10
9
|
const dialogContent = cva(styles.dialogContent);
|
|
11
|
-
const DialogContent = forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width, ...props }, ref) => (jsxRuntimeExports.jsxs(Portal, { children: [jsxRuntimeExports.jsx(Overlay, { className:
|
|
10
|
+
const DialogContent = forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width, ...props }, ref) => (jsxRuntimeExports.jsxs(Portal, { children: [jsxRuntimeExports.jsx(Overlay, { className: cx(styles.dialogOverlay, overlayClassName, overlayBlur && styles.overlayBlur), style: overlayStyle, "aria-hidden": 'true', role: 'presentation' }), jsxRuntimeExports.jsx(Content, { ref: ref, className: dialogContent({ className }), style: { width, ...props.style }, "aria-label": ariaLabel, "aria-describedby": ariaDescription ? 'dialog-description' : undefined, ...props, children: children })] })));
|
|
12
11
|
DialogContent.displayName = Content.displayName;
|
|
13
|
-
const DialogHeader = ({ children, className }) => (jsxRuntimeExports.jsx(Flex, { justify: 'between', align: 'center', className:
|
|
14
|
-
const DialogFooter = ({ children, className }) => (jsxRuntimeExports.jsx(Flex, { gap: 5, justify: 'end', className:
|
|
15
|
-
const DialogBody = ({ children, className }) => (jsxRuntimeExports.jsx(Flex, { direction: 'column', gap: 3, className:
|
|
12
|
+
const DialogHeader = ({ children, className }) => (jsxRuntimeExports.jsx(Flex, { justify: 'between', align: 'center', className: cx(styles.header, className), children: children }));
|
|
13
|
+
const DialogFooter = ({ children, className }) => (jsxRuntimeExports.jsx(Flex, { gap: 5, justify: 'end', className: cx(styles.footer, className), children: children }));
|
|
14
|
+
const DialogBody = ({ children, className }) => (jsxRuntimeExports.jsx(Flex, { direction: 'column', gap: 3, className: cx(styles.body, className), children: children }));
|
|
16
15
|
function CloseButton({ className, ...props }) {
|
|
17
|
-
return (jsxRuntimeExports.jsx(Close, { className:
|
|
16
|
+
return (jsxRuntimeExports.jsx(Close, { className: cx(styles.close, className), "aria-label": 'Close dialog', ...props, children: jsxRuntimeExports.jsx(Cross1Icon, {}) }));
|
|
18
17
|
}
|
|
19
18
|
function DialogTitle({ children, className, ...props }) {
|
|
20
|
-
return (jsxRuntimeExports.jsx(Title, { ...props, role: 'heading', "aria-level": 1, className:
|
|
19
|
+
return (jsxRuntimeExports.jsx(Title, { ...props, role: 'heading', "aria-level": 1, className: cx(styles.title, className), children: children }));
|
|
21
20
|
}
|
|
22
21
|
function DialogDescription({ children, className, ...props }) {
|
|
23
|
-
return (jsxRuntimeExports.jsx(Description, { ...props, className:
|
|
22
|
+
return (jsxRuntimeExports.jsx(Description, { ...props, className: cx(styles.description, className), id: 'dialog-description', role: 'document', children: children }));
|
|
24
23
|
}
|
|
25
24
|
const Dialog = Object.assign(Root, {
|
|
26
25
|
Trigger: Trigger,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../../components/dialog/dialog.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport { VariantProps, cva } from 'class-variance-authority';\nimport {
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../../components/dialog/dialog.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport { VariantProps, cva, cx } from 'class-variance-authority';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef\n} from 'react';\nimport { Flex } from '../flex';\nimport styles from './dialog.module.css';\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n ...props\n },\n ref\n ) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className={cx(\n styles.dialogOverlay,\n overlayClassName,\n overlayBlur && styles.overlayBlur\n )}\n style={overlayStyle}\n aria-hidden='true'\n role='presentation'\n />\n <DialogPrimitive.Content\n ref={ref}\n className={dialogContent({ className })}\n style={{ width, ...props.style }}\n aria-label={ariaLabel}\n aria-describedby={ariaDescription ? 'dialog-description' : undefined}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex\n justify='between'\n align='center'\n className={cx(styles.header, className)}\n >\n {children}\n </Flex>\n);\n\nconst DialogFooter = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex gap={5} justify='end' className={cx(styles.footer, className)}>\n {children}\n </Flex>\n);\n\nconst DialogBody = ({\n children,\n className\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex direction='column' gap={3} className={cx(styles.body, className)}>\n {children}\n </Flex>\n);\n\ntype CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;\nexport function CloseButton({ className, ...props }: CloseButtonProps) {\n return (\n <DialogPrimitive.Close\n className={cx(styles.close, className)}\n aria-label='Close dialog'\n {...props}\n >\n <Cross1Icon />\n </DialogPrimitive.Close>\n );\n}\n\ninterface DialogTitleProps\n extends ComponentProps<typeof DialogPrimitive.Title> {\n children: React.ReactNode;\n}\n\nfunction DialogTitle({ children, className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n {...props}\n role='heading'\n aria-level={1}\n className={cx(styles.title, className)}\n >\n {children}\n </DialogPrimitive.Title>\n );\n}\n\ninterface DialogDescriptionProps\n extends ComponentProps<typeof DialogPrimitive.Description> {\n children: React.ReactNode;\n className?: string;\n}\n\nfunction DialogDescription({\n children,\n className,\n ...props\n}: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n {...props}\n className={cx(styles.description, className)}\n id='dialog-description'\n role='document'\n >\n {children}\n </DialogPrimitive.Description>\n );\n}\n\nexport const Dialog = Object.assign(DialogPrimitive.Root, {\n Trigger: DialogPrimitive.Trigger,\n Content: DialogContent,\n Header: DialogHeader,\n Footer: DialogFooter,\n Body: DialogBody,\n Close: DialogPrimitive.Close,\n CloseButton: CloseButton,\n Title: DialogTitle,\n Description: DialogDescription\n});\n"],"names":["_jsxs","DialogPrimitive.Portal","_jsx","DialogPrimitive.Overlay","DialogPrimitive.Content","DialogPrimitive.Close","DialogPrimitive.Title","DialogPrimitive.Description","DialogPrimitive.Root","DialogPrimitive.Trigger"],"mappings":";;;;;;;;AAYA,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAahD,MAAM,aAAa,GAAG,UAAU,CAI9B,CACE,EACE,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,WAAW,GAAG,KAAK,EACnB,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,MAEHA,sBAAC,CAAAC,MAAsB,EACrB,EAAA,QAAA,EAAA,CAAAC,qBAAA,CAACC,OAAuB,EAAA,EACtB,SAAS,EAAE,EAAE,CACX,MAAM,CAAC,aAAa,EACpB,gBAAgB,EAChB,WAAW,IAAI,MAAM,CAAC,WAAW,CAClC,EACD,KAAK,EAAE,YAAY,EAAA,aAAA,EACP,MAAM,EAClB,IAAI,EAAC,cAAc,EAAA,CACnB,EACFD,qBAAA,CAACE,OAAuB,EAAA,EACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC,EACvC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,EACpB,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,GAAG,oBAAoB,GAAG,SAAS,EAChE,GAAA,KAAK,EAER,QAAA,EAAA,QAAQ,EACe,CAAA,CAAA,EAAA,CACH,CAC1B,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAGA,OAAuB,CAAC,WAAW,CAAC;AAEhE,MAAM,YAAY,GAAG,CAAC,EACpB,QAAQ,EACR,SAAS,EAIV,MACCF,qBAAA,CAAC,IAAI,EAAA,EACH,OAAO,EAAC,SAAS,EACjB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AAiB,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACe,EAAA;AACvB,IAAA,QACEJ,qBAAA,CAACK,WAA2B,EAAA,EAAA,GACtB,KAAK,EACT,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,EAC5C,EAAE,EAAC,oBAAoB,EACvB,IAAI,EAAC,UAAU,EAAA,QAAA,EAEd,QAAQ,EAAA,CACmB,EAC9B;AACJ,CAAC;AAEY,MAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAACC,IAAoB,EAAE;IACxD,OAAO,EAAEC,OAAuB;AAChC,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,IAAI,EAAE,UAAU;IAChB,KAAK,EAAEJ,KAAqB;AAC5B,IAAA,WAAW,EAAE,WAAW;AACxB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,WAAW,EAAE,iBAAiB;AAC/B,CAAA;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
|
-
var
|
|
4
|
+
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
5
5
|
var flex = require('../flex/flex.cjs');
|
|
6
6
|
var text = require('../text/text.cjs');
|
|
7
7
|
var emptyState_module = require('./empty-state.module.css.cjs');
|
|
8
8
|
|
|
9
|
-
const EmptyState = ({ icon, heading, subHeading, primaryAction, secondaryAction, classNames, variant =
|
|
10
|
-
if (variant ===
|
|
11
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { align:
|
|
9
|
+
const EmptyState = ({ icon, heading, subHeading, primaryAction, secondaryAction, classNames, variant = 'empty1' }) => {
|
|
10
|
+
if (variant === 'empty2') {
|
|
11
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { align: 'center', justify: 'center', className: emptyState_module.default.emptyStatePage, children: jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { direction: 'column', align: 'start', gap: 'medium', className: index.cx(emptyState_module.default.emptyStateContent, classNames?.container), children: [jsxRuntime.jsxRuntimeExports.jsx("div", { className: index.cx(emptyState_module.default.iconContainer, classNames?.iconContainer), children: jsxRuntime.jsxRuntimeExports.jsx("div", { className: index.cx(emptyState_module.default.icon, emptyState_module.default.iconLarge, classNames?.icon), children: icon }) }), heading && (jsxRuntime.jsxRuntimeExports.jsx(text.Text, { size: 5, weight: 500, className: index.cx(emptyState_module.default.headerText, classNames?.heading), children: heading })), subHeading && (jsxRuntime.jsxRuntimeExports.jsx(text.Text, { size: 4, weight: 400, className: index.cx(emptyState_module.default.subHeaderText, classNames?.subHeading), children: subHeading })), jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { gap: 'medium', children: [primaryAction, secondaryAction] })] }) }));
|
|
12
12
|
}
|
|
13
|
-
return (jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { direction:
|
|
13
|
+
return (jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { direction: 'column', align: 'center', gap: 'medium', className: index.cx(emptyState_module.default.emptyState, classNames?.container), children: [jsxRuntime.jsxRuntimeExports.jsx("div", { className: index.cx(emptyState_module.default.iconContainer, classNames?.iconContainer), children: jsxRuntime.jsxRuntimeExports.jsx("div", { className: index.cx(emptyState_module.default.icon, classNames?.icon), children: icon }) }), jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { direction: 'column', gap: 'small', align: 'center', children: [heading && (jsxRuntime.jsxRuntimeExports.jsx(text.Text, { size: 5, weight: 500, className: index.cx(emptyState_module.default.headerText, classNames?.heading), children: heading })), subHeading && (jsxRuntime.jsxRuntimeExports.jsx(text.Text, { size: 4, weight: 400, className: index.cx(emptyState_module.default.subHeaderText, classNames?.subHeading), children: subHeading }))] }), primaryAction, secondaryAction] }));
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
exports.EmptyState = EmptyState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-state.cjs","sources":["../../../components/empty-state/empty-state.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"empty-state.cjs","sources":["../../../components/empty-state/empty-state.tsx"],"sourcesContent":["import { cx } from 'class-variance-authority';\nimport { Flex } from '../flex';\nimport { Text } from '../text';\nimport styles from './empty-state.module.css';\n\ntype classNameKeys =\n | 'container'\n | 'iconContainer'\n | 'icon'\n | 'heading'\n | 'subHeading';\n\ninterface EmptyStateProps {\n icon: React.ReactNode;\n heading?: React.ReactNode;\n subHeading?: React.ReactNode;\n primaryAction?: React.ReactNode;\n secondaryAction?: React.ReactNode;\n classNames?: Partial<Record<classNameKeys, string>>;\n variant?: 'empty1' | 'empty2';\n}\n\nexport const EmptyState = ({\n icon,\n heading,\n subHeading,\n primaryAction,\n secondaryAction,\n classNames,\n variant = 'empty1'\n}: EmptyStateProps) => {\n if (variant === 'empty2') {\n return (\n <Flex align='center' justify='center' className={styles.emptyStatePage}>\n <Flex\n direction='column'\n align='start'\n gap='medium'\n className={cx(styles.emptyStateContent, classNames?.container)}\n >\n <div className={cx(styles.iconContainer, classNames?.iconContainer)}>\n <div\n className={cx(styles.icon, styles.iconLarge, classNames?.icon)}\n >\n {icon}\n </div>\n </div>\n\n {heading && (\n <Text\n size={5}\n weight={500}\n className={cx(styles.headerText, classNames?.heading)}\n >\n {heading}\n </Text>\n )}\n\n {subHeading && (\n <Text\n size={4}\n weight={400}\n className={cx(styles.subHeaderText, classNames?.subHeading)}\n >\n {subHeading}\n </Text>\n )}\n\n <Flex gap='medium'>\n {primaryAction}\n {secondaryAction}\n </Flex>\n </Flex>\n </Flex>\n );\n }\n\n return (\n <Flex\n direction='column'\n align='center'\n gap='medium'\n className={cx(styles.emptyState, classNames?.container)}\n >\n <div className={cx(styles.iconContainer, classNames?.iconContainer)}>\n <div className={cx(styles.icon, classNames?.icon)}>{icon}</div>\n </div>\n\n <Flex direction='column' gap='small' align='center'>\n {heading && (\n <Text\n size={5}\n weight={500}\n className={cx(styles.headerText, classNames?.heading)}\n >\n {heading}\n </Text>\n )}\n\n {subHeading && (\n <Text\n size={4}\n weight={400}\n className={cx(styles.subHeaderText, classNames?.subHeading)}\n >\n {subHeading}\n </Text>\n )}\n </Flex>\n\n {primaryAction}\n\n {secondaryAction}\n </Flex>\n );\n};\n"],"names":["_jsx","Flex","styles","_jsxs","cx","Text"],"mappings":";;;;;;;;MAsBa,UAAU,GAAG,CAAC,EACzB,IAAI,EACJ,OAAO,EACP,UAAU,EACV,aAAa,EACb,eAAe,EACf,UAAU,EACV,OAAO,GAAG,QAAQ,EACF,KAAI;AACpB,IAAA,IAAI,OAAO,KAAK,QAAQ,EAAE;AACxB,QAAA,QACEA,gCAAC,CAAAC,SAAI,EAAC,EAAA,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EAAC,SAAS,EAAEC,yBAAM,CAAC,cAAc,EAAA,QAAA,EACpEC,iCAAC,CAAAF,SAAI,IACH,SAAS,EAAC,QAAQ,EAClB,KAAK,EAAC,OAAO,EACb,GAAG,EAAC,QAAQ,EACZ,SAAS,EAAEG,QAAE,CAACF,yBAAM,CAAC,iBAAiB,EAAE,UAAU,EAAE,SAAS,CAAC,aAE9DF,gCAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEI,QAAE,CAACF,yBAAM,CAAC,aAAa,EAAE,UAAU,EAAE,aAAa,CAAC,EAAA,QAAA,EACjEF,0CACE,SAAS,EAAEI,QAAE,CAACF,yBAAM,CAAC,IAAI,EAAEA,yBAAM,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,CAAC,EAE7D,QAAA,EAAA,IAAI,EACD,CAAA,EAAA,CACF,EAEL,OAAO,KACNF,gCAAA,CAACK,SAAI,EACH,EAAA,IAAI,EAAE,CAAC,EACP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,UAAU,EAAE,OAAO,CAAC,EAEpD,QAAA,EAAA,OAAO,EACH,CAAA,CACR,EAEA,UAAU,KACTF,gCAAA,CAACK,SAAI,EAAA,EACH,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,GAAG,EACX,SAAS,EAAED,QAAE,CAACF,yBAAM,CAAC,aAAa,EAAE,UAAU,EAAE,UAAU,CAAC,YAE1D,UAAU,EAAA,CACN,CACR,CAAA,EAAA,CACI,EAEN,aAAa,EAEb,eAAe,CAAA,EAAA,CACX,EACP;AACJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type classNameKeys =
|
|
1
|
+
type classNameKeys = 'container' | 'iconContainer' | 'icon' | 'heading' | 'subHeading';
|
|
2
2
|
interface EmptyStateProps {
|
|
3
3
|
icon: React.ReactNode;
|
|
4
4
|
heading?: React.ReactNode;
|
|
@@ -6,8 +6,8 @@ interface EmptyStateProps {
|
|
|
6
6
|
primaryAction?: React.ReactNode;
|
|
7
7
|
secondaryAction?: React.ReactNode;
|
|
8
8
|
classNames?: Partial<Record<classNameKeys, string>>;
|
|
9
|
-
variant?:
|
|
9
|
+
variant?: 'empty1' | 'empty2';
|
|
10
10
|
}
|
|
11
|
-
export declare const EmptyState: ({ icon, heading, subHeading, primaryAction, secondaryAction, classNames, variant
|
|
11
|
+
export declare const EmptyState: ({ icon, heading, subHeading, primaryAction, secondaryAction, classNames, variant }: EmptyStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=empty-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../../components/empty-state/empty-state.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../../components/empty-state/empty-state.tsx"],"names":[],"mappings":"AAKA,KAAK,aAAa,GACd,WAAW,GACX,eAAe,GACf,MAAM,GACN,SAAS,GACT,YAAY,CAAC;AAEjB,UAAU,eAAe;IACvB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC/B;AAED,eAAO,MAAM,UAAU,uFAQpB,eAAe,4CAqFjB,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
|
-
import {
|
|
2
|
+
import { cx } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
3
3
|
import { Flex } from '../flex/flex.js';
|
|
4
4
|
import { Text } from '../text/text.js';
|
|
5
5
|
import styles from './empty-state.module.css.js';
|
|
6
6
|
|
|
7
|
-
const EmptyState = ({ icon, heading, subHeading, primaryAction, secondaryAction, classNames, variant =
|
|
8
|
-
if (variant ===
|
|
9
|
-
return (jsxRuntimeExports.jsx(Flex, { align:
|
|
7
|
+
const EmptyState = ({ icon, heading, subHeading, primaryAction, secondaryAction, classNames, variant = 'empty1' }) => {
|
|
8
|
+
if (variant === 'empty2') {
|
|
9
|
+
return (jsxRuntimeExports.jsx(Flex, { align: 'center', justify: 'center', className: styles.emptyStatePage, children: jsxRuntimeExports.jsxs(Flex, { direction: 'column', align: 'start', gap: 'medium', className: cx(styles.emptyStateContent, classNames?.container), children: [jsxRuntimeExports.jsx("div", { className: cx(styles.iconContainer, classNames?.iconContainer), children: jsxRuntimeExports.jsx("div", { className: cx(styles.icon, styles.iconLarge, classNames?.icon), children: icon }) }), heading && (jsxRuntimeExports.jsx(Text, { size: 5, weight: 500, className: cx(styles.headerText, classNames?.heading), children: heading })), subHeading && (jsxRuntimeExports.jsx(Text, { size: 4, weight: 400, className: cx(styles.subHeaderText, classNames?.subHeading), children: subHeading })), jsxRuntimeExports.jsxs(Flex, { gap: 'medium', children: [primaryAction, secondaryAction] })] }) }));
|
|
10
10
|
}
|
|
11
|
-
return (jsxRuntimeExports.jsxs(Flex, { direction:
|
|
11
|
+
return (jsxRuntimeExports.jsxs(Flex, { direction: 'column', align: 'center', gap: 'medium', className: cx(styles.emptyState, classNames?.container), children: [jsxRuntimeExports.jsx("div", { className: cx(styles.iconContainer, classNames?.iconContainer), children: jsxRuntimeExports.jsx("div", { className: cx(styles.icon, classNames?.icon), children: icon }) }), jsxRuntimeExports.jsxs(Flex, { direction: 'column', gap: 'small', align: 'center', children: [heading && (jsxRuntimeExports.jsx(Text, { size: 5, weight: 500, className: cx(styles.headerText, classNames?.heading), children: heading })), subHeading && (jsxRuntimeExports.jsx(Text, { size: 4, weight: 400, className: cx(styles.subHeaderText, classNames?.subHeading), children: subHeading }))] }), primaryAction, secondaryAction] }));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export { EmptyState };
|