@common-origin/design-system 2.19.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +169 -169
- package/dist/client.js.map +1 -1
- package/dist/components/atoms/Avatar/Avatar.d.mts +8 -0
- package/dist/components/atoms/Avatar/Avatar.mjs +103 -0
- package/dist/components/atoms/Avatar/Avatar.mjs.map +1 -0
- package/dist/components/atoms/Avatar/index.d.mts +1 -0
- package/dist/components/atoms/Badge/Badge.d.mts +25 -0
- package/dist/components/atoms/Badge/Badge.mjs +98 -0
- package/dist/components/atoms/Badge/Badge.mjs.map +1 -0
- package/dist/components/atoms/Badge/index.d.mts +2 -0
- package/dist/components/atoms/Box/Box.d.mts +62 -0
- package/dist/components/atoms/Box/Box.mjs +246 -0
- package/dist/components/atoms/Box/Box.mjs.map +1 -0
- package/dist/components/atoms/Box/index.d.mts +1 -0
- package/dist/components/atoms/Button/Button.d.mts +40 -0
- package/dist/components/atoms/Button/Button.mjs +208 -0
- package/dist/components/atoms/Button/Button.mjs.map +1 -0
- package/dist/components/atoms/Button/index.d.mts +1 -0
- package/dist/components/atoms/CategoryBadge/CategoryBadge.d.mts +29 -0
- package/dist/components/atoms/CategoryBadge/CategoryBadge.mjs +29 -0
- package/dist/components/atoms/CategoryBadge/CategoryBadge.mjs.map +1 -0
- package/dist/components/atoms/CategoryBadge/index.d.mts +2 -0
- package/dist/components/atoms/CategoryLabel/CategoryLabel.d.mts +69 -0
- package/dist/components/atoms/CategoryLabel/CategoryLabel.mjs +151 -0
- package/dist/components/atoms/CategoryLabel/CategoryLabel.mjs.map +1 -0
- package/dist/components/atoms/CategoryLabel/index.d.mts +2 -0
- package/dist/components/atoms/Chip/BooleanChip.d.mts +28 -0
- package/dist/components/atoms/Chip/BooleanChip.mjs +76 -0
- package/dist/components/atoms/Chip/BooleanChip.mjs.map +1 -0
- package/dist/components/atoms/Chip/Chip.d.mts +37 -0
- package/dist/components/atoms/Chip/Chip.mjs +76 -0
- package/dist/components/atoms/Chip/Chip.mjs.map +1 -0
- package/dist/components/atoms/Chip/FilterChip.d.mts +13 -0
- package/dist/components/atoms/Chip/FilterChip.mjs +14 -0
- package/dist/components/atoms/Chip/FilterChip.mjs.map +1 -0
- package/dist/components/atoms/Chip/InputChip.d.mts +27 -0
- package/dist/components/atoms/Chip/InputChip.mjs +97 -0
- package/dist/components/atoms/Chip/InputChip.mjs.map +1 -0
- package/dist/components/atoms/Chip/index.d.mts +4 -0
- package/dist/components/atoms/Chip/shared/ChipBase.d.mts +12 -0
- package/dist/components/atoms/Chip/shared/ChipBase.mjs +45 -0
- package/dist/components/atoms/Chip/shared/ChipBase.mjs.map +1 -0
- package/dist/components/atoms/Chip/shared/types.d.mts +34 -0
- package/dist/components/atoms/Chip/shared/utils.d.mts +10 -0
- package/dist/components/atoms/Chip/shared/utils.mjs +46 -0
- package/dist/components/atoms/Chip/shared/utils.mjs.map +1 -0
- package/dist/components/atoms/Container/Container.d.mts +6 -0
- package/dist/components/atoms/Container/Container.mjs +24 -0
- package/dist/components/atoms/Container/Container.mjs.map +1 -0
- package/dist/components/atoms/Container/index.d.mts +1 -0
- package/dist/components/atoms/DateFormatter/DateFormatter.d.mts +23 -0
- package/dist/components/atoms/DateFormatter/DateFormatter.mjs +64 -0
- package/dist/components/atoms/DateFormatter/DateFormatter.mjs.map +1 -0
- package/dist/components/atoms/DateFormatter/index.d.mts +1 -0
- package/dist/components/atoms/Divider/Divider.d.mts +30 -0
- package/dist/components/atoms/Divider/Divider.mjs +134 -0
- package/dist/components/atoms/Divider/Divider.mjs.map +1 -0
- package/dist/components/atoms/Divider/index.d.mts +1 -0
- package/dist/components/atoms/Icon/Icon.d.mts +22 -0
- package/dist/components/atoms/Icon/Icon.mjs +95 -0
- package/dist/components/atoms/Icon/Icon.mjs.map +1 -0
- package/dist/components/atoms/Icon/index.d.mts +1 -0
- package/dist/components/atoms/IconButton/IconButton.d.mts +14 -0
- package/dist/components/atoms/IconButton/IconButton.mjs +150 -0
- package/dist/components/atoms/IconButton/IconButton.mjs.map +1 -0
- package/dist/components/atoms/IconButton/index.d.mts +1 -0
- package/dist/components/atoms/MoneyDisplay/MoneyDisplay.d.mts +26 -0
- package/dist/components/atoms/MoneyDisplay/MoneyDisplay.mjs +126 -0
- package/dist/components/atoms/MoneyDisplay/MoneyDisplay.mjs.map +1 -0
- package/dist/components/atoms/MoneyDisplay/index.d.mts +2 -0
- package/dist/components/atoms/Picture/Picture.d.mts +12 -0
- package/dist/components/atoms/Picture/Picture.mjs +65 -0
- package/dist/components/atoms/Picture/Picture.mjs.map +1 -0
- package/dist/components/atoms/Picture/index.d.mts +1 -0
- package/dist/components/atoms/ProgressBar/ProgressBar.d.mts +21 -0
- package/dist/components/atoms/ProgressBar/ProgressBar.mjs +91 -0
- package/dist/components/atoms/ProgressBar/ProgressBar.mjs.map +1 -0
- package/dist/components/atoms/ProgressBar/index.d.mts +2 -0
- package/dist/components/atoms/Stack/Stack.d.mts +16 -0
- package/dist/components/atoms/Stack/Stack.mjs +71 -0
- package/dist/components/atoms/Stack/Stack.mjs.map +1 -0
- package/dist/components/atoms/Stack/index.d.mts +1 -0
- package/dist/components/atoms/StatusBadge/StatusBadge.d.mts +23 -0
- package/dist/components/atoms/StatusBadge/StatusBadge.mjs +18 -0
- package/dist/components/atoms/StatusBadge/StatusBadge.mjs.map +1 -0
- package/dist/components/atoms/StatusBadge/index.d.mts +2 -0
- package/dist/components/atoms/StatusLabel/StatusLabel.d.mts +17 -0
- package/dist/components/atoms/StatusLabel/StatusLabel.mjs +28 -0
- package/dist/components/atoms/StatusLabel/StatusLabel.mjs.map +1 -0
- package/dist/components/atoms/StatusLabel/StatusLabelBase.d.mts +49 -0
- package/dist/components/atoms/StatusLabel/StatusLabelBase.mjs +161 -0
- package/dist/components/atoms/StatusLabel/StatusLabelBase.mjs.map +1 -0
- package/dist/components/atoms/StatusLabel/index.d.mts +2 -0
- package/dist/components/atoms/Tag/Tag.d.mts +36 -0
- package/dist/components/atoms/Tag/Tag.mjs +115 -0
- package/dist/components/atoms/Tag/Tag.mjs.map +1 -0
- package/dist/components/atoms/Tag/index.d.mts +2 -0
- package/dist/components/atoms/Typography/Typography.d.mts +34 -0
- package/dist/components/atoms/Typography/Typography.mjs +139 -0
- package/dist/components/atoms/Typography/Typography.mjs.map +1 -0
- package/dist/components/atoms/Typography/index.d.mts +1 -0
- package/dist/components/atoms/index.d.mts +20 -0
- package/dist/components/index.d.mts +4 -0
- package/dist/components/layout/GridSystem/GridSystem.d.mts +58 -0
- package/dist/components/layout/GridSystem/GridSystem.mjs +221 -0
- package/dist/components/layout/GridSystem/GridSystem.mjs.map +1 -0
- package/dist/components/layout/GridSystem/index.d.mts +1 -0
- package/dist/components/layout/index.d.mts +1 -0
- package/dist/components/molecules/AccountCard/AccountCard.d.mts +44 -0
- package/dist/components/molecules/AccountCard/AccountCard.mjs +191 -0
- package/dist/components/molecules/AccountCard/AccountCard.mjs.map +1 -0
- package/dist/components/molecules/AccountCard/index.d.mts +2 -0
- package/dist/components/molecules/ActionSheet/ActionSheet.d.mts +111 -0
- package/dist/components/molecules/ActionSheet/ActionSheet.mjs +283 -0
- package/dist/components/molecules/ActionSheet/ActionSheet.mjs.map +1 -0
- package/dist/components/molecules/ActionSheet/index.d.mts +2 -0
- package/dist/components/molecules/AgentInput/AgentInput.d.mts +30 -0
- package/dist/components/molecules/AgentInput/AgentInput.mjs +735 -0
- package/dist/components/molecules/AgentInput/AgentInput.mjs.map +1 -0
- package/dist/components/molecules/AgentInput/agentInputSpeech.d.mts +43 -0
- package/dist/components/molecules/AgentInput/agentInputSpeech.mjs +49 -0
- package/dist/components/molecules/AgentInput/agentInputSpeech.mjs.map +1 -0
- package/dist/components/molecules/AgentInput/agentInputStateMachine.d.mts +29 -0
- package/dist/components/molecules/AgentInput/agentInputStateMachine.mjs +55 -0
- package/dist/components/molecules/AgentInput/agentInputStateMachine.mjs.map +1 -0
- package/dist/components/molecules/AgentInput/index.d.mts +3 -0
- package/dist/components/molecules/Alert/Alert.d.mts +68 -0
- package/dist/components/molecules/Alert/Alert.mjs +284 -0
- package/dist/components/molecules/Alert/Alert.mjs.map +1 -0
- package/dist/components/molecules/Alert/index.d.mts +1 -0
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.mts +16 -0
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.mjs +74 -0
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.mjs.map +1 -0
- package/dist/components/molecules/Breadcrumbs/index.d.mts +1 -0
- package/dist/components/molecules/CardLarge/CardLarge.d.mts +12 -0
- package/dist/components/molecules/CardLarge/CardLarge.mjs +75 -0
- package/dist/components/molecules/CardLarge/CardLarge.mjs.map +1 -0
- package/dist/components/molecules/CardLarge/index.d.mts +1 -0
- package/dist/components/molecules/CardSmall/CardSmall.d.mts +16 -0
- package/dist/components/molecules/CardSmall/CardSmall.mjs +73 -0
- package/dist/components/molecules/CardSmall/CardSmall.mjs.map +1 -0
- package/dist/components/molecules/CardSmall/index.d.mts +1 -0
- package/dist/components/molecules/Checkbox/Checkbox.d.mts +64 -0
- package/dist/components/molecules/Checkbox/Checkbox.mjs +139 -0
- package/dist/components/molecules/Checkbox/Checkbox.mjs.map +1 -0
- package/dist/components/molecules/Checkbox/SelectableInputBase.d.mts +40 -0
- package/dist/components/molecules/Checkbox/SelectableInputBase.mjs +99 -0
- package/dist/components/molecules/Checkbox/SelectableInputBase.mjs.map +1 -0
- package/dist/components/molecules/Checkbox/index.d.mts +3 -0
- package/dist/components/molecules/ChipGroup/ChipGroup.d.mts +7 -0
- package/dist/components/molecules/ChipGroup/ChipGroup.mjs +54 -0
- package/dist/components/molecules/ChipGroup/ChipGroup.mjs.map +1 -0
- package/dist/components/molecules/ChipGroup/index.d.mts +1 -0
- package/dist/components/molecules/CodeBlock/CodeBlock.d.mts +46 -0
- package/dist/components/molecules/CodeBlock/CodeBlock.mjs +231 -0
- package/dist/components/molecules/CodeBlock/CodeBlock.mjs.map +1 -0
- package/dist/components/molecules/CodeBlock/index.d.mts +1 -0
- package/dist/components/molecules/DateGroup/DateGroup.d.mts +37 -0
- package/dist/components/molecules/DateGroup/DateGroup.mjs +104 -0
- package/dist/components/molecules/DateGroup/DateGroup.mjs.map +1 -0
- package/dist/components/molecules/DateGroup/index.d.mts +2 -0
- package/dist/components/molecules/Dropdown/Dropdown.d.mts +27 -0
- package/dist/components/molecules/Dropdown/Dropdown.mjs +282 -0
- package/dist/components/molecules/Dropdown/Dropdown.mjs.map +1 -0
- package/dist/components/molecules/Dropdown/index.d.mts +1 -0
- package/dist/components/molecules/EmptyState/EmptyState.d.mts +32 -0
- package/dist/components/molecules/EmptyState/EmptyState.mjs +133 -0
- package/dist/components/molecules/EmptyState/EmptyState.mjs.map +1 -0
- package/dist/components/molecules/EmptyState/index.d.mts +2 -0
- package/dist/components/molecules/FeatureBlock/FeatureBlock.d.mts +14 -0
- package/dist/components/molecules/FeatureBlock/FeatureBlock.mjs +99 -0
- package/dist/components/molecules/FeatureBlock/FeatureBlock.mjs.map +1 -0
- package/dist/components/molecules/FeatureBlock/index.d.mts +1 -0
- package/dist/components/molecules/InlineAlert/InlineAlert.d.mts +54 -0
- package/dist/components/molecules/InlineAlert/InlineAlert.mjs +140 -0
- package/dist/components/molecules/InlineAlert/InlineAlert.mjs.map +1 -0
- package/dist/components/molecules/InlineAlert/index.d.mts +2 -0
- package/dist/components/molecules/List/List.d.mts +30 -0
- package/dist/components/molecules/List/List.mjs +45 -0
- package/dist/components/molecules/List/List.mjs.map +1 -0
- package/dist/components/molecules/List/ListContext.d.mts +6 -0
- package/dist/components/molecules/List/ListContext.mjs +11 -0
- package/dist/components/molecules/List/ListContext.mjs.map +1 -0
- package/dist/components/molecules/List/ListItem.d.mts +101 -0
- package/dist/components/molecules/List/ListItem.mjs +224 -0
- package/dist/components/molecules/List/ListItem.mjs.map +1 -0
- package/dist/components/molecules/List/index.d.mts +4 -0
- package/dist/components/molecules/Modal/Modal.d.mts +69 -0
- package/dist/components/molecules/Modal/Modal.mjs +259 -0
- package/dist/components/molecules/Modal/Modal.mjs.map +1 -0
- package/dist/components/molecules/Modal/index.d.mts +2 -0
- package/dist/components/molecules/NumberInput/NumberInput.d.mts +86 -0
- package/dist/components/molecules/NumberInput/NumberInput.mjs +268 -0
- package/dist/components/molecules/NumberInput/NumberInput.mjs.map +1 -0
- package/dist/components/molecules/NumberInput/index.d.mts +2 -0
- package/dist/components/molecules/PageTitle/PageTitle.d.mts +21 -0
- package/dist/components/molecules/PageTitle/PageTitle.mjs +77 -0
- package/dist/components/molecules/PageTitle/PageTitle.mjs.map +1 -0
- package/dist/components/molecules/PageTitle/index.d.mts +1 -0
- package/dist/components/molecules/PasswordField/PasswordField.d.mts +55 -0
- package/dist/components/molecules/PasswordField/PasswordField.mjs +146 -0
- package/dist/components/molecules/PasswordField/PasswordField.mjs.map +1 -0
- package/dist/components/molecules/PasswordField/index.d.mts +2 -0
- package/dist/components/molecules/SearchField/SearchField.d.mts +108 -0
- package/dist/components/molecules/SearchField/SearchField.mjs +340 -0
- package/dist/components/molecules/SearchField/SearchField.mjs.map +1 -0
- package/dist/components/molecules/SearchField/index.d.mts +2 -0
- package/dist/components/molecules/Sheet/Sheet.d.mts +96 -0
- package/dist/components/molecules/Sheet/Sheet.mjs +243 -0
- package/dist/components/molecules/Sheet/Sheet.mjs.map +1 -0
- package/dist/components/molecules/Sheet/index.d.mts +2 -0
- package/dist/components/molecules/Slider/Slider.d.mts +102 -0
- package/dist/components/molecules/Slider/Slider.mjs +462 -0
- package/dist/components/molecules/Slider/Slider.mjs.map +1 -0
- package/dist/components/molecules/Slider/index.d.mts +2 -0
- package/dist/components/molecules/TabBar/TabBar.d.mts +82 -0
- package/dist/components/molecules/TabBar/TabBar.mjs +213 -0
- package/dist/components/molecules/TabBar/TabBar.mjs.map +1 -0
- package/dist/components/molecules/TabBar/index.d.mts +2 -0
- package/dist/components/molecules/TextField/InputBase.d.mts +22 -0
- package/dist/components/molecules/TextField/InputBase.mjs +56 -0
- package/dist/components/molecules/TextField/InputBase.mjs.map +1 -0
- package/dist/components/molecules/TextField/TextField.d.mts +56 -0
- package/dist/components/molecules/TextField/TextField.mjs +115 -0
- package/dist/components/molecules/TextField/TextField.mjs.map +1 -0
- package/dist/components/molecules/TextField/index.d.mts +4 -0
- package/dist/components/molecules/TransactionListItem/TransactionListItem.d.mts +39 -0
- package/dist/components/molecules/TransactionListItem/TransactionListItem.mjs +224 -0
- package/dist/components/molecules/TransactionListItem/TransactionListItem.mjs.map +1 -0
- package/dist/components/molecules/TransactionListItem/index.d.mts +2 -0
- package/dist/components/molecules/index.d.mts +26 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +55 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/cssTokens.d.mts +14 -0
- package/dist/lib/cssTokens.mjs +19 -0
- package/dist/lib/cssTokens.mjs.map +1 -0
- package/dist/lib/cssVariables.d.mts +15 -0
- package/dist/lib/cssVariables.mjs +37 -0
- package/dist/lib/cssVariables.mjs.map +1 -0
- package/dist/lib/styleUtils.d.mts +42 -0
- package/dist/lib/styleUtils.mjs +160 -0
- package/dist/lib/styleUtils.mjs.map +1 -0
- package/dist/lib/tokenAliases.d.mts +13 -0
- package/dist/lib/tokenAliases.mjs +121 -0
- package/dist/lib/tokenAliases.mjs.map +1 -0
- package/dist/lib/usePresence.d.mts +16 -0
- package/dist/lib/usePresence.mjs +50 -0
- package/dist/lib/usePresence.mjs.map +1 -0
- package/dist/{data.esm.js → styles/icons.json.mjs} +2 -1466
- package/dist/styles/icons.json.mjs.map +1 -0
- package/dist/styles/tokens.d.mts +3174 -0
- package/dist/styles/tokens.json.mjs +1454 -0
- package/dist/{tokens/index.esm.js.map → styles/tokens.json.mjs.map} +1 -1
- package/dist/tokens/{index.esm.js → index.mjs} +1 -1
- package/dist/tokens/index.mjs.map +1 -0
- package/dist/tokens/styles/tokens.d.mts +3174 -0
- package/dist/tokens/tokens.d.mts +4 -0
- package/dist/tokens/types/tokens.d.mts +6 -0
- package/dist/tokens.css.d.mts +4 -0
- package/dist/types/icons.d.mts +25 -0
- package/dist/types/icons.mjs +10 -0
- package/dist/types/icons.mjs.map +1 -0
- package/dist/types/index.d.mts +1 -0
- package/dist/types/tokens.d.mts +6 -0
- package/dist/types/tokens.mjs +10 -0
- package/dist/types/tokens.mjs.map +1 -0
- package/dist/vendor/tslib/tslib.es6.mjs +99 -0
- package/dist/vendor/tslib/tslib.es6.mjs.map +1 -0
- package/package.json +26 -12
- package/dist/client.esm.js +0 -8289
- package/dist/client.esm.js.map +0 -1
- package/dist/data.esm.js.map +0 -1
- package/dist/index.esm.js +0 -8
- package/dist/index.esm.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import styled$module from 'styled-components';
|
|
5
|
+
const styled = styled$module.default || styled$module;
|
|
6
|
+
import '../../atoms/Avatar/Avatar.mjs';
|
|
7
|
+
import '../../atoms/Badge/Badge.mjs';
|
|
8
|
+
import '../../atoms/Box/Box.mjs';
|
|
9
|
+
import '../../atoms/Button/Button.mjs';
|
|
10
|
+
import '../../atoms/CategoryBadge/CategoryBadge.mjs';
|
|
11
|
+
import '../../atoms/CategoryLabel/CategoryLabel.mjs';
|
|
12
|
+
import { Chip } from '../../atoms/Chip/Chip.mjs';
|
|
13
|
+
import '../../atoms/Icon/Icon.mjs';
|
|
14
|
+
import '../../atoms/Chip/shared/ChipBase.mjs';
|
|
15
|
+
import '../../atoms/Container/Container.mjs';
|
|
16
|
+
import '../../atoms/Picture/Picture.mjs';
|
|
17
|
+
import '../../atoms/DateFormatter/DateFormatter.mjs';
|
|
18
|
+
import '../../atoms/IconButton/IconButton.mjs';
|
|
19
|
+
import '../../atoms/MoneyDisplay/MoneyDisplay.mjs';
|
|
20
|
+
import '../../atoms/ProgressBar/ProgressBar.mjs';
|
|
21
|
+
import '../../atoms/Divider/Divider.mjs';
|
|
22
|
+
import { Stack } from '../../atoms/Stack/Stack.mjs';
|
|
23
|
+
import '../../atoms/StatusBadge/StatusBadge.mjs';
|
|
24
|
+
import '../../atoms/StatusLabel/StatusLabel.mjs';
|
|
25
|
+
import '../../atoms/Tag/Tag.mjs';
|
|
26
|
+
import '../../atoms/Typography/Typography.mjs';
|
|
27
|
+
|
|
28
|
+
var ChipGroupWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
29
|
+
displayName: "ChipGroup__ChipGroupWrapper",
|
|
30
|
+
componentId: "sc-ae049w-0"
|
|
31
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n > div {\n display: flex;\n flex-wrap: wrap;\n }\n"], ["\n > div {\n display: flex;\n flex-wrap: wrap;\n }\n"])));
|
|
32
|
+
var ChipGroup = function ChipGroup(_a) {
|
|
33
|
+
var labels = _a.labels,
|
|
34
|
+
_b = _a.variant,
|
|
35
|
+
variant = _b === void 0 ? 'default' : _b,
|
|
36
|
+
dataTestId = _a["data-testid"];
|
|
37
|
+
return jsx(ChipGroupWrapper, {
|
|
38
|
+
"data-testid": dataTestId,
|
|
39
|
+
children: jsx(Stack, {
|
|
40
|
+
direction: "row",
|
|
41
|
+
gap: "sm",
|
|
42
|
+
children: labels && labels.map(function (title, index) {
|
|
43
|
+
return jsx(Chip, {
|
|
44
|
+
title: title,
|
|
45
|
+
variant: variant
|
|
46
|
+
}, index);
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
var templateObject_1;
|
|
52
|
+
|
|
53
|
+
export { ChipGroup };
|
|
54
|
+
//# sourceMappingURL=ChipGroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChipGroup.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ChipGroup.mjs';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CodeBlockProps {
|
|
3
|
+
children: string;
|
|
4
|
+
showCopyButton?: boolean;
|
|
5
|
+
onCopy?: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Maximum height in pixels before content is collapsed.
|
|
8
|
+
* When set, enables expand/collapse functionality.
|
|
9
|
+
*/
|
|
10
|
+
maxHeight?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Initial expanded state when maxHeight is set.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
defaultExpanded?: boolean;
|
|
16
|
+
'data-testid'?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* CodeBlock component for displaying formatted code with optional copy functionality
|
|
20
|
+
* and expandable content for long code blocks.
|
|
21
|
+
*
|
|
22
|
+
* @param children - The code content to display
|
|
23
|
+
* @param showCopyButton - Whether to show the copy button (default: true)
|
|
24
|
+
* @param onCopy - Optional callback when code is copied
|
|
25
|
+
* @param maxHeight - Maximum height in pixels before enabling expand/collapse
|
|
26
|
+
* @param defaultExpanded - Initial expanded state when maxHeight is set
|
|
27
|
+
* @param data-testid - Test identifier for the code block
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Basic usage
|
|
32
|
+
* <CodeBlock>const x = 1;</CodeBlock>
|
|
33
|
+
*
|
|
34
|
+
* // With max height and expand/collapse
|
|
35
|
+
* <CodeBlock maxHeight={200}>
|
|
36
|
+
* {longCodeString}
|
|
37
|
+
* </CodeBlock>
|
|
38
|
+
*
|
|
39
|
+
* // Start expanded
|
|
40
|
+
* <CodeBlock maxHeight={200} defaultExpanded>
|
|
41
|
+
* {longCodeString}
|
|
42
|
+
* </CodeBlock>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare const CodeBlock: React.FC<CodeBlockProps>;
|
|
46
|
+
export default CodeBlock;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject, __awaiter, __generator } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useState, useRef, useEffect } from 'react';
|
|
5
|
+
import styled$module from 'styled-components';
|
|
6
|
+
const styled = styled$module.default || styled$module;
|
|
7
|
+
import { Button } from '../../atoms/Button/Button.mjs';
|
|
8
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
9
|
+
import { reducedMotion, visuallyHidden } from '../../../lib/styleUtils.mjs';
|
|
10
|
+
|
|
11
|
+
var _a = tokens.semantic,
|
|
12
|
+
color = _a.color,
|
|
13
|
+
border = _a.border,
|
|
14
|
+
motion = _a.motion;
|
|
15
|
+
var StyledCodeBlock = /*#__PURE__*/styled.pre.withConfig({
|
|
16
|
+
displayName: "CodeBlock__StyledCodeBlock",
|
|
17
|
+
componentId: "sc-1p1t0kp-0"
|
|
18
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n border: ", ";\n border-radius: ", ";\n padding: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n overflow-x: auto;\n overflow-y: ", ";\n margin: ", " 0;\n position: relative;\n transition: max-height ", " ", ";\n\n ", " {\n transition: none;\n }\n \n ", "\n\n /* The block is focusable so keyboard users can scroll it; it shows the system focus ring\n (decision 0029) */\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n"], ["\n background-color: ", ";\n border: ", ";\n border-radius: ", ";\n padding: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n overflow-x: auto;\n overflow-y: ", ";\n margin: ", " 0;\n position: relative;\n transition: max-height ", " ", ";\n\n ", " {\n transition: none;\n }\n \n ", "\n\n /* The block is focusable so keyboard users can scroll it; it shows the system focus ring\n (decision 0029) */\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n"])), tokens.semantic.surface.raised, border.emphasis, tokens.semantic.radius.sm, tokens.semantic.space[300], tokens.component.codeBlock.fontFamily, tokens.component.codeBlock.fontSize, tokens.component.codeBlock.lineHeight, color.text["default"], function (_a) {
|
|
19
|
+
var $isExpanded = _a.$isExpanded,
|
|
20
|
+
$needsExpansion = _a.$needsExpansion;
|
|
21
|
+
return $needsExpansion && !$isExpanded ? 'hidden' : 'auto';
|
|
22
|
+
}, tokens.semantic.space[200], motion.duration.slow, motion.easing.standard, reducedMotion, function (_a) {
|
|
23
|
+
var $maxHeight = _a.$maxHeight,
|
|
24
|
+
$isExpanded = _a.$isExpanded,
|
|
25
|
+
$needsExpansion = _a.$needsExpansion;
|
|
26
|
+
if (!$maxHeight || !$needsExpansion) return '';
|
|
27
|
+
// Use a large value when expanded to allow smooth transition
|
|
28
|
+
// 10000px is effectively "no limit" for most code blocks
|
|
29
|
+
return $isExpanded ? 'max-height: 10000px;' : "max-height: ".concat($maxHeight, "px;");
|
|
30
|
+
}, border.focus, border.focusOffset);
|
|
31
|
+
var CodeBlockWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
32
|
+
displayName: "CodeBlock__CodeBlockWrapper",
|
|
33
|
+
componentId: "sc-1p1t0kp-1"
|
|
34
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n display: inline-block;\n width: 100%;\n"], ["\n position: relative;\n display: inline-block;\n width: 100%;\n"])));
|
|
35
|
+
var CopyButtonWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
36
|
+
displayName: "CodeBlock__CopyButtonWrapper",
|
|
37
|
+
componentId: "sc-1p1t0kp-2"
|
|
38
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n bottom: ", ";\n right: ", ";\n"], ["\n position: absolute;\n bottom: ", ";\n right: ", ";\n"])), tokens.semantic.space[400], tokens.semantic.space[200]);
|
|
39
|
+
var ExpandButtonWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
40
|
+
displayName: "CodeBlock__ExpandButtonWrapper",
|
|
41
|
+
componentId: "sc-1p1t0kp-3"
|
|
42
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n padding: ", " 0;\n position: absolute;\n bottom: ", ";\n left: ", ";\n right: ", ";\n width: calc(100% - 2 * ", ");\n margin-bottom: ", ";\n border-radius: ", ";\n transition: opacity ", " ", ", background ", " ", ";\n \n ", "\n"], ["\n display: flex;\n justify-content: center;\n padding: ", " 0;\n position: absolute;\n bottom: ", ";\n left: ", ";\n right: ", ";\n width: calc(100% - 2 * ", ");\n margin-bottom: ", ";\n border-radius: ", ";\n transition: opacity ", " ", ", background ", " ", ";\n \n ", "\n"])), tokens.semantic.space[200], tokens.semantic.border.width.thin, tokens.semantic.border.width.thin, tokens.semantic.border.width.thin, tokens.semantic.border.width.thin, tokens.semantic.space[200], tokens.semantic.radius.sm, motion.duration.slow, motion.easing.standard, motion.duration.slow, motion.easing.standard, function (_a) {
|
|
43
|
+
var $hasGradient = _a.$hasGradient;
|
|
44
|
+
return $hasGradient ? "\n margin-top: calc(-1 * ".concat(tokens.semantic.space[800], ");\n padding-top: ").concat(tokens.semantic.space[800], ";\n background: linear-gradient(\n to bottom,\n transparent 0%,\n ").concat(tokens.semantic.surface.raised, " 60%\n );\n ") : "\n background: transparent;\n ";
|
|
45
|
+
});
|
|
46
|
+
var CopyButton = function CopyButton(_a) {
|
|
47
|
+
var text = _a.text,
|
|
48
|
+
onCopy = _a.onCopy;
|
|
49
|
+
var _b = useState(false),
|
|
50
|
+
copied = _b[0],
|
|
51
|
+
setCopied = _b[1];
|
|
52
|
+
var timeoutRef = useRef(null);
|
|
53
|
+
var handleCopy = function handleCopy() {
|
|
54
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
+
var err_1;
|
|
56
|
+
return __generator(this, function (_a) {
|
|
57
|
+
switch (_a.label) {
|
|
58
|
+
case 0:
|
|
59
|
+
_a.trys.push([0, 2,, 3]);
|
|
60
|
+
return [4 /*yield*/, navigator.clipboard.writeText(text)];
|
|
61
|
+
case 1:
|
|
62
|
+
_a.sent();
|
|
63
|
+
setCopied(true);
|
|
64
|
+
onCopy === null || onCopy === void 0 ? void 0 : onCopy();
|
|
65
|
+
// Clear any existing timeout
|
|
66
|
+
if (timeoutRef.current) {
|
|
67
|
+
clearTimeout(timeoutRef.current);
|
|
68
|
+
}
|
|
69
|
+
// Set new timeout
|
|
70
|
+
timeoutRef.current = setTimeout(function () {
|
|
71
|
+
setCopied(false);
|
|
72
|
+
timeoutRef.current = null;
|
|
73
|
+
}, 2000);
|
|
74
|
+
return [3 /*break*/, 3];
|
|
75
|
+
case 2:
|
|
76
|
+
err_1 = _a.sent();
|
|
77
|
+
console.error('Failed to copy text: ', err_1);
|
|
78
|
+
return [3 /*break*/, 3];
|
|
79
|
+
case 3:
|
|
80
|
+
return [2 /*return*/];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
// Cleanup timeout on unmount
|
|
86
|
+
useEffect(function () {
|
|
87
|
+
return function () {
|
|
88
|
+
if (timeoutRef.current) {
|
|
89
|
+
clearTimeout(timeoutRef.current);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}, []);
|
|
93
|
+
return jsx(CopyButtonWrapper, {
|
|
94
|
+
children: jsx(Button, {
|
|
95
|
+
variant: "secondary",
|
|
96
|
+
size: "small",
|
|
97
|
+
iconName: "copy",
|
|
98
|
+
onClick: handleCopy,
|
|
99
|
+
"data-testid": "copy-button",
|
|
100
|
+
children: copied ? 'Copied!' : 'Copy'
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
var LiveRegion = /*#__PURE__*/styled.span.withConfig({
|
|
105
|
+
displayName: "CodeBlock__LiveRegion",
|
|
106
|
+
componentId: "sc-1p1t0kp-4"
|
|
107
|
+
})(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"
|
|
108
|
+
/**
|
|
109
|
+
* CodeBlock component for displaying formatted code with optional copy functionality
|
|
110
|
+
* and expandable content for long code blocks.
|
|
111
|
+
*
|
|
112
|
+
* @param children - The code content to display
|
|
113
|
+
* @param showCopyButton - Whether to show the copy button (default: true)
|
|
114
|
+
* @param onCopy - Optional callback when code is copied
|
|
115
|
+
* @param maxHeight - Maximum height in pixels before enabling expand/collapse
|
|
116
|
+
* @param defaultExpanded - Initial expanded state when maxHeight is set
|
|
117
|
+
* @param data-testid - Test identifier for the code block
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```tsx
|
|
121
|
+
* // Basic usage
|
|
122
|
+
* <CodeBlock>const x = 1;</CodeBlock>
|
|
123
|
+
*
|
|
124
|
+
* // With max height and expand/collapse
|
|
125
|
+
* <CodeBlock maxHeight={200}>
|
|
126
|
+
* {longCodeString}
|
|
127
|
+
* </CodeBlock>
|
|
128
|
+
*
|
|
129
|
+
* // Start expanded
|
|
130
|
+
* <CodeBlock maxHeight={200} defaultExpanded>
|
|
131
|
+
* {longCodeString}
|
|
132
|
+
* </CodeBlock>
|
|
133
|
+
* ```
|
|
134
|
+
*/])), visuallyHidden);
|
|
135
|
+
/**
|
|
136
|
+
* CodeBlock component for displaying formatted code with optional copy functionality
|
|
137
|
+
* and expandable content for long code blocks.
|
|
138
|
+
*
|
|
139
|
+
* @param children - The code content to display
|
|
140
|
+
* @param showCopyButton - Whether to show the copy button (default: true)
|
|
141
|
+
* @param onCopy - Optional callback when code is copied
|
|
142
|
+
* @param maxHeight - Maximum height in pixels before enabling expand/collapse
|
|
143
|
+
* @param defaultExpanded - Initial expanded state when maxHeight is set
|
|
144
|
+
* @param data-testid - Test identifier for the code block
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```tsx
|
|
148
|
+
* // Basic usage
|
|
149
|
+
* <CodeBlock>const x = 1;</CodeBlock>
|
|
150
|
+
*
|
|
151
|
+
* // With max height and expand/collapse
|
|
152
|
+
* <CodeBlock maxHeight={200}>
|
|
153
|
+
* {longCodeString}
|
|
154
|
+
* </CodeBlock>
|
|
155
|
+
*
|
|
156
|
+
* // Start expanded
|
|
157
|
+
* <CodeBlock maxHeight={200} defaultExpanded>
|
|
158
|
+
* {longCodeString}
|
|
159
|
+
* </CodeBlock>
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
var CodeBlock = function CodeBlock(_a) {
|
|
163
|
+
var children = _a.children,
|
|
164
|
+
_b = _a.showCopyButton,
|
|
165
|
+
showCopyButton = _b === void 0 ? true : _b,
|
|
166
|
+
onCopy = _a.onCopy,
|
|
167
|
+
maxHeight = _a.maxHeight,
|
|
168
|
+
_c = _a.defaultExpanded,
|
|
169
|
+
defaultExpanded = _c === void 0 ? false : _c,
|
|
170
|
+
testId = _a["data-testid"];
|
|
171
|
+
var _d = useState(defaultExpanded),
|
|
172
|
+
isExpanded = _d[0],
|
|
173
|
+
setIsExpanded = _d[1];
|
|
174
|
+
var _e = useState(false),
|
|
175
|
+
needsExpansion = _e[0],
|
|
176
|
+
setNeedsExpansion = _e[1];
|
|
177
|
+
var _f = useState(''),
|
|
178
|
+
announcement = _f[0],
|
|
179
|
+
setAnnouncement = _f[1];
|
|
180
|
+
var contentRef = useRef(null);
|
|
181
|
+
// Check if content exceeds maxHeight
|
|
182
|
+
useEffect(function () {
|
|
183
|
+
if (maxHeight && contentRef.current) {
|
|
184
|
+
var scrollHeight = contentRef.current.scrollHeight;
|
|
185
|
+
setNeedsExpansion(scrollHeight > maxHeight);
|
|
186
|
+
}
|
|
187
|
+
}, [children, maxHeight]);
|
|
188
|
+
var handleToggleExpand = function handleToggleExpand() {
|
|
189
|
+
setIsExpanded(function (prev) {
|
|
190
|
+
return !prev;
|
|
191
|
+
});
|
|
192
|
+
// Announce state change to screen readers
|
|
193
|
+
setAnnouncement(isExpanded ? 'Code block collapsed' : 'Code block expanded');
|
|
194
|
+
};
|
|
195
|
+
var showExpandButton = maxHeight && needsExpansion;
|
|
196
|
+
return jsxs(CodeBlockWrapper, {
|
|
197
|
+
children: [jsx(StyledCodeBlock, {
|
|
198
|
+
ref: contentRef,
|
|
199
|
+
"data-testid": testId,
|
|
200
|
+
"$maxHeight": maxHeight,
|
|
201
|
+
"$isExpanded": isExpanded,
|
|
202
|
+
"$needsExpansion": needsExpansion,
|
|
203
|
+
"aria-expanded": showExpandButton ? isExpanded : undefined,
|
|
204
|
+
tabIndex: 0,
|
|
205
|
+
children: children
|
|
206
|
+
}), showExpandButton && jsx(ExpandButtonWrapper, {
|
|
207
|
+
"$hasGradient": !isExpanded,
|
|
208
|
+
children: jsx(Button, {
|
|
209
|
+
variant: "secondary",
|
|
210
|
+
size: "small",
|
|
211
|
+
iconName: isExpanded ? 'caretUp' : 'caretDown',
|
|
212
|
+
onClick: handleToggleExpand,
|
|
213
|
+
"aria-expanded": isExpanded,
|
|
214
|
+
"aria-controls": testId,
|
|
215
|
+
"data-testid": "expand-button",
|
|
216
|
+
children: isExpanded ? 'Show less' : 'Show more'
|
|
217
|
+
})
|
|
218
|
+
}), showExpandButton && jsx(LiveRegion, {
|
|
219
|
+
"aria-live": "polite",
|
|
220
|
+
"aria-atomic": "true",
|
|
221
|
+
children: announcement
|
|
222
|
+
}), showCopyButton && jsx(CopyButton, {
|
|
223
|
+
text: children,
|
|
224
|
+
onCopy: onCopy
|
|
225
|
+
})]
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
229
|
+
|
|
230
|
+
export { CodeBlock, CodeBlock as default };
|
|
231
|
+
//# sourceMappingURL=CodeBlock.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CodeBlock.mjs';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateFormatMode } from '../../atoms/DateFormatter/index.mjs';
|
|
3
|
+
export interface DateGroupProps {
|
|
4
|
+
/** The date for this group (used for formatting the header) */
|
|
5
|
+
date: Date | string;
|
|
6
|
+
/** Children to render under the date header (typically transactions) */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Format mode for the date header, passed to DateFormatter's `mode`. `'relative'` is
|
|
10
|
+
* deprecated: it behaves exactly like `'smart'`, so use `'smart'` (#82).
|
|
11
|
+
*/
|
|
12
|
+
format?: DateFormatMode;
|
|
13
|
+
/** Whether to show total amount for this date group */
|
|
14
|
+
showTotal?: boolean;
|
|
15
|
+
/** Total amount for this date group (shown if showTotal is true) */
|
|
16
|
+
totalAmount?: number;
|
|
17
|
+
/** Whether to show count of items in this group */
|
|
18
|
+
showCount?: boolean;
|
|
19
|
+
/** Count of items in this group (shown if showCount is true) */
|
|
20
|
+
count?: number;
|
|
21
|
+
/** Whether to make the header sticky (useful for scrolling lists) */
|
|
22
|
+
sticky?: boolean;
|
|
23
|
+
/** Currency for total amount display */
|
|
24
|
+
currency?: string;
|
|
25
|
+
/** Test identifier for automated testing */
|
|
26
|
+
'data-testid'?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* DateGroup component
|
|
30
|
+
*
|
|
31
|
+
* Groups related content (typically transactions) under a formatted date header
|
|
32
|
+
* with optional total amount and item count displays. Supports sticky headers
|
|
33
|
+
* for scrolling lists.
|
|
34
|
+
*
|
|
35
|
+
* Composes: DateFormatter, MoneyDisplay, Stack, Typography
|
|
36
|
+
*/
|
|
37
|
+
export declare const DateGroup: React.FC<DateGroupProps>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import styled$module from 'styled-components';
|
|
5
|
+
const styled = styled$module.default || styled$module;
|
|
6
|
+
import { DateFormatter } from '../../atoms/DateFormatter/DateFormatter.mjs';
|
|
7
|
+
import { MoneyDisplay } from '../../atoms/MoneyDisplay/MoneyDisplay.mjs';
|
|
8
|
+
import { Typography } from '../../atoms/Typography/Typography.mjs';
|
|
9
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
10
|
+
|
|
11
|
+
var StyledHeader = /*#__PURE__*/styled.div.withConfig({
|
|
12
|
+
displayName: "DateGroup__StyledHeader",
|
|
13
|
+
componentId: "sc-9nfm1f-0"
|
|
14
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", " ", ";\n background-color: ", ";\n border-bottom: ", " solid ", ";\n \n ", "\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", " ", ";\n background-color: ", ";\n border-bottom: ", " solid ", ";\n \n ", "\n"])), tokens.semantic.space[300], tokens.semantic.space[200], tokens.semantic.surface.base, tokens.semantic.border.width.thin, tokens.semantic.color.border["default"], function (_a) {
|
|
15
|
+
var $sticky = _a.$sticky;
|
|
16
|
+
return $sticky && "\n position: sticky;\n top: 0;\n z-index: ".concat(tokens.semantic.layer.sticky, ";\n box-shadow: ").concat(tokens.semantic.elevation.sticky, ";\n ");
|
|
17
|
+
});
|
|
18
|
+
var StyledLeftSection = /*#__PURE__*/styled.div.withConfig({
|
|
19
|
+
displayName: "DateGroup__StyledLeftSection",
|
|
20
|
+
componentId: "sc-9nfm1f-1"
|
|
21
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", ";\n"], ["\n display: flex;\n align-items: center;\n gap: ", ";\n"])), tokens.semantic.space[200]);
|
|
22
|
+
var StyledRightSection = /*#__PURE__*/styled.div.withConfig({
|
|
23
|
+
displayName: "DateGroup__StyledRightSection",
|
|
24
|
+
componentId: "sc-9nfm1f-2"
|
|
25
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", ";\n"], ["\n display: flex;\n align-items: center;\n gap: ", ";\n"])), tokens.semantic.space[300]);
|
|
26
|
+
var StyledContent = /*#__PURE__*/styled.div.withConfig({
|
|
27
|
+
displayName: "DateGroup__StyledContent",
|
|
28
|
+
componentId: "sc-9nfm1f-3"
|
|
29
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n /* Content area for children */\n"], ["\n /* Content area for children */\n"
|
|
30
|
+
/**
|
|
31
|
+
* DateGroup component
|
|
32
|
+
*
|
|
33
|
+
* Groups related content (typically transactions) under a formatted date header
|
|
34
|
+
* with optional total amount and item count displays. Supports sticky headers
|
|
35
|
+
* for scrolling lists.
|
|
36
|
+
*
|
|
37
|
+
* Composes: DateFormatter, MoneyDisplay, Stack, Typography
|
|
38
|
+
*/])));
|
|
39
|
+
/**
|
|
40
|
+
* DateGroup component
|
|
41
|
+
*
|
|
42
|
+
* Groups related content (typically transactions) under a formatted date header
|
|
43
|
+
* with optional total amount and item count displays. Supports sticky headers
|
|
44
|
+
* for scrolling lists.
|
|
45
|
+
*
|
|
46
|
+
* Composes: DateFormatter, MoneyDisplay, Stack, Typography
|
|
47
|
+
*/
|
|
48
|
+
var DateGroup = function DateGroup(_a) {
|
|
49
|
+
var date = _a.date,
|
|
50
|
+
children = _a.children,
|
|
51
|
+
_b = _a.format,
|
|
52
|
+
format = _b === void 0 ? 'smart' : _b,
|
|
53
|
+
_c = _a.showTotal,
|
|
54
|
+
showTotal = _c === void 0 ? false : _c,
|
|
55
|
+
totalAmount = _a.totalAmount,
|
|
56
|
+
_d = _a.showCount,
|
|
57
|
+
showCount = _d === void 0 ? false : _d,
|
|
58
|
+
count = _a.count,
|
|
59
|
+
_e = _a.sticky,
|
|
60
|
+
sticky = _e === void 0 ? false : _e,
|
|
61
|
+
_f = _a.currency,
|
|
62
|
+
currency = _f === void 0 ? 'AUD' : _f,
|
|
63
|
+
dataTestId = _a["data-testid"];
|
|
64
|
+
// Determine total variant based on amount (positive = income, negative = expense)
|
|
65
|
+
var totalVariant = totalAmount && totalAmount !== 0 ? totalAmount > 0 ? 'positive' : 'negative' : 'default';
|
|
66
|
+
return jsxs("div", {
|
|
67
|
+
"data-testid": dataTestId,
|
|
68
|
+
role: "group",
|
|
69
|
+
"aria-label": "Transactions for ".concat(date),
|
|
70
|
+
children: [jsxs(StyledHeader, {
|
|
71
|
+
"$sticky": sticky,
|
|
72
|
+
"data-testid": dataTestId ? "".concat(dataTestId, "-header") : undefined,
|
|
73
|
+
children: [jsxs(StyledLeftSection, {
|
|
74
|
+
children: [jsx(DateFormatter, {
|
|
75
|
+
dateString: typeof date === 'string' ? date : date.toISOString(),
|
|
76
|
+
mode: format,
|
|
77
|
+
"data-testid": dataTestId ? "".concat(dataTestId, "-date") : undefined
|
|
78
|
+
}), showCount && count !== undefined && jsxs(Typography, {
|
|
79
|
+
variant: "caption",
|
|
80
|
+
color: "subdued",
|
|
81
|
+
"data-testid": dataTestId ? "".concat(dataTestId, "-count") : undefined,
|
|
82
|
+
children: ["(", count, " ", count === 1 ? 'item' : 'items', ")"]
|
|
83
|
+
})]
|
|
84
|
+
}), jsx(StyledRightSection, {
|
|
85
|
+
children: showTotal && totalAmount !== undefined && jsx(MoneyDisplay, {
|
|
86
|
+
amount: totalAmount,
|
|
87
|
+
currency: currency,
|
|
88
|
+
variant: totalVariant,
|
|
89
|
+
size: "small",
|
|
90
|
+
weight: "medium",
|
|
91
|
+
showSign: true,
|
|
92
|
+
"data-testid": dataTestId ? "".concat(dataTestId, "-total") : undefined
|
|
93
|
+
})
|
|
94
|
+
})]
|
|
95
|
+
}), jsx(StyledContent, {
|
|
96
|
+
"data-testid": dataTestId ? "".concat(dataTestId, "-content") : undefined,
|
|
97
|
+
children: children
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
102
|
+
|
|
103
|
+
export { DateGroup };
|
|
104
|
+
//# sourceMappingURL=DateGroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateGroup.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface DropdownOption {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
value?: any;
|
|
6
|
+
}
|
|
7
|
+
export interface DropdownProps {
|
|
8
|
+
options: DropdownOption[];
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
helperText?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
/** Test identifier for automated testing */
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const DropdownOption: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Merged<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
21
|
+
style?: React.CSSProperties | import("styled-components/dist/types.js").CSSPropertiesWithVars | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
$isSelected: boolean;
|
|
24
|
+
$isFocused: boolean;
|
|
25
|
+
}>> & string;
|
|
26
|
+
export declare const Dropdown: React.FC<DropdownProps>;
|
|
27
|
+
export {};
|