@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,224 @@
|
|
|
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 { Avatar } from '../../atoms/Avatar/Avatar.mjs';
|
|
7
|
+
import { Badge } from '../../atoms/Badge/Badge.mjs';
|
|
8
|
+
import { CategoryLabel } from '../../atoms/CategoryLabel/CategoryLabel.mjs';
|
|
9
|
+
import { MoneyDisplay } from '../../atoms/MoneyDisplay/MoneyDisplay.mjs';
|
|
10
|
+
import { Icon } from '../../atoms/Icon/Icon.mjs';
|
|
11
|
+
import { DateFormatter } from '../../atoms/DateFormatter/DateFormatter.mjs';
|
|
12
|
+
import { Typography } from '../../atoms/Typography/Typography.mjs';
|
|
13
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
14
|
+
import { interactiveRow } from '../../../lib/styleUtils.mjs';
|
|
15
|
+
|
|
16
|
+
var StyledContainer = /*#__PURE__*/styled.div.withConfig({
|
|
17
|
+
displayName: "TransactionListItem__StyledContainer",
|
|
18
|
+
componentId: "sc-7yunm0-0"
|
|
19
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n min-height: ", ";\n padding: ", " ", ";\n background-color: ", ";\n border-bottom: ", " solid ", ";\n gap: ", ";\n transition: background-color ", " ", ";\n \n /* A clickable row uses the shared row states (decision 0030) */\n ", "\n"], ["\n display: flex;\n align-items: center;\n min-height: ", ";\n padding: ", " ", ";\n background-color: ", ";\n border-bottom: ", " solid ", ";\n gap: ", ";\n transition: background-color ", " ", ";\n \n /* A clickable row uses the shared row states (decision 0030) */\n ", "\n"])), tokens.component.transactionListItem.minHeight, tokens.semantic.space[300], tokens.semantic.space[300], tokens.semantic.surface.base, tokens.semantic.border.width.thin, tokens.semantic.color.border["default"], tokens.semantic.space[300], tokens.semantic.motion.duration.moderate, tokens.semantic.motion.easing.decelerate, function (_a) {
|
|
20
|
+
var $clickable = _a.$clickable;
|
|
21
|
+
return $clickable && "\n cursor: pointer;\n ".concat(interactiveRow(), "\n \n &:focus-visible {\n outline: ").concat(tokens.semantic.border.focus, ";\n outline-offset: calc(-1 * ").concat(tokens.semantic.border.focusOffset, ");\n }\n ");
|
|
22
|
+
});
|
|
23
|
+
var StyledAvatarSection = /*#__PURE__*/styled.div.withConfig({
|
|
24
|
+
displayName: "TransactionListItem__StyledAvatarSection",
|
|
25
|
+
componentId: "sc-7yunm0-1"
|
|
26
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-shrink: 0;\n"], ["\n flex-shrink: 0;\n"])));
|
|
27
|
+
var StyledMainContent = /*#__PURE__*/styled.div.withConfig({
|
|
28
|
+
displayName: "TransactionListItem__StyledMainContent",
|
|
29
|
+
componentId: "sc-7yunm0-2"
|
|
30
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: none;\n"], ["\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: none;\n"])));
|
|
31
|
+
var StyledTopRow = /*#__PURE__*/styled.div.withConfig({
|
|
32
|
+
displayName: "TransactionListItem__StyledTopRow",
|
|
33
|
+
componentId: "sc-7yunm0-3"
|
|
34
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ", ";\n"])), tokens.semantic.space[200]);
|
|
35
|
+
var StyledMerchantSection = /*#__PURE__*/styled.div.withConfig({
|
|
36
|
+
displayName: "TransactionListItem__StyledMerchantSection",
|
|
37
|
+
componentId: "sc-7yunm0-4"
|
|
38
|
+
})(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", ";\n min-width: 0;\n flex: 1;\n"], ["\n display: flex;\n align-items: center;\n gap: ", ";\n min-width: 0;\n flex: 1;\n"])), tokens.semantic.space[200]);
|
|
39
|
+
var StyledBottomRow = /*#__PURE__*/styled.div.withConfig({
|
|
40
|
+
displayName: "TransactionListItem__StyledBottomRow",
|
|
41
|
+
componentId: "sc-7yunm0-5"
|
|
42
|
+
})(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ", ";\n"])), tokens.semantic.space[200]);
|
|
43
|
+
var StyledMetadata = /*#__PURE__*/styled.div.withConfig({
|
|
44
|
+
displayName: "TransactionListItem__StyledMetadata",
|
|
45
|
+
componentId: "sc-7yunm0-6"
|
|
46
|
+
})(templateObject_7 || (templateObject_7 = __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]);
|
|
47
|
+
var StyledIconIndicator = /*#__PURE__*/styled.div.withConfig({
|
|
48
|
+
displayName: "TransactionListItem__StyledIconIndicator",
|
|
49
|
+
componentId: "sc-7yunm0-7"
|
|
50
|
+
})(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", ";\n color: ", ";\n"], ["\n display: flex;\n align-items: center;\n gap: ", ";\n color: ", ";\n"])), tokens.semantic.space[100], tokens.semantic.color.icon.muted);
|
|
51
|
+
var StyledTruncatedText = /*#__PURE__*/styled.span.withConfig({
|
|
52
|
+
displayName: "TransactionListItem__StyledTruncatedText",
|
|
53
|
+
componentId: "sc-7yunm0-8"
|
|
54
|
+
})(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"], ["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"
|
|
55
|
+
// Map categories to CategoryLabel configurations
|
|
56
|
+
])));
|
|
57
|
+
// Map categories to CategoryLabel configurations
|
|
58
|
+
var categoryConfig = {
|
|
59
|
+
shopping: {
|
|
60
|
+
color: 'purple',
|
|
61
|
+
icon: 'paper',
|
|
62
|
+
label: 'Shopping'
|
|
63
|
+
},
|
|
64
|
+
dining: {
|
|
65
|
+
color: 'orange',
|
|
66
|
+
icon: 'paper',
|
|
67
|
+
label: 'Dining'
|
|
68
|
+
},
|
|
69
|
+
transport: {
|
|
70
|
+
color: 'blue',
|
|
71
|
+
icon: 'paper',
|
|
72
|
+
label: 'Transport'
|
|
73
|
+
},
|
|
74
|
+
entertainment: {
|
|
75
|
+
color: 'pink',
|
|
76
|
+
icon: 'star',
|
|
77
|
+
label: 'Entertainment'
|
|
78
|
+
},
|
|
79
|
+
bills: {
|
|
80
|
+
color: 'red',
|
|
81
|
+
icon: 'paper',
|
|
82
|
+
label: 'Bills'
|
|
83
|
+
},
|
|
84
|
+
other: {
|
|
85
|
+
color: 'gray',
|
|
86
|
+
icon: 'paper',
|
|
87
|
+
label: 'Other'
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
// Map status to badge variant
|
|
91
|
+
var statusToBadgeVariant = {
|
|
92
|
+
completed: 'success',
|
|
93
|
+
pending: 'warning',
|
|
94
|
+
failed: 'error'
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* TransactionListItem component
|
|
98
|
+
*
|
|
99
|
+
* Displays a single transaction in a list with merchant info, amount, date,
|
|
100
|
+
* status, and optional metadata (category, receipt, notes). Minimum height 72px
|
|
101
|
+
* with interactive states for clickable items.
|
|
102
|
+
*
|
|
103
|
+
* Composes: Avatar, Badge, MoneyDisplay, Icon, DateFormatter, Typography, Stack
|
|
104
|
+
*/
|
|
105
|
+
var TransactionListItem = function TransactionListItem(_a) {
|
|
106
|
+
var merchant = _a.merchant,
|
|
107
|
+
amount = _a.amount,
|
|
108
|
+
date = _a.date,
|
|
109
|
+
_b = _a.status,
|
|
110
|
+
status = _b === void 0 ? 'completed' : _b,
|
|
111
|
+
category = _a.category,
|
|
112
|
+
merchantLogo = _a.merchantLogo,
|
|
113
|
+
description = _a.description,
|
|
114
|
+
_c = _a.hasReceipt,
|
|
115
|
+
hasReceipt = _c === void 0 ? false : _c,
|
|
116
|
+
_d = _a.hasNote,
|
|
117
|
+
hasNote = _d === void 0 ? false : _d,
|
|
118
|
+
_e = _a.currency,
|
|
119
|
+
currency = _e === void 0 ? 'AUD' : _e,
|
|
120
|
+
onClick = _a.onClick,
|
|
121
|
+
dataTestId = _a["data-testid"];
|
|
122
|
+
var isClickable = !!onClick;
|
|
123
|
+
// Determine amount variant
|
|
124
|
+
var amountVariant = amount > 0 ? 'positive' : amount < 0 ? 'negative' : 'default';
|
|
125
|
+
// Get category configuration
|
|
126
|
+
var categoryData = category ? categoryConfig[category] : undefined;
|
|
127
|
+
// Get badge variant from status
|
|
128
|
+
var badgeVariant = statusToBadgeVariant[status];
|
|
129
|
+
var handleClick = function handleClick() {
|
|
130
|
+
if (isClickable && onClick) {
|
|
131
|
+
onClick();
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
135
|
+
if (isClickable && (e.key === 'Enter' || e.key === ' ')) {
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
return jsxs(StyledContainer, {
|
|
141
|
+
"$clickable": isClickable,
|
|
142
|
+
onClick: handleClick,
|
|
143
|
+
onKeyDown: handleKeyDown,
|
|
144
|
+
tabIndex: isClickable ? 0 : undefined,
|
|
145
|
+
role: isClickable ? 'button' : undefined,
|
|
146
|
+
"aria-label": isClickable ? "".concat(merchant, " transaction, ").concat(amount < 0 ? 'expense' : 'income', " of ").concat(Math.abs(amount)) : undefined,
|
|
147
|
+
"data-testid": dataTestId,
|
|
148
|
+
children: [jsx(StyledAvatarSection, {
|
|
149
|
+
children: status === 'pending' ? jsx(Badge, {
|
|
150
|
+
variant: badgeVariant,
|
|
151
|
+
dot: true,
|
|
152
|
+
"aria-label": "Pending transaction",
|
|
153
|
+
children: jsx(Avatar, {
|
|
154
|
+
name: merchant,
|
|
155
|
+
picture: merchantLogo,
|
|
156
|
+
size: "md"
|
|
157
|
+
})
|
|
158
|
+
}) : jsx(Avatar, {
|
|
159
|
+
name: merchant,
|
|
160
|
+
picture: merchantLogo,
|
|
161
|
+
size: "md"
|
|
162
|
+
})
|
|
163
|
+
}), jsxs(StyledMainContent, {
|
|
164
|
+
children: [jsxs(StyledTopRow, {
|
|
165
|
+
children: [jsxs(StyledMerchantSection, {
|
|
166
|
+
children: [jsx(StyledTruncatedText, {
|
|
167
|
+
children: jsx(Typography, {
|
|
168
|
+
variant: "body",
|
|
169
|
+
children: merchant
|
|
170
|
+
})
|
|
171
|
+
}), categoryData && jsx(CategoryLabel, {
|
|
172
|
+
color: categoryData.color,
|
|
173
|
+
icon: categoryData.icon,
|
|
174
|
+
size: "medium",
|
|
175
|
+
variant: "minimal",
|
|
176
|
+
"aria-label": "Category: ".concat(categoryData.label),
|
|
177
|
+
children: categoryData.label
|
|
178
|
+
}), status === 'failed' && jsx(Badge, {
|
|
179
|
+
variant: "error",
|
|
180
|
+
dot: true,
|
|
181
|
+
"aria-label": "Failed transaction",
|
|
182
|
+
children: jsx("span", {})
|
|
183
|
+
})]
|
|
184
|
+
}), jsx(MoneyDisplay, {
|
|
185
|
+
amount: amount,
|
|
186
|
+
currency: currency,
|
|
187
|
+
variant: amountVariant,
|
|
188
|
+
size: "medium",
|
|
189
|
+
weight: "medium",
|
|
190
|
+
showSign: true,
|
|
191
|
+
"data-testid": dataTestId ? "".concat(dataTestId, "-amount") : undefined
|
|
192
|
+
})]
|
|
193
|
+
}), jsxs(StyledBottomRow, {
|
|
194
|
+
children: [jsxs(StyledMetadata, {
|
|
195
|
+
children: [jsx(DateFormatter, {
|
|
196
|
+
dateString: typeof date === 'string' ? date : date.toISOString(),
|
|
197
|
+
mode: "smart",
|
|
198
|
+
"data-testid": dataTestId ? "".concat(dataTestId, "-date") : undefined
|
|
199
|
+
}), description && jsx(StyledTruncatedText, {
|
|
200
|
+
children: jsxs(Typography, {
|
|
201
|
+
variant: "small",
|
|
202
|
+
color: "subdued",
|
|
203
|
+
children: ["\u2022 ", description]
|
|
204
|
+
})
|
|
205
|
+
})]
|
|
206
|
+
}), (hasReceipt || hasNote) && jsxs(StyledIconIndicator, {
|
|
207
|
+
children: [hasReceipt && jsx(Icon, {
|
|
208
|
+
name: "fileDocSearch",
|
|
209
|
+
size: "xs",
|
|
210
|
+
"aria-label": "Has receipt"
|
|
211
|
+
}), hasNote && jsx(Icon, {
|
|
212
|
+
name: "paper",
|
|
213
|
+
size: "xs",
|
|
214
|
+
"aria-label": "Has note"
|
|
215
|
+
})]
|
|
216
|
+
})]
|
|
217
|
+
})]
|
|
218
|
+
})]
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
222
|
+
|
|
223
|
+
export { TransactionListItem };
|
|
224
|
+
//# sourceMappingURL=TransactionListItem.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransactionListItem.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from './AccountCard/index.mjs';
|
|
2
|
+
export * from './ActionSheet/index.mjs';
|
|
3
|
+
export * from './AgentInput/index.mjs';
|
|
4
|
+
export * from './Alert/index.mjs';
|
|
5
|
+
export * from './InlineAlert/index.mjs';
|
|
6
|
+
export * from './Breadcrumbs/index.mjs';
|
|
7
|
+
export * from './CardSmall/index.mjs';
|
|
8
|
+
export * from './CardLarge/index.mjs';
|
|
9
|
+
export * from './Checkbox/index.mjs';
|
|
10
|
+
export * from './ChipGroup/index.mjs';
|
|
11
|
+
export * from './CodeBlock/index.mjs';
|
|
12
|
+
export * from './DateGroup/index.mjs';
|
|
13
|
+
export * from './EmptyState/index.mjs';
|
|
14
|
+
export * from './FeatureBlock/index.mjs';
|
|
15
|
+
export * from './Dropdown/index.mjs';
|
|
16
|
+
export * from './List/index.mjs';
|
|
17
|
+
export * from './Modal/index.mjs';
|
|
18
|
+
export * from './NumberInput/index.mjs';
|
|
19
|
+
export * from './PageTitle/index.mjs';
|
|
20
|
+
export * from './PasswordField/index.mjs';
|
|
21
|
+
export * from './SearchField/index.mjs';
|
|
22
|
+
export * from './Sheet/index.mjs';
|
|
23
|
+
export * from './Slider/index.mjs';
|
|
24
|
+
export * from './TabBar/index.mjs';
|
|
25
|
+
export * from './TextField/index.mjs';
|
|
26
|
+
export * from './TransactionListItem/index.mjs';
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export * from './components/index.mjs';
|
|
2
|
+
export { tokens, type Tokens, type TokensBase, type TokensSemantic, type TokensComponent, } from './types/tokens.mjs';
|
|
3
|
+
export { iconsData, type IconName, type IconCategory, type IconMetadata, type IconRegistry, } from './types/icons.mjs';
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export { Avatar } from './components/atoms/Avatar/Avatar.mjs';
|
|
2
|
+
export { Badge } from './components/atoms/Badge/Badge.mjs';
|
|
3
|
+
export { Box } from './components/atoms/Box/Box.mjs';
|
|
4
|
+
export { Button } from './components/atoms/Button/Button.mjs';
|
|
5
|
+
export { CategoryBadge } from './components/atoms/CategoryBadge/CategoryBadge.mjs';
|
|
6
|
+
export { CategoryLabel } from './components/atoms/CategoryLabel/CategoryLabel.mjs';
|
|
7
|
+
export { Chip, LegacyChip } from './components/atoms/Chip/Chip.mjs';
|
|
8
|
+
export { InputChip } from './components/atoms/Chip/InputChip.mjs';
|
|
9
|
+
export { FilterChip } from './components/atoms/Chip/FilterChip.mjs';
|
|
10
|
+
export { BooleanChip } from './components/atoms/Chip/BooleanChip.mjs';
|
|
11
|
+
export { Container } from './components/atoms/Container/Container.mjs';
|
|
12
|
+
export { Picture } from './components/atoms/Picture/Picture.mjs';
|
|
13
|
+
export { DateFormatter } from './components/atoms/DateFormatter/DateFormatter.mjs';
|
|
14
|
+
export { Icon } from './components/atoms/Icon/Icon.mjs';
|
|
15
|
+
export { IconButton } from './components/atoms/IconButton/IconButton.mjs';
|
|
16
|
+
export { MoneyDisplay } from './components/atoms/MoneyDisplay/MoneyDisplay.mjs';
|
|
17
|
+
export { ProgressBar } from './components/atoms/ProgressBar/ProgressBar.mjs';
|
|
18
|
+
export { Divider } from './components/atoms/Divider/Divider.mjs';
|
|
19
|
+
export { Stack } from './components/atoms/Stack/Stack.mjs';
|
|
20
|
+
export { StatusBadge } from './components/atoms/StatusBadge/StatusBadge.mjs';
|
|
21
|
+
export { StatusLabel } from './components/atoms/StatusLabel/StatusLabel.mjs';
|
|
22
|
+
export { Tag } from './components/atoms/Tag/Tag.mjs';
|
|
23
|
+
export { Typography } from './components/atoms/Typography/Typography.mjs';
|
|
24
|
+
export { AccountCard } from './components/molecules/AccountCard/AccountCard.mjs';
|
|
25
|
+
export { ActionSheet } from './components/molecules/ActionSheet/ActionSheet.mjs';
|
|
26
|
+
export { AgentInput } from './components/molecules/AgentInput/AgentInput.mjs';
|
|
27
|
+
export { Alert } from './components/molecules/Alert/Alert.mjs';
|
|
28
|
+
export { InlineAlert } from './components/molecules/InlineAlert/InlineAlert.mjs';
|
|
29
|
+
export { Breadcrumbs } from './components/molecules/Breadcrumbs/Breadcrumbs.mjs';
|
|
30
|
+
export { CardSmall } from './components/molecules/CardSmall/CardSmall.mjs';
|
|
31
|
+
export { CardLarge } from './components/molecules/CardLarge/CardLarge.mjs';
|
|
32
|
+
export { Checkbox } from './components/molecules/Checkbox/Checkbox.mjs';
|
|
33
|
+
export { ChipGroup } from './components/molecules/ChipGroup/ChipGroup.mjs';
|
|
34
|
+
export { CodeBlock } from './components/molecules/CodeBlock/CodeBlock.mjs';
|
|
35
|
+
export { DateGroup } from './components/molecules/DateGroup/DateGroup.mjs';
|
|
36
|
+
export { EmptyState } from './components/molecules/EmptyState/EmptyState.mjs';
|
|
37
|
+
export { FeatureBlock } from './components/molecules/FeatureBlock/FeatureBlock.mjs';
|
|
38
|
+
export { Dropdown } from './components/molecules/Dropdown/Dropdown.mjs';
|
|
39
|
+
export { List } from './components/molecules/List/List.mjs';
|
|
40
|
+
export { ListItem } from './components/molecules/List/ListItem.mjs';
|
|
41
|
+
export { Modal } from './components/molecules/Modal/Modal.mjs';
|
|
42
|
+
export { NumberInput } from './components/molecules/NumberInput/NumberInput.mjs';
|
|
43
|
+
export { PageTitle } from './components/molecules/PageTitle/PageTitle.mjs';
|
|
44
|
+
export { PasswordField } from './components/molecules/PasswordField/PasswordField.mjs';
|
|
45
|
+
export { SearchField } from './components/molecules/SearchField/SearchField.mjs';
|
|
46
|
+
export { Sheet } from './components/molecules/Sheet/Sheet.mjs';
|
|
47
|
+
export { Slider } from './components/molecules/Slider/Slider.mjs';
|
|
48
|
+
export { TabBar } from './components/molecules/TabBar/TabBar.mjs';
|
|
49
|
+
export { TextField } from './components/molecules/TextField/TextField.mjs';
|
|
50
|
+
export { StyledInputBase, StyledTextAreaBase } from './components/molecules/TextField/InputBase.mjs';
|
|
51
|
+
export { TransactionListItem } from './components/molecules/TransactionListItem/TransactionListItem.mjs';
|
|
52
|
+
export { Grid, GridCol, ResponsiveGrid } from './components/layout/GridSystem/GridSystem.mjs';
|
|
53
|
+
export { tokens } from './types/tokens.mjs';
|
|
54
|
+
export { iconsData } from './types/icons.mjs';
|
|
55
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Tokens } from '../styles/tokens.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* The tokens as components read them (decision 0041): the same shape and type as `tokens.json`,
|
|
4
|
+
* with every value a CSS variable that falls back to the resolved value, so a region can change a
|
|
5
|
+
* token through tokens.css. Breakpoints stay values.
|
|
6
|
+
*
|
|
7
|
+
* Use the resolved values from `tokens.json` instead where a value is read as data rather than
|
|
8
|
+
* CSS, such as a duration parsed for a timer.
|
|
9
|
+
*
|
|
10
|
+
* Jest maps this module to `tokens.json` (jest.config.js), so unit tests assert resolved values;
|
|
11
|
+
* the browser specs check the variables.
|
|
12
|
+
*/
|
|
13
|
+
declare const tokens: Tokens;
|
|
14
|
+
export default tokens;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import tokensJson from '../styles/tokens.json.mjs';
|
|
3
|
+
import { withCssVariables } from './cssVariables.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The tokens as components read them (decision 0041): the same shape and type as `tokens.json`,
|
|
7
|
+
* with every value a CSS variable that falls back to the resolved value, so a region can change a
|
|
8
|
+
* token through tokens.css. Breakpoints stay values.
|
|
9
|
+
*
|
|
10
|
+
* Use the resolved values from `tokens.json` instead where a value is read as data rather than
|
|
11
|
+
* CSS, such as a duration parsed for a timer.
|
|
12
|
+
*
|
|
13
|
+
* Jest maps this module to `tokens.json` (jest.config.js), so unit tests assert resolved values;
|
|
14
|
+
* the browser specs check the variables.
|
|
15
|
+
*/
|
|
16
|
+
var tokens = withCssVariables(tokensJson);
|
|
17
|
+
|
|
18
|
+
export { tokens as default };
|
|
19
|
+
//# sourceMappingURL=cssTokens.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssTokens.mjs","sources":["../../src/lib/cssTokens.ts"],"sourcesContent":["import tokensJson from '../styles/tokens.json'\nimport type { Tokens } from '../styles/tokens'\nimport { withCssVariables } from './cssVariables'\n\n/**\n * The tokens as components read them (decision 0041): the same shape and type as `tokens.json`,\n * with every value a CSS variable that falls back to the resolved value, so a region can change a\n * token through tokens.css. Breakpoints stay values.\n *\n * Use the resolved values from `tokens.json` instead where a value is read as data rather than\n * CSS, such as a duration parsed for a timer.\n *\n * Jest maps this module to `tokens.json` (jest.config.js), so unit tests assert resolved values;\n * the browser specs check the variables.\n */\nconst tokens: Tokens = withCssVariables(tokensJson as Tokens)\n\nexport default tokens\n"],"names":["tokens","withCssVariables","tokensJson"],"mappings":";;;;AAIA;;;;;;;;;;AAUG;AACH,IAAMA,MAAM,GAAWC,gBAAgB,CAACC,UAAoB;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CSS variable tokens.css declares for a token path: Style Dictionary's `name/kebab` with the
|
|
3
|
+
* `co` prefix. `semantic.color.text.default` is `--co-semantic-color-text-default`, and
|
|
4
|
+
* `semantic.border.focusOffset` is `--co-semantic-border-focus-offset`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function cssVariableName(path: string[]): string;
|
|
7
|
+
type Tree = {
|
|
8
|
+
[key: string]: string | Tree;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A copy of a token tree with the same shape, where every value reads its CSS variable and falls
|
|
12
|
+
* back to the resolved value: `var(--co-semantic-color-text-default, #212529)`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function withCssVariables<T extends Tree>(tree: T, path?: string[]): T;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __spreadArray } from '../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
|
|
4
|
+
// Components read tokens as CSS variables, with the resolved value as the fallback (decision 0041).
|
|
5
|
+
// A product that loads tokens.css can change a token for a region (a density or motion mode, a
|
|
6
|
+
// theme); one that doesn't renders exactly the resolved values.
|
|
7
|
+
/**
|
|
8
|
+
* The CSS variable tokens.css declares for a token path: Style Dictionary's `name/kebab` with the
|
|
9
|
+
* `co` prefix. `semantic.color.text.default` is `--co-semantic-color-text-default`, and
|
|
10
|
+
* `semantic.border.focusOffset` is `--co-semantic-border-focus-offset`.
|
|
11
|
+
*/
|
|
12
|
+
function cssVariableName(path) {
|
|
13
|
+
return "--".concat(__spreadArray(['co'], path, true).join('-').replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase());
|
|
14
|
+
}
|
|
15
|
+
/** Breakpoints stay values: a CSS variable can't be used in a media query */
|
|
16
|
+
var keepsValue = function keepsValue(path) {
|
|
17
|
+
return path[1] === 'breakpoint';
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A copy of a token tree with the same shape, where every value reads its CSS variable and falls
|
|
21
|
+
* back to the resolved value: `var(--co-semantic-color-text-default, #212529)`.
|
|
22
|
+
*/
|
|
23
|
+
function withCssVariables(tree, path) {
|
|
24
|
+
if (path === void 0) {
|
|
25
|
+
path = [];
|
|
26
|
+
}
|
|
27
|
+
return Object.fromEntries(Object.entries(tree).map(function (_a) {
|
|
28
|
+
var key = _a[0],
|
|
29
|
+
value = _a[1];
|
|
30
|
+
var at = __spreadArray(__spreadArray([], path, true), [key], false);
|
|
31
|
+
if (typeof value !== 'string') return [key, withCssVariables(value, at)];
|
|
32
|
+
return [key, keepsValue(at) ? value : "var(".concat(cssVariableName(at), ", ").concat(value, ")")];
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { cssVariableName, withCssVariables };
|
|
37
|
+
//# sourceMappingURL=cssVariables.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssVariables.mjs","sources":["../../src/lib/cssVariables.ts"],"sourcesContent":["// Components read tokens as CSS variables, with the resolved value as the fallback (decision 0041).\n// A product that loads tokens.css can change a token for a region (a density or motion mode, a\n// theme); one that doesn't renders exactly the resolved values.\n\n/**\n * The CSS variable tokens.css declares for a token path: Style Dictionary's `name/kebab` with the\n * `co` prefix. `semantic.color.text.default` is `--co-semantic-color-text-default`, and\n * `semantic.border.focusOffset` is `--co-semantic-border-focus-offset`.\n */\nexport function cssVariableName(path: string[]): string {\n return `--${['co', ...path]\n .join('-')\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase()}`\n}\n\n/** Breakpoints stay values: a CSS variable can't be used in a media query */\nconst keepsValue = (path: string[]) => path[1] === 'breakpoint'\n\ntype Tree = { [key: string]: string | Tree }\n\n/**\n * A copy of a token tree with the same shape, where every value reads its CSS variable and falls\n * back to the resolved value: `var(--co-semantic-color-text-default, #212529)`.\n */\nexport function withCssVariables<T extends Tree>(tree: T, path: string[] = []): T {\n return Object.fromEntries(\n Object.entries(tree).map(([key, value]) => {\n const at = [...path, key]\n if (typeof value !== 'string') return [key, withCssVariables(value, at)]\n return [key, keepsValue(at) ? value : `var(${cssVariableName(at)}, ${value})`]\n })\n ) as T\n}\n"],"names":["cssVariableName","path","concat","__spreadArray","join","replace","toLowerCase","keepsValue","withCssVariables","tree","Object","fromEntries","entries","map","_a","key","value","at"],"mappings":";;;AAAA;AACA;AACA;AAEA;;;;AAIG;AACG,SAAUA,eAAeA,CAACC,IAAc,EAAA;AAC5C,EAAA,OAAO,IAAA,CAAAC,MAAA,CAAKC,eAAC,IAAI,CAAA,EAAKF,IAAI,EACvB,IAAA,CAAA,CAAAG,IAAI,CAAC,GAAG,CAAC,CACTC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CACnCC,WAAW,EAAE,CAAE,CAAA;AACpB,CAAA;AAEA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIN,IAAc;AAAK,EAAA,OAAAA,IAAI,CAAC,CAAC,CAAC,KAAK,YAAY,CAAA;AAAxB,CAAwB,CAAA;AAI/D;;;AAGG;AACa,SAAAO,gBAAgBA,CAAiBC,IAAO,EAAER,IAAmB,EAAA;AAAnB,EAAA,IAAAA,IAAA,KAAA,KAAA,CAAA,EAAA;AAAAA,IAAAA,IAAmB,GAAA,EAAA,CAAA;AAAA,GAAA;AAC3E,EAAA,OAAOS,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACH,IAAI,CAAC,CAACI,GAAG,CAAC,UAACC,EAAY,EAAA;QAAXC,GAAG,GAAAD,EAAA,CAAA,CAAA,CAAA;AAAEE,MAAAA,KAAK,GAAAF,EAAA,CAAA,CAAA,CAAA,CAAA;AACnC,IAAA,IAAMG,EAAE,GAAOd,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAAF,IAAI,EAAE,IAAA,CAAA,EAAA,CAAAc,GAAG,SAAC,CAAA;AACzB,IAAA,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE,OAAO,CAACD,GAAG,EAAEP,gBAAgB,CAACQ,KAAK,EAAEC,EAAE,CAAC,CAAC,CAAA;AACxE,IAAA,OAAO,CAACF,GAAG,EAAER,UAAU,CAACU,EAAE,CAAC,GAAGD,KAAK,GAAG,MAAO,CAAAd,MAAA,CAAAF,eAAe,CAACiB,EAAE,CAAC,EAAK,IAAA,CAAA,CAAAf,MAAA,CAAAc,KAAK,EAAG,GAAA,CAAA,CAAC,CAAA;AAChF,GAAC,CAAC,CACE,CAAA;AACR;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const breakpoints: {
|
|
2
|
+
xs: string;
|
|
3
|
+
sm: string;
|
|
4
|
+
md: string;
|
|
5
|
+
lg: string;
|
|
6
|
+
xl: string;
|
|
7
|
+
'2xl': string;
|
|
8
|
+
};
|
|
9
|
+
export declare const media: {
|
|
10
|
+
xs: string;
|
|
11
|
+
sm: string;
|
|
12
|
+
md: string;
|
|
13
|
+
lg: string;
|
|
14
|
+
xl: string;
|
|
15
|
+
'2xl': string;
|
|
16
|
+
};
|
|
17
|
+
export declare const forcedColors = "@media (forced-colors: active)";
|
|
18
|
+
/** A control's edge in forced colours, for a control that shows its edge with a fill alone. The
|
|
19
|
+
* border follows the text colour the browser picks: ButtonText, LinkText, or GrayText when disabled. */
|
|
20
|
+
export declare const forcedColorsEdge: string;
|
|
21
|
+
export declare const reducedMotion = "@media (prefers-reduced-motion: reduce)";
|
|
22
|
+
export declare const exitAnimation: import("styled-components").RuleSet<object>;
|
|
23
|
+
export declare const visuallyHidden: import("styled-components").RuleSet<object>;
|
|
24
|
+
export interface RowState {
|
|
25
|
+
background: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const rowStates: Record<'unselected' | 'selected', Record<'rest' | 'hover' | 'pressed', RowState>>;
|
|
29
|
+
/**
|
|
30
|
+
* The background (and, when selected, text) of an interactive row in every state.
|
|
31
|
+
* - `focused`: keyboard focus that isn't DOM focus, such as a listbox option under
|
|
32
|
+
* aria-activedescendant. It shows the hover state.
|
|
33
|
+
* - `disabled`: shows the resting state, with no hover or press.
|
|
34
|
+
* - `textSelector`: a descendant to colour when the row's text isn't the row itself, for example
|
|
35
|
+
* text set by Typography. Pass it without `&`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const interactiveRow: ({ selected, focused, disabled, textSelector, }?: {
|
|
38
|
+
selected?: boolean;
|
|
39
|
+
focused?: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
textSelector?: string;
|
|
42
|
+
}) => string;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { keyframes, css } from 'styled-components';
|
|
4
|
+
import tokens from './cssTokens.mjs';
|
|
5
|
+
|
|
6
|
+
// Breakpoints from the semantic tokens (decision 0014)
|
|
7
|
+
var breakpoints = {
|
|
8
|
+
xs: tokens.semantic.breakpoint.xs,
|
|
9
|
+
sm: tokens.semantic.breakpoint.sm,
|
|
10
|
+
md: tokens.semantic.breakpoint.md,
|
|
11
|
+
lg: tokens.semantic.breakpoint.lg,
|
|
12
|
+
xl: tokens.semantic.breakpoint.xl,
|
|
13
|
+
'2xl': tokens.semantic.breakpoint['2xl']
|
|
14
|
+
};
|
|
15
|
+
// Media query helpers
|
|
16
|
+
var media = {
|
|
17
|
+
xs: "@media (min-width: ".concat(breakpoints.xs, ")"),
|
|
18
|
+
sm: "@media (min-width: ".concat(breakpoints.sm, ")"),
|
|
19
|
+
md: "@media (min-width: ".concat(breakpoints.md, ")"),
|
|
20
|
+
lg: "@media (min-width: ".concat(breakpoints.lg, ")"),
|
|
21
|
+
xl: "@media (min-width: ".concat(breakpoints.xl, ")"),
|
|
22
|
+
'2xl': "@media (min-width: ".concat(breakpoints['2xl'], ")")
|
|
23
|
+
};
|
|
24
|
+
// Windows Contrast Themes and other forced-colours modes (decision 0038). The browser swaps in
|
|
25
|
+
// the user's system colours, drops background colours and box-shadows, and keeps borders and
|
|
26
|
+
// outlines. Inside this query, give a control that shows its edge with a fill alone a border,
|
|
27
|
+
// and draw selected and checked states with system colours: ButtonText for control edges,
|
|
28
|
+
// Highlight and HighlightText for selected and checked, GrayText for disabled, CanvasText for
|
|
29
|
+
// content. Use forced-color-adjust: none only on a fill that carries state.
|
|
30
|
+
var forcedColors = '@media (forced-colors: active)';
|
|
31
|
+
/** A control's edge in forced colours, for a control that shows its edge with a fill alone. The
|
|
32
|
+
* border follows the text colour the browser picks: ButtonText, LinkText, or GrayText when disabled. */
|
|
33
|
+
var forcedColorsEdge = "".concat(forcedColors, " {\n border: ").concat(tokens.semantic.border.width.thin, " solid currentColor;\n}");
|
|
34
|
+
// Wrap fallbacks for people who ask for less motion (decision 0005): movement becomes
|
|
35
|
+
// an instant change or a simple fade. Colour and opacity transitions need no fallback.
|
|
36
|
+
var reducedMotion = '@media (prefers-reduced-motion: reduce)';
|
|
37
|
+
// No `from` keyframe: the fade starts from the element's current opacity, including a
|
|
38
|
+
// still-running entrance, so closing mid-entrance doesn't jump back to fully visible.
|
|
39
|
+
var fadeOut = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n to { opacity: 0; }\n"], ["\n to { opacity: 0; }\n"
|
|
40
|
+
// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of
|
|
41
|
+
// the element's `animation` declarations while it exits: the entrance stays in the list,
|
|
42
|
+
// so it isn't restarted, and the fade runs on top of it. A fade is already the
|
|
43
|
+
// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop
|
|
44
|
+
// still catches clicks (so they can't reach the page behind it) and the panel is inert.
|
|
45
|
+
// Exits accelerate: things leaving speed up as they go (decision 0037).
|
|
46
|
+
])));
|
|
47
|
+
// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of
|
|
48
|
+
// the element's `animation` declarations while it exits: the entrance stays in the list,
|
|
49
|
+
// so it isn't restarted, and the fade runs on top of it. A fade is already the
|
|
50
|
+
// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop
|
|
51
|
+
// still catches clicks (so they can't reach the page behind it) and the panel is inert.
|
|
52
|
+
// Exits accelerate: things leaving speed up as they go (decision 0037).
|
|
53
|
+
var exitAnimation = css(templateObject_2 || (templateObject_2 = __makeTemplateObject([", ", " ", " ", " forwards"], [", ", " ", " ", " forwards"
|
|
54
|
+
// Content for screen readers only. The 1px size and -1px margin are part of the standard
|
|
55
|
+
// visually-hidden technique, not design values, so they aren't tokens.
|
|
56
|
+
])), fadeOut, tokens.semantic.motion.duration.fast, tokens.semantic.motion.easing.accelerate);
|
|
57
|
+
// Content for screen readers only. The 1px size and -1px margin are part of the standard
|
|
58
|
+
// visually-hidden technique, not design values, so they aren't tokens.
|
|
59
|
+
var visuallyHidden = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n"], ["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n"
|
|
60
|
+
// One interaction pattern for rows and items: list items, menu and listbox options, sidebars
|
|
61
|
+
// (decision 0030). Unselected rows follow the naked Button's ladder; selected rows follow the
|
|
62
|
+
// light-blue selected ladder, with the text darkening with its fill (decision 0016). Unselected
|
|
63
|
+
// rows leave their text colour to the component, so a destructive row can stay red.
|
|
64
|
+
])));
|
|
65
|
+
// One interaction pattern for rows and items: list items, menu and listbox options, sidebars
|
|
66
|
+
// (decision 0030). Unselected rows follow the naked Button's ladder; selected rows follow the
|
|
67
|
+
// light-blue selected ladder, with the text darkening with its fill (decision 0016). Unselected
|
|
68
|
+
// rows leave their text colour to the component, so a destructive row can stay red.
|
|
69
|
+
var _a = tokens.semantic.color,
|
|
70
|
+
rowFill = _a.fill,
|
|
71
|
+
rowText = _a.text;
|
|
72
|
+
var rowStates = {
|
|
73
|
+
unselected: {
|
|
74
|
+
rest: {
|
|
75
|
+
background: 'transparent'
|
|
76
|
+
},
|
|
77
|
+
hover: {
|
|
78
|
+
background: rowFill.muted
|
|
79
|
+
},
|
|
80
|
+
pressed: {
|
|
81
|
+
background: rowFill["default"]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
selected: {
|
|
85
|
+
rest: {
|
|
86
|
+
background: rowFill['accent-muted'],
|
|
87
|
+
text: rowText.accent
|
|
88
|
+
},
|
|
89
|
+
hover: {
|
|
90
|
+
background: rowFill['accent-muted-hover'],
|
|
91
|
+
text: rowText['accent-hover']
|
|
92
|
+
},
|
|
93
|
+
pressed: {
|
|
94
|
+
background: rowFill['accent-muted-pressed'],
|
|
95
|
+
text: rowText['accent-pressed']
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var rowDeclarations = function rowDeclarations(_a, textSelector) {
|
|
100
|
+
var background = _a.background,
|
|
101
|
+
text = _a.text;
|
|
102
|
+
if (!text) return "background-color: ".concat(background, ";");
|
|
103
|
+
return textSelector ? "background-color: ".concat(background, ";\n ").concat(textSelector, " { color: ").concat(text, "; }") : "background-color: ".concat(background, ";\n color: ").concat(text, ";");
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The background (and, when selected, text) of an interactive row in every state.
|
|
107
|
+
* - `focused`: keyboard focus that isn't DOM focus, such as a listbox option under
|
|
108
|
+
* aria-activedescendant. It shows the hover state.
|
|
109
|
+
* - `disabled`: shows the resting state, with no hover or press.
|
|
110
|
+
* - `textSelector`: a descendant to colour when the row's text isn't the row itself, for example
|
|
111
|
+
* text set by Typography. Pass it without `&`.
|
|
112
|
+
*/
|
|
113
|
+
var interactiveRow = function interactiveRow(_a) {
|
|
114
|
+
var _b = _a === void 0 ? {} : _a,
|
|
115
|
+
_c = _b.selected,
|
|
116
|
+
selected = _c === void 0 ? false : _c,
|
|
117
|
+
_d = _b.focused,
|
|
118
|
+
focused = _d === void 0 ? false : _d,
|
|
119
|
+
_e = _b.disabled,
|
|
120
|
+
disabled = _e === void 0 ? false : _e,
|
|
121
|
+
textSelector = _b.textSelector;
|
|
122
|
+
var states = selected ? rowStates.selected : rowStates.unselected;
|
|
123
|
+
if (disabled) return "".concat(rowDeclarations(states.rest, textSelector), "\n").concat(rowForcedColors({
|
|
124
|
+
selected: selected,
|
|
125
|
+
focused: focused,
|
|
126
|
+
disabled: disabled,
|
|
127
|
+
textSelector: textSelector
|
|
128
|
+
}));
|
|
129
|
+
return "\n ".concat(rowDeclarations(focused ? states.hover : states.rest, textSelector), "\n\n &:hover {\n ").concat(rowDeclarations(states.hover, textSelector), "\n }\n\n &:active {\n ").concat(rowDeclarations(states.pressed, textSelector), "\n }\n\n ").concat(rowForcedColors({
|
|
130
|
+
selected: selected,
|
|
131
|
+
focused: focused,
|
|
132
|
+
disabled: disabled,
|
|
133
|
+
textSelector: textSelector
|
|
134
|
+
}), "\n");
|
|
135
|
+
};
|
|
136
|
+
// Rows in forced colours (decision 0038): fills are dropped, so a selected row takes the system
|
|
137
|
+
// selection colours, and a hovered or keyboard-active row is outlined in Highlight.
|
|
138
|
+
var rowForcedColors = function rowForcedColors(_a) {
|
|
139
|
+
var selected = _a.selected,
|
|
140
|
+
focused = _a.focused,
|
|
141
|
+
disabled = _a.disabled,
|
|
142
|
+
textSelector = _a.textSelector;
|
|
143
|
+
var text = function text(color) {
|
|
144
|
+
return textSelector ? "color: ".concat(color, ";\n ").concat(textSelector, " { color: ").concat(color, "; }") : "color: ".concat(color, ";");
|
|
145
|
+
};
|
|
146
|
+
var hover = "outline: ".concat(tokens.semantic.border.width.thin, " solid Highlight;\n outline-offset: calc(-1 * ").concat(tokens.semantic.border.width.thin, ");");
|
|
147
|
+
// A row that doesn't respond (disabled, or not interactive at all) keeps its selection but has
|
|
148
|
+
// no hover outline. Disabled text is the component's to colour: callers also pass this for
|
|
149
|
+
// static rows, which must stay CanvasText.
|
|
150
|
+
// A selected row keeps forced-color-adjust: auto: the browser keeps system colours an author
|
|
151
|
+
// sets, so the row stays Highlight with HighlightText. Its descendants' own colours would be
|
|
152
|
+
// forced to CanvasText, so they inherit HighlightText, and anything drawn with a fill inside
|
|
153
|
+
// (a chip or tag as the row's badge) drops it and keeps its edge. The doubled class outranks
|
|
154
|
+
// the descendants' own rules.
|
|
155
|
+
return "".concat(forcedColors, " {\n ").concat(selected ? "background-color: Highlight;\n ".concat(text('HighlightText'), "\n && * {\n color: inherit;\n background-color: transparent;\n }") : '', "\n ").concat(!disabled && focused ? hover : '', "\n ").concat(disabled ? '' : "&:hover {\n ".concat(hover, "\n }"), "\n }");
|
|
156
|
+
};
|
|
157
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
158
|
+
|
|
159
|
+
export { breakpoints, exitAnimation, forcedColors, forcedColorsEdge, interactiveRow, media, reducedMotion, rowStates, visuallyHidden };
|
|
160
|
+
//# sourceMappingURL=styleUtils.mjs.map
|