@molecule/app-ui-react 4.14.0 → 4.14.1
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/README.md +95 -117
- package/dist/components/Accordion.d.ts +1 -11
- package/dist/components/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion.js +1 -82
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Alert.d.ts +1 -25
- package/dist/components/Alert.d.ts.map +1 -1
- package/dist/components/Alert.js +1 -60
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/Avatar.d.ts +1 -11
- package/dist/components/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar.js +1 -28
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Checkbox.d.ts +1 -11
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +1 -27
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/Pagination.d.ts +1 -11
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination.js +1 -79
- package/dist/components/Pagination.js.map +1 -1
- package/dist/components/RadioGroup.d.ts +1 -11
- package/dist/components/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup.js +1 -35
- package/dist/components/RadioGroup.js.map +1 -1
- package/dist/components/Select.d.ts +1 -26
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Select.js +1 -71
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Spinner.d.ts +1 -16
- package/dist/components/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner.js +1 -29
- package/dist/components/Spinner.js.map +1 -1
- package/dist/components/Switch.d.ts +1 -11
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Switch.js +1 -32
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Table.d.ts +1 -11
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/components/Table.js +1 -57
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Tabs.d.ts +1 -11
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs.js +1 -75
- package/dist/components/Tabs.js.map +1 -1
- package/dist/components/Textarea.d.ts +1 -10
- package/dist/components/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea.js +1 -27
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/Toast.d.ts +2 -14
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +8 -89
- package/dist/components/Toast.js.map +1 -1
- package/dist/elements/Anchor.d.ts +1 -1
- package/dist/elements/Box.d.ts +1 -15
- package/dist/elements/Box.d.ts.map +1 -1
- package/dist/elements/Box.js +1 -55
- package/dist/elements/Box.js.map +1 -1
- package/dist/elements/CheckField.d.ts +1 -16
- package/dist/elements/CheckField.d.ts.map +1 -1
- package/dist/elements/CheckField.js +1 -52
- package/dist/elements/CheckField.js.map +1 -1
- package/dist/elements/Image.d.ts +1 -16
- package/dist/elements/Image.d.ts.map +1 -1
- package/dist/elements/Image.js +1 -21
- package/dist/elements/Image.js.map +1 -1
- package/dist/elements/Pressable.d.ts +1 -16
- package/dist/elements/Pressable.d.ts.map +1 -1
- package/dist/elements/Pressable.js +1 -41
- package/dist/elements/Pressable.js.map +1 -1
- package/dist/elements/ScrollArea.d.ts +1 -15
- package/dist/elements/ScrollArea.d.ts.map +1 -1
- package/dist/elements/ScrollArea.js +1 -41
- package/dist/elements/ScrollArea.js.map +1 -1
- package/dist/elements/SelectField.d.ts +1 -10
- package/dist/elements/SelectField.d.ts.map +1 -1
- package/dist/elements/SelectField.js +1 -63
- package/dist/elements/SelectField.js.map +1 -1
- package/dist/elements/Svg.d.ts +1 -123
- package/dist/elements/Svg.d.ts.map +1 -1
- package/dist/elements/Svg.js +1 -179
- package/dist/elements/Svg.js.map +1 -1
- package/dist/elements/TableBox.d.ts +1 -15
- package/dist/elements/TableBox.d.ts.map +1 -1
- package/dist/elements/TableBox.js +1 -17
- package/dist/elements/TableBox.js.map +1 -1
- package/dist/elements/TableCell.d.ts +1 -15
- package/dist/elements/TableCell.d.ts.map +1 -1
- package/dist/elements/TableCell.js +1 -17
- package/dist/elements/TableCell.js.map +1 -1
- package/dist/elements/Text.d.ts +1 -18
- package/dist/elements/Text.d.ts.map +1 -1
- package/dist/elements/Text.js +1 -20
- package/dist/elements/Text.js.map +1 -1
- package/dist/elements/TextField.d.ts +1 -17
- package/dist/elements/TextField.d.ts.map +1 -1
- package/dist/elements/TextField.js +1 -104
- package/dist/elements/TextField.js.map +1 -1
- package/dist/elements/drag.d.ts +1 -14
- package/dist/elements/drag.d.ts.map +1 -1
- package/dist/elements/drag.js +1 -27
- package/dist/elements/drag.js.map +1 -1
- package/dist/elements/flow.d.ts +1 -16
- package/dist/elements/flow.d.ts.map +1 -1
- package/dist/elements/flow.js +1 -17
- package/dist/elements/flow.js.map +1 -1
- package/dist/elements/hover.d.ts +1 -9
- package/dist/elements/hover.d.ts.map +1 -1
- package/dist/elements/hover.js +1 -22
- package/dist/elements/hover.js.map +1 -1
- package/dist/elements/measure.d.ts +1 -24
- package/dist/elements/measure.d.ts.map +1 -1
- package/dist/elements/measure.js +1 -19
- package/dist/elements/measure.js.map +1 -1
- package/dist/elements/paste.d.ts +1 -4
- package/dist/elements/paste.d.ts.map +1 -1
- package/dist/elements/paste.js +1 -14
- package/dist/elements/paste.js.map +1 -1
- package/dist/elements/ref.d.ts +1 -15
- package/dist/elements/ref.d.ts.map +1 -1
- package/dist/elements/ref.js +1 -17
- package/dist/elements/ref.js.map +1 -1
- package/dist/elements/style.d.ts +1 -34
- package/dist/elements/style.d.ts.map +1 -1
- package/dist/elements/style.js +1 -50
- package/dist/elements/style.js.map +1 -1
- package/dist/elements/types.d.ts +1 -22
- package/dist/elements/types.d.ts.map +1 -1
- package/dist/elements/types.js +1 -6
- package/dist/elements/types.js.map +1 -1
- package/dist/elements/viewport.d.ts +1 -52
- package/dist/elements/viewport.d.ts.map +1 -1
- package/dist/elements/viewport.js +1 -103
- package/dist/elements/viewport.js.map +1 -1
- package/dist/index.native.d.ts +1 -0
- package/dist/index.native.d.ts.map +1 -1
- package/dist/index.native.js +1 -0
- package/dist/index.native.js.map +1 -1
- package/dist/kit.native.d.ts +12 -0
- package/dist/kit.native.d.ts.map +1 -0
- package/dist/kit.native.js +11 -0
- package/dist/kit.native.js.map +1 -0
- package/dist/kit.web.d.ts +39 -0
- package/dist/kit.web.d.ts.map +1 -0
- package/dist/kit.web.js +34 -0
- package/dist/kit.web.js.map +1 -0
- package/dist/platform/index.d.ts +1 -28
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js +1 -179
- package/dist/platform/index.js.map +1 -1
- package/dist/utilities/initials.d.ts +1 -12
- package/dist/utilities/initials.d.ts.map +1 -1
- package/dist/utilities/initials.js +1 -22
- package/dist/utilities/initials.js.map +1 -1
- package/dist/utilities/isReactNode.d.ts +1 -15
- package/dist/utilities/isReactNode.d.ts.map +1 -1
- package/dist/utilities/isReactNode.js +1 -26
- package/dist/utilities/isReactNode.js.map +1 -1
- package/dist/utilities/mergeRefs.d.ts +1 -19
- package/dist/utilities/mergeRefs.d.ts.map +1 -1
- package/dist/utilities/mergeRefs.js +1 -33
- package/dist/utilities/mergeRefs.js.map +1 -1
- package/dist/utilities/renderIcon.d.ts +3 -17
- package/dist/utilities/renderIcon.d.ts.map +1 -1
- package/dist/utilities/renderIcon.js +6 -31
- package/dist/utilities/renderIcon.js.map +1 -1
- package/dist/utilities/rootProps.d.ts +1 -19
- package/dist/utilities/rootProps.d.ts.map +1 -1
- package/dist/utilities/rootProps.js +1 -18
- package/dist/utilities/rootProps.js.map +1 -1
- package/package.json +13 -5
- package/dist/platform/arrow.d.ts +0 -5
- package/dist/platform/arrow.d.ts.map +0 -1
- package/dist/platform/arrow.js +0 -49
- package/dist/platform/arrow.js.map +0 -1
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Checkbox component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { forwardRef, useId } from 'react';
|
|
8
|
-
import { slot } from '@molecule/app-react/render';
|
|
9
|
-
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
-
import { Box, CheckField, Text } from '@molecule/app-ui-react/elements';
|
|
11
|
-
import { rootProps } from '../utilities/rootProps.js';
|
|
12
|
-
/**
|
|
13
|
-
* Checkbox component.
|
|
14
|
-
*/
|
|
15
|
-
export const Checkbox = forwardRef(({ label: labelProp, checked, indeterminate, size: _size, error, className, style, testId, disabled, name, id, value, onChange, onCheckedChange, ...rest }, ref) => {
|
|
16
|
-
const label = slot(labelProp);
|
|
17
|
-
const cm = getClassMap();
|
|
18
|
-
const checkboxId = id || name;
|
|
19
|
-
// The error message must be programmatically associated with the input
|
|
20
|
-
// (like Input/Textarea/Select already do) — a bare sibling <p> is never
|
|
21
|
-
// announced by screen readers, so the failure reason was invisible.
|
|
22
|
-
const generatedId = useId();
|
|
23
|
-
const errorId = `${checkboxId || generatedId}-error`;
|
|
24
|
-
const checkboxClasses = cm.cn(cm.checkbox({ error: !!error }), className);
|
|
25
|
-
return (_jsxs(Box, { as: "div", className: cm.formFieldWrapper, children: [_jsxs(Box, { as: "label", className: cm.controlLabel, children: [_jsx(CheckField, { as: "input", ref: ref, type: "checkbox", id: checkboxId, name: name, checked: checked, indeterminate: indeterminate, value: value === undefined ? undefined : String(value), disabled: disabled, "data-state": checked ? 'checked' : 'unchecked', "aria-invalid": !!error, "aria-describedby": error ? errorId : undefined, className: checkboxClasses, webStyle: style, "data-testid": testId, onChange: onChange, onCheckedChange: onCheckedChange, ...rootProps(rest) }), !!label && (_jsx(Text, { as: "span", className: cm.cn(cm.controlText, disabled && cm.controlDisabled), children: label }))] }), error && (_jsx(Text, { as: "p", id: errorId, className: cm.cn(cm.formError, cm.sp('mt', 1)), children: error }))] }));
|
|
26
|
-
});
|
|
27
|
-
Checkbox.displayName = 'Checkbox';
|
|
1
|
+
export { Checkbox } from '#kit';
|
|
28
2
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/components/Checkbox.
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/components/Checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Pagination component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { PaginationProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* Pagination component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
|
|
1
|
+
export { Pagination } from '#kit';
|
|
12
2
|
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/components/Pagination.
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/components/Pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,80 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Pagination component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { forwardRef, useMemo } from 'react';
|
|
8
|
-
import { useTranslation } from '@molecule/app-react';
|
|
9
|
-
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
-
import { Box, Pressable } from '@molecule/app-ui-react/elements';
|
|
11
|
-
import { renderIcon } from '../utilities/renderIcon.js';
|
|
12
|
-
/**
|
|
13
|
-
* Generate pagination range with ellipsis.
|
|
14
|
-
* @param currentPage - The currently active page number.
|
|
15
|
-
* @param totalPages - The total number of pages.
|
|
16
|
-
* @param siblings - The number of sibling pages to show around the current page.
|
|
17
|
-
* @param boundaries - The number of boundary pages to always show at start and end.
|
|
18
|
-
* @returns An array of page numbers and ellipsis markers.
|
|
19
|
-
*/
|
|
20
|
-
function generatePaginationRange(currentPage, totalPages, siblings, boundaries) {
|
|
21
|
-
const range = [];
|
|
22
|
-
// Always show first boundary pages
|
|
23
|
-
for (let i = 1; i <= Math.min(boundaries, totalPages); i++) {
|
|
24
|
-
range.push(i);
|
|
25
|
-
}
|
|
26
|
-
// Calculate sibling range
|
|
27
|
-
const siblingStart = Math.max(boundaries + 1, currentPage - siblings);
|
|
28
|
-
const siblingEnd = Math.min(totalPages - boundaries, currentPage + siblings);
|
|
29
|
-
// Add ellipsis after boundary if needed
|
|
30
|
-
if (siblingStart > boundaries + 1) {
|
|
31
|
-
range.push('ellipsis');
|
|
32
|
-
}
|
|
33
|
-
// Add sibling pages
|
|
34
|
-
for (let i = siblingStart; i <= siblingEnd; i++) {
|
|
35
|
-
if (!range.includes(i)) {
|
|
36
|
-
range.push(i);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
// Add ellipsis before end boundary if needed
|
|
40
|
-
if (siblingEnd < totalPages - boundaries) {
|
|
41
|
-
range.push('ellipsis');
|
|
42
|
-
}
|
|
43
|
-
// Always show last boundary pages
|
|
44
|
-
for (let i = Math.max(totalPages - boundaries + 1, boundaries + 1); i <= totalPages; i++) {
|
|
45
|
-
if (!range.includes(i)) {
|
|
46
|
-
range.push(i);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return range;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Ellipsis indicator.
|
|
53
|
-
* @returns The ellipsis JSX element.
|
|
54
|
-
*/
|
|
55
|
-
const Ellipsis = () => {
|
|
56
|
-
const cm = getClassMap();
|
|
57
|
-
return (_jsx(Box, { as: "span", className: cm.paginationEllipsis, "aria-hidden": true, children: renderIcon('ellipsis-horizontal', cm.iconSm) }));
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Pagination component.
|
|
61
|
-
*/
|
|
62
|
-
export const Pagination = forwardRef(({ page, totalPages, onChange, siblings = 1, boundaries = 1, size = 'md', showFirstLast = false, showPrevNext = true, labels, className, style, testId, automationId, disabled, }, ref) => {
|
|
63
|
-
const { t } = useTranslation();
|
|
64
|
-
const cm = getClassMap();
|
|
65
|
-
const range = useMemo(() => generatePaginationRange(page, totalPages, siblings, boundaries), [page, totalPages, siblings, boundaries]);
|
|
66
|
-
const handlePageChange = (newPage) => {
|
|
67
|
-
if (newPage >= 1 && newPage <= totalPages && newPage !== page && !disabled) {
|
|
68
|
-
onChange(newPage);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const buttonClasses = (isActive) => cm.cn(cm.pagination({ active: isActive, size }), cm.paginationInteractive);
|
|
72
|
-
return (_jsx(Box, { as: "nav", ref: ref, role: "navigation", "aria-label": labels?.nav ?? t('ui.pagination.nav', undefined, { defaultValue: 'Pagination' }), className: cm.cn(cm.paginationRoot, className), webStyle: style, "data-testid": testId, "data-mol-id": automationId, children: _jsxs(Box, { as: "ul", className: cm.paginationContent, children: [showFirstLast && (_jsx(Box, { as: "li", children: _jsx(Pressable, { as: "button", type: "button", className: buttonClasses(false), onClick: () => handlePageChange(1), disabled: page === 1 || disabled, "aria-label": labels?.first ??
|
|
73
|
-
t('ui.pagination.first', undefined, { defaultValue: 'Go to first page' }), children: renderIcon('chevrons-left', cm.iconSm) }) })), showPrevNext && (_jsx(Box, { as: "li", children: _jsx(Pressable, { as: "button", type: "button", className: buttonClasses(false), onClick: () => handlePageChange(page - 1), disabled: page === 1 || disabled, "aria-label": labels?.previous ??
|
|
74
|
-
t('ui.pagination.previous', undefined, { defaultValue: 'Go to previous page' }), children: renderIcon('chevron-left', cm.iconSm) }) })), range.map((item, index) => item === 'ellipsis' ? (_jsx(Box, { as: "li", children: _jsx(Ellipsis, {}) }, `ellipsis-${index}`)) : (_jsx(Box, { as: "li", children: _jsx(Pressable, { as: "button", type: "button", className: buttonClasses(item === page), onClick: () => handlePageChange(item), disabled: disabled, "aria-label": labels?.goToPage?.(item) ??
|
|
75
|
-
t('ui.pagination.goToPage', { page: item }, { defaultValue: 'Go to page {{page}}' }), "aria-current": item === page ? 'page' : undefined, children: item }) }, item))), showPrevNext && (_jsx(Box, { as: "li", children: _jsx(Pressable, { as: "button", type: "button", className: buttonClasses(false), onClick: () => handlePageChange(page + 1), disabled: page === totalPages || disabled, "aria-label": labels?.next ??
|
|
76
|
-
t('ui.pagination.next', undefined, { defaultValue: 'Go to next page' }), children: renderIcon('chevron-right', cm.iconSm) }) })), showFirstLast && (_jsx(Box, { as: "li", children: _jsx(Pressable, { as: "button", type: "button", className: buttonClasses(false), onClick: () => handlePageChange(totalPages), disabled: page === totalPages || disabled, "aria-label": labels?.last ??
|
|
77
|
-
t('ui.pagination.last', undefined, { defaultValue: 'Go to last page' }), children: renderIcon('chevrons-right', cm.iconSm) }) }))] }) }));
|
|
78
|
-
});
|
|
79
|
-
Pagination.displayName = 'Pagination';
|
|
1
|
+
export { Pagination } from '#kit';
|
|
80
2
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../src/components/Pagination.
|
|
1
|
+
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../src/components/Pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* RadioGroup component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { RadioGroupProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* RadioGroup component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps<string> & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
export { RadioGroup } from '#kit';
|
|
12
2
|
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/components/RadioGroup.
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/components/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,36 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* RadioGroup component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { forwardRef, useId } from 'react';
|
|
8
|
-
import { useTranslation } from '@molecule/app-react';
|
|
9
|
-
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
-
import { Box, CheckField, Text } from '@molecule/app-ui-react/elements';
|
|
11
|
-
/**
|
|
12
|
-
* RadioGroup component.
|
|
13
|
-
*/
|
|
14
|
-
export const RadioGroup = forwardRef(({ options, value, onChange, size: _size, label, name, direction = 'vertical', error, className, style, testId, automationId, disabled, }, ref) => {
|
|
15
|
-
const { t } = useTranslation();
|
|
16
|
-
const cm = getClassMap();
|
|
17
|
-
// Radios only form a native group (arrow-key navigation, exclusive
|
|
18
|
-
// native checked state) when they share a `name` — and that name must be
|
|
19
|
-
// UNIQUE per group. The old `label`-as-name fallback merged every group
|
|
20
|
-
// sharing a visible label (e.g. two "Size" pickers) into ONE native
|
|
21
|
-
// group: selecting in one silently deselected the other. Callers that
|
|
22
|
-
// need a specific submitted field name pass the `name` prop.
|
|
23
|
-
const generatedName = useId();
|
|
24
|
-
const groupName = name || generatedName;
|
|
25
|
-
const errorId = `${groupName}-error`;
|
|
26
|
-
const handleChange = (optionValue) => {
|
|
27
|
-
onChange?.(optionValue);
|
|
28
|
-
};
|
|
29
|
-
return (_jsxs(Box, { as: "div", ref: ref, className: className, webStyle: style, "data-testid": testId, "data-mol-id": automationId, role: "radiogroup", "aria-label": label ?? t('ui.radioGroup.label', undefined, { defaultValue: 'Radio group' }), "aria-invalid": error ? true : undefined, "aria-describedby": error ? errorId : undefined, children: [label && (_jsx(Box, { as: "div", className: cm.cn(cm.label({ required: false }), cm.sp('mb', 2)), children: label })), _jsx(Box, { as: "div", className: cm.radioGroupLayout(direction), children: options.map((option) => {
|
|
30
|
-
const isChecked = value === option.value;
|
|
31
|
-
const isDisabled = disabled || option.disabled;
|
|
32
|
-
return (_jsxs(Box, { as: "label", className: cm.cn(cm.controlLabel, isDisabled && cm.controlDisabled), children: [_jsx(CheckField, { as: "input", type: "radio", name: groupName, value: option.value, checked: isChecked, disabled: isDisabled, onChange: () => handleChange(option.value), "data-state": isChecked ? 'checked' : 'unchecked', className: cm.cn(cm.radio({ error: !!error }), cm.cursorPointer) }), _jsx(Text, { as: "span", className: cm.controlText, children: option.label })] }, option.value));
|
|
33
|
-
}) }), error && (_jsx(Text, { as: "p", id: errorId, className: cm.cn(cm.formError, cm.sp('mt', 1)), children: error }))] }));
|
|
34
|
-
});
|
|
35
|
-
RadioGroup.displayName = 'RadioGroup';
|
|
1
|
+
export { RadioGroup } from '#kit';
|
|
36
2
|
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../src/components/RadioGroup.
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../src/components/RadioGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Select component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import type { SelectFieldProps, SelectProps } from '@molecule/app-ui';
|
|
7
|
-
/** React Select props, including controlled and default arrays in multiple mode. */
|
|
8
|
-
type ReactSelectProps = {
|
|
9
|
-
/** Browser translation metadata for literal labels, such as HTTP methods. */
|
|
10
|
-
translate?: SelectFieldProps['translate'];
|
|
11
|
-
} & ((SelectProps<string> & {
|
|
12
|
-
/** Initial selection when the caller does not hold the value. */
|
|
13
|
-
defaultValue?: string;
|
|
14
|
-
onValuesChange?: never;
|
|
15
|
-
}) | (Omit<SelectProps<string>, 'multiple' | 'value'> & {
|
|
16
|
-
multiple: true;
|
|
17
|
-
/** Caller-owned selection. A legacy scalar selects the matching value. */
|
|
18
|
-
value?: readonly string[] | string;
|
|
19
|
-
/** Initial selection when the caller does not hold the value. */
|
|
20
|
-
defaultValue?: readonly string[] | string;
|
|
21
|
-
/** Every selected value in option order, after the event and scalar callback. */
|
|
22
|
-
onValuesChange?: (values: readonly string[]) => void;
|
|
23
|
-
}));
|
|
24
|
-
/** Select with an optional label, hint, validation error and grouped choices. */
|
|
25
|
-
export declare const Select: import("react").ForwardRefExoticComponent<ReactSelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
26
|
-
export {};
|
|
1
|
+
export { Select } from '#kit';
|
|
27
2
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select.
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,72 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Select component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { forwardRef, useId } from 'react';
|
|
8
|
-
import { useTranslation } from '@molecule/app-react';
|
|
9
|
-
import { fieldLayout, getClassMap } from '@molecule/app-ui';
|
|
10
|
-
import { Box, SelectField, Text } from '@molecule/app-ui-react/elements';
|
|
11
|
-
import { renderIcon } from '../utilities/renderIcon.js';
|
|
12
|
-
import { rootProps } from '../utilities/rootProps.js';
|
|
13
|
-
/** Select with an optional label, hint, validation error and grouped choices. */
|
|
14
|
-
export const Select = forwardRef(({ options, value, defaultValue, multiple, onValueChange, onValuesChange, size = 'md', label, placeholder, error, hint, clearable, className, style, testId, disabled, required, name, id, onChange, ...rest }, ref) => {
|
|
15
|
-
const { t } = useTranslation();
|
|
16
|
-
const cm = getClassMap();
|
|
17
|
-
// A column around the label, the control's row and the message, so the control's margin
|
|
18
|
-
// moves the control on every renderer (the same layout in every framework's kit).
|
|
19
|
-
const field = fieldLayout(cm);
|
|
20
|
-
// Fall back to a generated id so label htmlFor / aria-describedby never
|
|
21
|
-
// point at `undefined-error` (which also collides across multiple
|
|
22
|
-
// id-less selects on the same page).
|
|
23
|
-
const generatedId = useId();
|
|
24
|
-
const selectId = id || name || generatedId;
|
|
25
|
-
const selectClasses = cm.cn(cm.select({ error: !!error, size }), cm.selectNative, cm.inputPadRight, className);
|
|
26
|
-
const leading = placeholder
|
|
27
|
-
? { value: '', label: placeholder, disabled: true }
|
|
28
|
-
: clearable
|
|
29
|
-
? { value: '', label: t('ui.select.clear', undefined, { defaultValue: '--' }) }
|
|
30
|
-
: undefined;
|
|
31
|
-
const controlProps = {
|
|
32
|
-
ref,
|
|
33
|
-
id: selectId,
|
|
34
|
-
name,
|
|
35
|
-
options: fieldOptions(options, leading),
|
|
36
|
-
disabled,
|
|
37
|
-
required,
|
|
38
|
-
'aria-invalid': !!error,
|
|
39
|
-
'aria-describedby': error ? `${selectId}-error` : hint ? `${selectId}-hint` : undefined,
|
|
40
|
-
className: selectClasses,
|
|
41
|
-
webStyle: style,
|
|
42
|
-
'data-testid': testId,
|
|
43
|
-
onChange,
|
|
44
|
-
...rootProps(rest),
|
|
45
|
-
};
|
|
46
|
-
return (_jsxs(Box, { as: "div", className: field.root, children: [label && (_jsx(Text, { as: "label", htmlFor: selectId, className: cm.cn(cm.label({ required: !!required }), cm.labelBlock), children: label })), _jsxs(Box, { as: "div", className: field.inner, children: [multiple ? (_jsx(SelectField, { as: "select", multiple: true, ...(value === undefined
|
|
47
|
-
? { defaultValue: multipleValue(defaultValue) }
|
|
48
|
-
: { value: multipleValue(value) }), onValueChange: (values) => {
|
|
49
|
-
onValueChange?.(values[0] ?? '');
|
|
50
|
-
onValuesChange?.(values);
|
|
51
|
-
}, ...controlProps })) : (_jsx(SelectField, { as: "select", multiple: multiple, ...(value === undefined ? { defaultValue } : { value }), onValueChange: onValueChange, ...controlProps })), _jsx(Box, { as: "div", className: cm.inputRightElement, style: { pointerEvents: 'none' }, children: renderIcon('chevron-down', cm.cn(cm.iconSm, cm.textMuted)) })] }), error && (_jsx(Text, { as: "p", id: `${selectId}-error`, className: cm.formError, children: error })), hint && !error && (_jsx(Text, { as: "p", id: `${selectId}-hint`, className: cm.formHint, children: hint }))] }));
|
|
52
|
-
});
|
|
53
|
-
Select.displayName = 'Select';
|
|
54
|
-
/** Adapts the kit's legacy scalar to the element's multiple selection shape. */
|
|
55
|
-
function multipleValue(value) {
|
|
56
|
-
return typeof value === 'string' ? [value] : value;
|
|
57
|
-
}
|
|
58
|
-
/** Preserve the kit's object-key order, including integer-like labels and the ungrouped bucket. */
|
|
59
|
-
function fieldOptions(options, leading) {
|
|
60
|
-
const grouped = Object.create(null);
|
|
61
|
-
for (const option of options)
|
|
62
|
-
(grouped[option.group || ''] ??= []).push(option);
|
|
63
|
-
const ordered = leading ? [leading] : [];
|
|
64
|
-
for (const [label, leaves] of Object.entries(grouped)) {
|
|
65
|
-
if (label)
|
|
66
|
-
ordered.push({ label, options: leaves });
|
|
67
|
-
else
|
|
68
|
-
ordered.push(...leaves);
|
|
69
|
-
}
|
|
70
|
-
return ordered;
|
|
71
|
-
}
|
|
1
|
+
export { Select } from '#kit';
|
|
72
2
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/components/Select.
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/components/Select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Spinner component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { SpinnerProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* Spinner component.
|
|
10
|
-
*
|
|
11
|
-
* `automationId` renders as `data-mol-id`; `data-*` and `aria-*` props on the rest reach
|
|
12
|
-
* the status element (a caller's `aria-label` replaces the default).
|
|
13
|
-
*/
|
|
14
|
-
export declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & {
|
|
15
|
-
'data-mol-id'?: string;
|
|
16
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
export { Spinner } from '#kit';
|
|
17
2
|
//# sourceMappingURL=Spinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/components/Spinner.
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/components/Spinner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Spinner component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { forwardRef } from 'react';
|
|
8
|
-
import { useTranslation } from '@molecule/app-react';
|
|
9
|
-
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
-
import { Box, Text } from '@molecule/app-ui-react/elements';
|
|
11
|
-
import { rootProps } from '../utilities/rootProps.js';
|
|
12
|
-
/**
|
|
13
|
-
* Spinner component.
|
|
14
|
-
*
|
|
15
|
-
* `automationId` renders as `data-mol-id`; `data-*` and `aria-*` props on the rest reach
|
|
16
|
-
* the status element (a caller's `aria-label` replaces the default).
|
|
17
|
-
*/
|
|
18
|
-
export const Spinner = forwardRef(({ size = 'md', color, label, className, style, testId, ...rest }, ref) => {
|
|
19
|
-
const { t } = useTranslation();
|
|
20
|
-
const cm = getClassMap();
|
|
21
|
-
const classes = cm.cn(cm.spinner({ size }), className);
|
|
22
|
-
const colorStyle = color &&
|
|
23
|
-
typeof color === 'string' &&
|
|
24
|
-
!['primary', 'secondary', 'success', 'warning', 'error', 'info'].includes(color)
|
|
25
|
-
? { borderColor: color, borderTopColor: 'transparent' }
|
|
26
|
-
: undefined;
|
|
27
|
-
return (_jsx(Box, { as: "div", ref: ref, role: "status", "aria-label": label || t('ui.spinner.loading', undefined, { defaultValue: 'Loading' }), className: classes, webStyle: { ...style, ...colorStyle }, "data-testid": testId, ...rootProps(rest), children: label && (_jsx(Text, { as: "span", className: cm.srOnly, children: label })) }));
|
|
28
|
-
});
|
|
29
|
-
Spinner.displayName = 'Spinner';
|
|
1
|
+
export { Spinner } from '#kit';
|
|
30
2
|
//# sourceMappingURL=Spinner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../src/components/Spinner.
|
|
1
|
+
{"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../src/components/Spinner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Switch component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { SwitchProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* Switch component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
|
1
|
+
export { Switch } from '#kit';
|
|
12
2
|
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/components/Switch.
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/components/Switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Switch component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { forwardRef, useRef } from 'react';
|
|
8
|
-
import { slot } from '@molecule/app-react/render';
|
|
9
|
-
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
-
import { Box, CheckField, Pressable, Text } from '@molecule/app-ui-react/elements';
|
|
11
|
-
import { rootProps } from '../utilities/rootProps.js';
|
|
12
|
-
/**
|
|
13
|
-
* Switch component.
|
|
14
|
-
*/
|
|
15
|
-
export const Switch = forwardRef(({ label: labelProp, checked, size = 'md', color, className, style, testId, disabled, onChange, onCheckedChange, onClick, value, ...rest }, ref) => {
|
|
16
|
-
const label = slot(labelProp);
|
|
17
|
-
const cm = getClassMap();
|
|
18
|
-
const state = checked ? 'checked' : 'unchecked';
|
|
19
|
-
// Keep the hidden input beside the label so the button is its only labelable child.
|
|
20
|
-
const hiddenInputRef = useRef(null);
|
|
21
|
-
// A caller's onClick runs first and can veto the toggle with
|
|
22
|
-
// preventDefault(); it used to be spread over this handler, so passing
|
|
23
|
-
// one silently disabled the switch.
|
|
24
|
-
const handleClick = (event) => {
|
|
25
|
-
onClick?.(event);
|
|
26
|
-
if (!disabled && !event.defaultPrevented) {
|
|
27
|
-
hiddenInputRef.current?.click();
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
return (_jsxs(_Fragment, { children: [_jsx(CheckField, { as: "input", ref: hiddenInputRef, type: "checkbox", checked: !!checked, disabled: disabled, "aria-hidden": "true", tabIndex: -1, className: cm.srOnly, nativeChangeEvent: true, onChange: onChange, onCheckedChange: onCheckedChange }), _jsxs(Box, { as: "label", className: cm.cn(cm.controlLabel, disabled && cm.controlDisabled), children: [_jsx(Pressable, { as: "button", ref: ref, type: "button", role: "switch", "aria-checked": !!checked, disabled: disabled, "data-state": state, onClick: handleClick, className: cm.cn(cm.switchBase({ size, color }), className), webStyle: style, "data-testid": testId, value: value === undefined ? undefined : String(value), ...rootProps(rest), children: _jsx(Box, { as: "span", "data-state": state, className: cm.switchThumb({ size }) }) }), !!label && (_jsx(Text, { as: "span", className: cm.controlText, children: label }))] })] }));
|
|
31
|
-
});
|
|
32
|
-
Switch.displayName = 'Switch';
|
|
1
|
+
export { Switch } from '#kit';
|
|
33
2
|
//# sourceMappingURL=Switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../src/components/Switch.
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../src/components/Switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Table component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { TableProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* Table component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Table: React.ForwardRefExoticComponent<TableProps<Record<string, unknown>> & React.RefAttributes<HTMLTableElement>>;
|
|
1
|
+
export { Table } from '#kit';
|
|
12
2
|
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/components/Table.
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/components/Table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA"}
|
package/dist/components/Table.js
CHANGED
|
@@ -1,58 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Table component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { forwardRef } from 'react';
|
|
8
|
-
import { useTranslation } from '@molecule/app-react';
|
|
9
|
-
import { slot } from '@molecule/app-react/render';
|
|
10
|
-
import { getClassMap } from '@molecule/app-ui';
|
|
11
|
-
import { Box, ScrollArea, TableBox, TableCell } from '@molecule/app-ui-react/elements';
|
|
12
|
-
import { renderIcon } from '../utilities/renderIcon.js';
|
|
13
|
-
import { rootProps } from '../utilities/rootProps.js';
|
|
14
|
-
import { Spinner } from './Spinner.js';
|
|
15
|
-
/**
|
|
16
|
-
* Table component.
|
|
17
|
-
*/
|
|
18
|
-
export const Table = forwardRef(({ data, columns, rowKey, bordered, striped, hoverable = true, size: _size, emptyContent: emptyContentProp, loading, sort, onSort, onRowClick, className, style, testId, ...rest }, ref) => {
|
|
19
|
-
const emptyContent = slot(emptyContentProp);
|
|
20
|
-
const { t } = useTranslation();
|
|
21
|
-
const cm = getClassMap();
|
|
22
|
-
const getRowKey = (row, index) => {
|
|
23
|
-
if (typeof rowKey === 'function') {
|
|
24
|
-
return rowKey(row);
|
|
25
|
-
}
|
|
26
|
-
const key = rowKey ? row[rowKey] : undefined;
|
|
27
|
-
if (key === undefined)
|
|
28
|
-
return index;
|
|
29
|
-
return typeof key === 'number' ? key : String(key);
|
|
30
|
-
};
|
|
31
|
-
const getCellValue = (row, column, index) => {
|
|
32
|
-
if (column.render) {
|
|
33
|
-
return column.render(row[column.key], row, index);
|
|
34
|
-
}
|
|
35
|
-
return row[column.key];
|
|
36
|
-
};
|
|
37
|
-
const handleSort = (column) => {
|
|
38
|
-
if (!column.sortable || !onSort)
|
|
39
|
-
return;
|
|
40
|
-
const key = column.key;
|
|
41
|
-
const currentDirection = sort?.key === key ? sort.direction : undefined;
|
|
42
|
-
const newDirection = currentDirection === 'asc' ? 'desc' : 'asc';
|
|
43
|
-
onSort(key, newDirection);
|
|
44
|
-
};
|
|
45
|
-
const tableClasses = cm.cn(cm.table, bordered && cm.tableBordered, className);
|
|
46
|
-
return (_jsxs(ScrollArea, { as: "div", direction: "horizontal", className: cm.tableWrapper, children: [loading && (_jsx(Box, { as: "div", className: cm.tableLoadingOverlay, children: _jsx(Spinner, { size: "lg" }) })), _jsxs(TableBox, { as: "table", ref: ref, className: tableClasses, webStyle: style, "data-testid": testId, ...rootProps(rest), children: [_jsx(TableBox, { as: "thead", className: cm.tableHeader, children: _jsx(TableBox, { as: "tr", className: cm.tableRow, children: columns.map((column) => (_jsx(TableCell, { as: "th", className: cm.cn(cm.tableHead, column.align === 'center' && cm.textCenter, column.align === 'right' && cm.textRight, column.sortable && cm.tableHeadSortable), webStyle: { width: column.width }, onClick: column.sortable && onSort ? () => handleSort(column) : undefined, "aria-sort": column.sortable
|
|
47
|
-
? sort?.key === column.key
|
|
48
|
-
? sort.direction === 'asc'
|
|
49
|
-
? 'ascending'
|
|
50
|
-
: 'descending'
|
|
51
|
-
: 'none'
|
|
52
|
-
: undefined, children: _jsxs(Box, { as: "div", className: cm.tableSortWrapper, children: [column.header, column.sortable && sort?.key === column.key && (_jsx(Box, { as: "span", className: cm.tableSortIcon, children: sort.direction === 'asc'
|
|
53
|
-
? renderIcon('chevron-up', cm.iconSm)
|
|
54
|
-
: renderIcon('chevron-down', cm.iconSm) }))] }) }, column.key))) }) }), _jsx(TableBox, { as: "tbody", className: cm.tableBody, children: data.length === 0 ? (_jsx(TableBox, { as: "tr", children: _jsx(TableCell, { as: "td", colSpan: columns.length, className: cm.tableEmptyCell, children: emptyContent ||
|
|
55
|
-
t('ui.table.empty', undefined, { defaultValue: 'No data available' }) }) })) : (data.map((row, rowIndex) => (_jsx(TableBox, { as: "tr", className: cm.cn(cm.tableRow, striped && rowIndex % 2 === 1 && cm.tableRowStriped, hoverable && cm.tableRowHoverable, onRowClick && cm.tableRowClickable), onClick: onRowClick ? () => onRowClick(row, rowIndex) : undefined, children: columns.map((column) => (_jsx(TableCell, { as: "td", className: cm.cn(cm.tableCell, column.align === 'center' && cm.textCenter, column.align === 'right' && cm.textRight), children: getCellValue(row, column, rowIndex) }, column.key))) }, getRowKey(row, rowIndex))))) })] })] }));
|
|
56
|
-
});
|
|
57
|
-
Table.displayName = 'Table';
|
|
1
|
+
export { Table } from '#kit';
|
|
58
2
|
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/components/Table.
|
|
1
|
+
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/components/Table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Tabs component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { TabsProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* Tabs component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Tabs: React.ForwardRefExoticComponent<TabsProps<string> & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
export { Tabs } from '#kit';
|
|
12
2
|
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/components/Tabs.
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/components/Tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA"}
|