@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,126 @@
|
|
|
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 { Typography } from '../Typography/Typography.mjs';
|
|
7
|
+
import { Icon } from '../Icon/Icon.mjs';
|
|
8
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
9
|
+
|
|
10
|
+
var StyledWrapper = /*#__PURE__*/styled.span.withConfig({
|
|
11
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
12
|
+
return !prop.startsWith('$');
|
|
13
|
+
},
|
|
14
|
+
displayName: "MoneyDisplay__StyledWrapper",
|
|
15
|
+
componentId: "sc-1mddej3-0"
|
|
16
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n text-align: ", ";\n font-weight: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n text-align: ", ";\n font-weight: ", ";\n"
|
|
17
|
+
// Map size to Typography variant
|
|
18
|
+
])), function (_a) {
|
|
19
|
+
var $align = _a.$align;
|
|
20
|
+
return $align;
|
|
21
|
+
}, function (_a) {
|
|
22
|
+
var $weight = _a.$weight;
|
|
23
|
+
return tokens.semantic.fontWeight[$weight];
|
|
24
|
+
});
|
|
25
|
+
// Map size to Typography variant
|
|
26
|
+
var sizeToTypographyVariant = {
|
|
27
|
+
small: 'caption',
|
|
28
|
+
medium: 'body',
|
|
29
|
+
large: 'h3',
|
|
30
|
+
xlarge: 'h2'
|
|
31
|
+
};
|
|
32
|
+
// Map size to Icon size for consistent visual alignment
|
|
33
|
+
var sizeToIconSize = {
|
|
34
|
+
small: 'xs',
|
|
35
|
+
medium: 'sm',
|
|
36
|
+
large: 'md',
|
|
37
|
+
xlarge: 'lg'
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Generates aria-label with spelled out amount
|
|
41
|
+
*/
|
|
42
|
+
var generateAriaLabel = function generateAriaLabel(amount, currency, locale) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
var formatter = new Intl.NumberFormat(locale, {
|
|
45
|
+
style: 'currency',
|
|
46
|
+
currency: currency,
|
|
47
|
+
minimumFractionDigits: 2,
|
|
48
|
+
maximumFractionDigits: 2
|
|
49
|
+
});
|
|
50
|
+
// Get parts to spell out the amount
|
|
51
|
+
var parts = formatter.formatToParts(Math.abs(amount));
|
|
52
|
+
var integerPart = ((_a = parts.find(function (p) {
|
|
53
|
+
return p.type === 'integer';
|
|
54
|
+
})) === null || _a === void 0 ? void 0 : _a.value) || '0';
|
|
55
|
+
var fractionPart = ((_b = parts.find(function (p) {
|
|
56
|
+
return p.type === 'fraction';
|
|
57
|
+
})) === null || _b === void 0 ? void 0 : _b.value) || '00';
|
|
58
|
+
var sign = amount < 0 ? 'negative ' : '';
|
|
59
|
+
return "".concat(sign).concat(integerPart, " dollars and ").concat(fractionPart, " cents");
|
|
60
|
+
};
|
|
61
|
+
var MoneyDisplay = function MoneyDisplay(_a) {
|
|
62
|
+
var amount = _a.amount,
|
|
63
|
+
_b = _a.currency,
|
|
64
|
+
currency = _b === void 0 ? 'AUD' : _b,
|
|
65
|
+
_c = _a.variant,
|
|
66
|
+
variant = _c === void 0 ? 'default' : _c,
|
|
67
|
+
_d = _a.showSign,
|
|
68
|
+
showSign = _d === void 0 ? false : _d,
|
|
69
|
+
_e = _a.size,
|
|
70
|
+
size = _e === void 0 ? 'medium' : _e,
|
|
71
|
+
_f = _a.weight,
|
|
72
|
+
weight = _f === void 0 ? 'regular' : _f,
|
|
73
|
+
_g = _a.locale,
|
|
74
|
+
locale = _g === void 0 ? 'en-AU' : _g,
|
|
75
|
+
_h = _a.align,
|
|
76
|
+
align = _h === void 0 ? 'left' : _h,
|
|
77
|
+
dataTestId = _a["data-testid"];
|
|
78
|
+
// Format the number with Intl.NumberFormat
|
|
79
|
+
var formatter = new Intl.NumberFormat(locale, {
|
|
80
|
+
style: 'currency',
|
|
81
|
+
currency: currency,
|
|
82
|
+
minimumFractionDigits: 2,
|
|
83
|
+
maximumFractionDigits: 2
|
|
84
|
+
});
|
|
85
|
+
var formattedAmount = formatter.format(Math.abs(amount));
|
|
86
|
+
// Determine if we need to show a sign icon
|
|
87
|
+
var showPositiveIcon = showSign && amount > 0 || variant === 'positive';
|
|
88
|
+
var showNegativeIcon = amount < 0 || variant === 'negative';
|
|
89
|
+
// Generate accessibility label
|
|
90
|
+
var ariaLabel = generateAriaLabel(amount, currency, locale);
|
|
91
|
+
// Get typography variant and icon size
|
|
92
|
+
var typographyVariant = sizeToTypographyVariant[size];
|
|
93
|
+
var iconSize = sizeToIconSize[size];
|
|
94
|
+
// Determine icon color based on variant
|
|
95
|
+
var iconColor = variant === 'positive' || showPositiveIcon ? 'success' : variant === 'negative' || showNegativeIcon ? 'error' : variant === 'neutral' ? 'subdued' : 'default';
|
|
96
|
+
// Amount always uses default color (except neutral which stays subdued)
|
|
97
|
+
var amountColor = variant === 'neutral' ? 'subdued' : 'default';
|
|
98
|
+
return jsxs(StyledWrapper, {
|
|
99
|
+
"$align": align,
|
|
100
|
+
"$weight": weight,
|
|
101
|
+
"aria-label": ariaLabel,
|
|
102
|
+
"data-testid": dataTestId,
|
|
103
|
+
children: [showPositiveIcon && !showNegativeIcon &&
|
|
104
|
+
// The amount is shown without a sign, so the icon is the sign and needs a name (#85)
|
|
105
|
+
jsx(Icon, {
|
|
106
|
+
name: "addRing",
|
|
107
|
+
size: iconSize,
|
|
108
|
+
iconColor: iconColor,
|
|
109
|
+
"aria-label": "Plus"
|
|
110
|
+
}), showNegativeIcon && jsx(Icon, {
|
|
111
|
+
name: "remove",
|
|
112
|
+
size: iconSize,
|
|
113
|
+
iconColor: iconColor,
|
|
114
|
+
"aria-label": "Minus"
|
|
115
|
+
}), jsx(Typography, {
|
|
116
|
+
variant: typographyVariant,
|
|
117
|
+
color: amountColor,
|
|
118
|
+
as: "span",
|
|
119
|
+
children: formattedAmount
|
|
120
|
+
})]
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
var templateObject_1;
|
|
124
|
+
|
|
125
|
+
export { MoneyDisplay };
|
|
126
|
+
//# sourceMappingURL=MoneyDisplay.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoneyDisplay.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type PictureProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
src: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
href?: string;
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const Picture: React.FC<PictureProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import styled$module, { css } from 'styled-components';
|
|
5
|
+
const styled = styled$module.default || styled$module;
|
|
6
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
7
|
+
import { media } from '../../../lib/styleUtils.mjs';
|
|
8
|
+
|
|
9
|
+
var PictureWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
10
|
+
displayName: "Picture__PictureWrapper",
|
|
11
|
+
componentId: "sc-11d9tei-0"
|
|
12
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin: 0 auto;\n \n ", " {\n margin-left: 0;\n margin-right: 0;\n }\n"], ["\n margin: 0 auto;\n \n ", " {\n margin-left: 0;\n margin-right: 0;\n }\n"
|
|
13
|
+
// A clickable image answers input on the image itself (decision 0029, #185): it fades on hover and
|
|
14
|
+
// one step further while pressed, and draws the system focus ring around the image, following its
|
|
15
|
+
// rounded corners. Fading isn't movement, so it stays under reduced motion.
|
|
16
|
+
])), media.sm);
|
|
17
|
+
// A clickable image answers input on the image itself (decision 0029, #185): it fades on hover and
|
|
18
|
+
// one step further while pressed, and draws the system focus ring around the image, following its
|
|
19
|
+
// rounded corners. Fading isn't movement, so it stays under reduced motion.
|
|
20
|
+
var clickableImage = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n cursor: pointer;\n\n img {\n transition: ", ";\n }\n\n &:hover img {\n opacity: ", ";\n }\n\n &:active img {\n opacity: ", ";\n }\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible img {\n outline: ", ";\n outline-offset: ", ";\n }\n"], ["\n display: block;\n cursor: pointer;\n\n img {\n transition: ", ";\n }\n\n &:hover img {\n opacity: ", ";\n }\n\n &:active img {\n opacity: ", ";\n }\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible img {\n outline: ", ";\n outline-offset: ", ";\n }\n"])), tokens.semantic.motion.transition.press, tokens.semantic.opacity.hover, tokens.semantic.opacity.pressed, tokens.semantic.border.focus, tokens.semantic.border.focusOffset);
|
|
21
|
+
var ImageLink = /*#__PURE__*/styled.a.withConfig({
|
|
22
|
+
displayName: "Picture__ImageLink",
|
|
23
|
+
componentId: "sc-11d9tei-1"
|
|
24
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), clickableImage);
|
|
25
|
+
var ImageButton = /*#__PURE__*/styled.button.withConfig({
|
|
26
|
+
displayName: "Picture__ImageButton",
|
|
27
|
+
componentId: "sc-11d9tei-2"
|
|
28
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: none;\n background: none;\n padding: 0;\n width: 100%;\n ", "\n"], ["\n border: none;\n background: none;\n padding: 0;\n width: 100%;\n ", "\n"])), clickableImage);
|
|
29
|
+
var StyledImage = /*#__PURE__*/styled.img.withConfig({
|
|
30
|
+
displayName: "Picture__StyledImage",
|
|
31
|
+
componentId: "sc-11d9tei-3"
|
|
32
|
+
})(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 100%;\n height: auto;\n border-radius: ", ";\n display: block;\n"], ["\n width: 100%;\n height: auto;\n border-radius: ", ";\n display: block;\n"])), tokens.semantic.radius.sm);
|
|
33
|
+
var Picture = function Picture(_a) {
|
|
34
|
+
var title = _a.title,
|
|
35
|
+
src = _a.src,
|
|
36
|
+
_b = _a.width,
|
|
37
|
+
width = _b === void 0 ? 1300 : _b,
|
|
38
|
+
_c = _a.height,
|
|
39
|
+
height = _c === void 0 ? 630 : _c,
|
|
40
|
+
onClick = _a.onClick,
|
|
41
|
+
href = _a.href,
|
|
42
|
+
dataTestId = _a["data-testid"];
|
|
43
|
+
var image = jsx(StyledImage, {
|
|
44
|
+
src: src,
|
|
45
|
+
alt: title,
|
|
46
|
+
width: width,
|
|
47
|
+
height: height
|
|
48
|
+
});
|
|
49
|
+
return jsx(PictureWrapper, {
|
|
50
|
+
"data-testid": dataTestId,
|
|
51
|
+
children: href ? jsx(ImageLink, {
|
|
52
|
+
href: href,
|
|
53
|
+
"aria-label": "Read more about ".concat(title),
|
|
54
|
+
children: image
|
|
55
|
+
}) : onClick ? jsx(ImageButton, {
|
|
56
|
+
onClick: onClick,
|
|
57
|
+
"aria-label": "Read more about ".concat(title),
|
|
58
|
+
children: image
|
|
59
|
+
}) : image
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
63
|
+
|
|
64
|
+
export { Picture };
|
|
65
|
+
//# sourceMappingURL=Picture.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Picture.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Picture.mjs';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ProgressBarProps {
|
|
3
|
+
/** Progress value from 0 to 100 */
|
|
4
|
+
value: number;
|
|
5
|
+
/** Orientation of the progress bar */
|
|
6
|
+
variant?: 'horizontal' | 'vertical';
|
|
7
|
+
/** Fill colour: `default` is near-black (`background.emphasis`); `success` and `error` use their status colours */
|
|
8
|
+
color?: 'success' | 'error' | 'default';
|
|
9
|
+
/** Height size for horizontal progress bar (default: md) */
|
|
10
|
+
height?: 'sm' | 'md' | 'lg' | 'xl';
|
|
11
|
+
/** Width size for vertical progress bar (default: md) */
|
|
12
|
+
width?: 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
/** Accessible name, e.g. "Upload progress". Provide this or aria-labelledby; falls back to "Progress" */
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
/** ID of the visible element that names the progress bar */
|
|
16
|
+
'aria-labelledby'?: string;
|
|
17
|
+
/** Data attribute for testing */
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const ProgressBar: React.FC<ProgressBarProps>;
|
|
21
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __assign, __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import styled$module, { css } from 'styled-components';
|
|
5
|
+
const styled = styled$module.default || styled$module;
|
|
6
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
7
|
+
import { forcedColorsEdge, reducedMotion, forcedColors } from '../../../lib/styleUtils.mjs';
|
|
8
|
+
|
|
9
|
+
// Destructure tokens
|
|
10
|
+
var semantic = tokens.semantic;
|
|
11
|
+
var _a = __assign(__assign({}, semantic), {
|
|
12
|
+
component: tokens.component
|
|
13
|
+
}),
|
|
14
|
+
color = _a.color,
|
|
15
|
+
motion = _a.motion,
|
|
16
|
+
radius = _a.radius,
|
|
17
|
+
component = _a.component;
|
|
18
|
+
var ProgressBarContainer = /*#__PURE__*/styled.div.withConfig({
|
|
19
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
20
|
+
return !prop.startsWith('$');
|
|
21
|
+
},
|
|
22
|
+
displayName: "ProgressBar__ProgressBarContainer",
|
|
23
|
+
componentId: "sc-1nco33q-0"
|
|
24
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: ", ";\n overflow: hidden;\n\n /* Forced colours drop the track's fill, so the track gets an edge (decision 0038) */\n ", "\n\n ", "\n\n ", "\n"], ["\n background-color: ", ";\n border-radius: ", ";\n overflow: hidden;\n\n /* Forced colours drop the track's fill, so the track gets an edge (decision 0038) */\n ", "\n\n ", "\n\n ", "\n"])), tokens.component.track.background, radius.xs, forcedColorsEdge, function (props) {
|
|
25
|
+
return props.$variant === 'horizontal' && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n height: ", ";\n "], ["\n width: 100%;\n height: ", ";\n "])), props.$height ? component.progressBar.sizes[props.$height].height : component.progressBar.sizes.md.height);
|
|
26
|
+
}, function (props) {
|
|
27
|
+
return props.$variant === 'vertical' && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n height: 100%;\n "], ["\n width: ", ";\n height: 100%;\n "])), props.$width ? component.progressBar.sizes[props.$width].height : component.progressBar.sizes.md.height);
|
|
28
|
+
});
|
|
29
|
+
var ProgressBarFill = /*#__PURE__*/styled.div.withConfig({
|
|
30
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
31
|
+
return !prop.startsWith('$');
|
|
32
|
+
},
|
|
33
|
+
displayName: "ProgressBar__ProgressBarFill",
|
|
34
|
+
componentId: "sc-1nco33q-1"
|
|
35
|
+
})(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n height: 100%;\n transition: width ", " ", ",\n height ", " ", ",\n background-color ", " ", ";\n\n ", " {\n transition: none;\n }\n\n /* The fill is the value, so it keeps a fill in forced colours, in the system selection colour (decision 0038) */\n ", " {\n forced-color-adjust: none;\n background-color: Highlight;\n }\n\n ", "\n\n ", "\n\n ", "\n"], ["\n height: 100%;\n transition: width ", " ", ",\n height ", " ", ",\n background-color ", " ", ";\n\n ", " {\n transition: none;\n }\n\n /* The fill is the value, so it keeps a fill in forced colours, in the system selection colour (decision 0038) */\n ", " {\n forced-color-adjust: none;\n background-color: Highlight;\n }\n\n ", "\n\n ", "\n\n ", "\n"])), motion.duration.moderate, motion.easing.standard, motion.duration.moderate, motion.easing.standard, motion.duration.moderate, motion.easing.standard, reducedMotion, forcedColors, function (props) {
|
|
36
|
+
var backgroundColor;
|
|
37
|
+
switch (props.$color) {
|
|
38
|
+
case 'success':
|
|
39
|
+
backgroundColor = color.fill.success;
|
|
40
|
+
break;
|
|
41
|
+
case 'error':
|
|
42
|
+
backgroundColor = color.fill.danger;
|
|
43
|
+
break;
|
|
44
|
+
case 'default':
|
|
45
|
+
default:
|
|
46
|
+
// Near-black, like Slider's fill (decision 0029)
|
|
47
|
+
backgroundColor = color.fill.emphasis;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), backgroundColor);
|
|
51
|
+
}, function (props) {
|
|
52
|
+
return props.$variant === 'horizontal' && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: ", "%;\n "], ["\n width: ", "%;\n "])), Math.min(100, Math.max(0, props.$value)));
|
|
53
|
+
}, function (props) {
|
|
54
|
+
return props.$variant === 'vertical' && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n width: 100%;\n height: ", "%;\n "], ["\n width: 100%;\n height: ", "%;\n "])), Math.min(100, Math.max(0, props.$value)));
|
|
55
|
+
});
|
|
56
|
+
var ProgressBar = function ProgressBar(_a) {
|
|
57
|
+
var value = _a.value,
|
|
58
|
+
_b = _a.variant,
|
|
59
|
+
variant = _b === void 0 ? 'horizontal' : _b,
|
|
60
|
+
_c = _a.color,
|
|
61
|
+
color = _c === void 0 ? 'default' : _c,
|
|
62
|
+
height = _a.height,
|
|
63
|
+
width = _a.width,
|
|
64
|
+
ariaLabel = _a["aria-label"],
|
|
65
|
+
ariaLabelledBy = _a["aria-labelledby"],
|
|
66
|
+
dataTestId = _a["data-testid"];
|
|
67
|
+
// Blank values are no name at all, so they fall back like missing ones
|
|
68
|
+
var label = (ariaLabel === null || ariaLabel === void 0 ? void 0 : ariaLabel.trim()) ? ariaLabel : undefined;
|
|
69
|
+
var labelledBy = (ariaLabelledBy === null || ariaLabelledBy === void 0 ? void 0 : ariaLabelledBy.trim()) ? ariaLabelledBy : undefined;
|
|
70
|
+
return jsx(ProgressBarContainer, {
|
|
71
|
+
"$variant": variant,
|
|
72
|
+
"$height": height,
|
|
73
|
+
"$width": width,
|
|
74
|
+
"data-testid": dataTestId,
|
|
75
|
+
role: "progressbar",
|
|
76
|
+
"aria-label": label !== null && label !== void 0 ? label : labelledBy ? undefined : 'Progress',
|
|
77
|
+
"aria-labelledby": labelledBy,
|
|
78
|
+
"aria-valuenow": Math.min(100, Math.max(0, value)),
|
|
79
|
+
"aria-valuemin": 0,
|
|
80
|
+
"aria-valuemax": 100,
|
|
81
|
+
children: jsx(ProgressBarFill, {
|
|
82
|
+
"$value": value,
|
|
83
|
+
"$variant": variant,
|
|
84
|
+
"$color": color
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
89
|
+
|
|
90
|
+
export { ProgressBar, ProgressBar as default };
|
|
91
|
+
//# sourceMappingURL=ProgressBar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type StackDirection = 'column' | 'row';
|
|
3
|
+
export type StackAlign = 'center' | 'flex-start' | 'flex-end' | 'stretch' | 'baseline';
|
|
4
|
+
export type StackJustify = 'center' | 'flex-start' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
5
|
+
export type StackGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
|
|
6
|
+
export interface StackProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
direction?: StackDirection;
|
|
9
|
+
alignItems?: StackAlign;
|
|
10
|
+
justifyContent?: StackJustify;
|
|
11
|
+
gap?: StackGap;
|
|
12
|
+
wrap?: boolean;
|
|
13
|
+
'data-testid'?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const Stack: React.FC<StackProps>;
|
|
16
|
+
export default Stack;
|
|
@@ -0,0 +1,71 @@
|
|
|
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 tokens from '../../../lib/cssTokens.mjs';
|
|
7
|
+
|
|
8
|
+
var StyledStack = /*#__PURE__*/styled.div.withConfig({
|
|
9
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
10
|
+
return !prop.startsWith('$');
|
|
11
|
+
},
|
|
12
|
+
displayName: "Stack__StyledStack",
|
|
13
|
+
componentId: "sc-1ehkxgy-0"
|
|
14
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: var(--stack-direction);\n align-items: var(--stack-align-items);\n justify-content: var(--stack-justify-content);\n gap: var(--stack-gap);\n flex-wrap: var(--stack-wrap);\n"], ["\n display: flex;\n flex-direction: var(--stack-direction);\n align-items: var(--stack-align-items);\n justify-content: var(--stack-justify-content);\n gap: var(--stack-gap);\n flex-wrap: var(--stack-wrap);\n"
|
|
15
|
+
// Each gap name maps to the space step that replaced its old spacing.layout token (decision 0031),
|
|
16
|
+
// so every gap keeps its value
|
|
17
|
+
])));
|
|
18
|
+
// Each gap name maps to the space step that replaced its old spacing.layout token (decision 0031),
|
|
19
|
+
// so every gap keeps its value
|
|
20
|
+
var GAP_SPACE = {
|
|
21
|
+
none: '0',
|
|
22
|
+
xs: '100',
|
|
23
|
+
sm: '200',
|
|
24
|
+
md: '300',
|
|
25
|
+
lg: '400',
|
|
26
|
+
xl: '500',
|
|
27
|
+
'2xl': '600',
|
|
28
|
+
'3xl': '700',
|
|
29
|
+
'4xl': '800',
|
|
30
|
+
'5xl': '900',
|
|
31
|
+
'6xl': '1000'
|
|
32
|
+
};
|
|
33
|
+
// Helper function to convert gap prop to CSS value
|
|
34
|
+
var getGapValue = function getGapValue(gap) {
|
|
35
|
+
var step = GAP_SPACE[gap];
|
|
36
|
+
if (step) {
|
|
37
|
+
return tokens.semantic.space[step];
|
|
38
|
+
}
|
|
39
|
+
// Fallback to medium spacing for an unknown gap (from untyped JavaScript)
|
|
40
|
+
return tokens.semantic.space[300];
|
|
41
|
+
};
|
|
42
|
+
var Stack = function Stack(_a) {
|
|
43
|
+
var children = _a.children,
|
|
44
|
+
_b = _a.direction,
|
|
45
|
+
direction = _b === void 0 ? 'row' : _b,
|
|
46
|
+
_c = _a.gap,
|
|
47
|
+
gap = _c === void 0 ? 'md' : _c,
|
|
48
|
+
alignItems = _a.alignItems,
|
|
49
|
+
justifyContent = _a.justifyContent,
|
|
50
|
+
_d = _a.wrap,
|
|
51
|
+
wrap = _d === void 0 ? false : _d,
|
|
52
|
+
dataTestId = _a["data-testid"];
|
|
53
|
+
var gapValue = getGapValue(gap);
|
|
54
|
+
// Create CSS custom properties object with proper typing
|
|
55
|
+
var cssProps = {
|
|
56
|
+
'--stack-direction': direction,
|
|
57
|
+
'--stack-align-items': alignItems || 'initial',
|
|
58
|
+
'--stack-justify-content': justifyContent || 'initial',
|
|
59
|
+
'--stack-gap': gapValue,
|
|
60
|
+
'--stack-wrap': wrap ? 'wrap' : 'nowrap'
|
|
61
|
+
};
|
|
62
|
+
return jsx(StyledStack, {
|
|
63
|
+
style: cssProps,
|
|
64
|
+
"data-testid": dataTestId,
|
|
65
|
+
children: children
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
var templateObject_1;
|
|
69
|
+
|
|
70
|
+
export { Stack, Stack as default };
|
|
71
|
+
//# sourceMappingURL=Stack.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Stack.mjs';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StatusLabelProps } from '../StatusLabel/StatusLabelBase.mjs';
|
|
3
|
+
export type { StatusType, StatusSize } from '../StatusLabel/StatusLabelBase.mjs';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the StatusBadge component
|
|
6
|
+
* @deprecated Use `StatusLabelProps`. StatusBadge is renamed StatusLabel and is removed in 3.0
|
|
7
|
+
* (decision 0018).
|
|
8
|
+
*/
|
|
9
|
+
export interface StatusBadgeProps extends StatusLabelProps {
|
|
10
|
+
/**
|
|
11
|
+
* Whether to show the icon
|
|
12
|
+
* @default true
|
|
13
|
+
* @deprecated StatusLabel always shows the icon, so status is never conveyed by colour alone.
|
|
14
|
+
*/
|
|
15
|
+
showIcon?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* StatusBadge displays a transaction or task status.
|
|
19
|
+
*
|
|
20
|
+
* @deprecated Renamed to `StatusLabel` (same `status`, `size`, `label`, `liveRegion`), which always
|
|
21
|
+
* shows the icon. StatusBadge is removed in 3.0 (decision 0018).
|
|
22
|
+
*/
|
|
23
|
+
export declare const StatusBadge: React.FC<StatusBadgeProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __assign } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { StatusLabelBase } from '../StatusLabel/StatusLabelBase.mjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* StatusBadge displays a transaction or task status.
|
|
8
|
+
*
|
|
9
|
+
* @deprecated Renamed to `StatusLabel` (same `status`, `size`, `label`, `liveRegion`), which always
|
|
10
|
+
* shows the icon. StatusBadge is removed in 3.0 (decision 0018).
|
|
11
|
+
*/
|
|
12
|
+
var StatusBadge = function StatusBadge(props) {
|
|
13
|
+
return jsx(StatusLabelBase, __assign({}, props));
|
|
14
|
+
};
|
|
15
|
+
StatusBadge.displayName = 'StatusBadge';
|
|
16
|
+
|
|
17
|
+
export { StatusBadge };
|
|
18
|
+
//# sourceMappingURL=StatusBadge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBadge.mjs","sources":["../../../../src/components/atoms/StatusBadge/StatusBadge.tsx"],"sourcesContent":["import React from 'react'\nimport { StatusLabelBase, type StatusLabelProps } from '../StatusLabel/StatusLabelBase'\n\nexport type { StatusType, StatusSize } from '../StatusLabel/StatusLabelBase'\n\n/**\n * Props for the StatusBadge component\n * @deprecated Use `StatusLabelProps`. StatusBadge is renamed StatusLabel and is removed in 3.0\n * (decision 0018).\n */\nexport interface StatusBadgeProps extends StatusLabelProps {\n /**\n * Whether to show the icon\n * @default true\n * @deprecated StatusLabel always shows the icon, so status is never conveyed by colour alone.\n */\n showIcon?: boolean\n}\n\n/**\n * StatusBadge displays a transaction or task status.\n *\n * @deprecated Renamed to `StatusLabel` (same `status`, `size`, `label`, `liveRegion`), which always\n * shows the icon. StatusBadge is removed in 3.0 (decision 0018).\n */\nexport const StatusBadge: React.FC<StatusBadgeProps> = (props) => <StatusLabelBase {...props} />\n\nStatusBadge.displayName = 'StatusBadge'\n"],"names":["StatusBadge","props","_jsx","StatusLabelBase","__assign","displayName"],"mappings":";;;;;AAmBA;;;;;AAKG;IACUA,WAAW,GAA+B,SAA1CA,WAAWA,CAAgCC,KAAK,EAAA;EAAK,OAAAC,GAAA,CAACC,eAAe,EAAKC,QAAA,CAAA,EAAA,EAAAH,KAAK,CAAI,CAAA,CAAA;AAA9B,EAA8B;AAEhGD,WAAW,CAACK,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StatusLabelProps } from './StatusLabelBase.mjs';
|
|
3
|
+
export type { StatusLabelProps, StatusType, StatusSize } from './StatusLabelBase.mjs';
|
|
4
|
+
/**
|
|
5
|
+
* StatusLabel conveys the status of something, such as a transaction or task (decision 0018).
|
|
6
|
+
*
|
|
7
|
+
* Uses only the status colour tokens and always shows an icon with its text, so status is never
|
|
8
|
+
* conveyed by colour alone. Not interactive. Announces changes politely to screen readers.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <StatusLabel status="completed" />
|
|
13
|
+
*
|
|
14
|
+
* <StatusLabel status="pending" label="Awaiting approval" size="small" />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const StatusLabel: React.FC<StatusLabelProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __assign } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { StatusLabelBase } from './StatusLabelBase.mjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* StatusLabel conveys the status of something, such as a transaction or task (decision 0018).
|
|
8
|
+
*
|
|
9
|
+
* Uses only the status colour tokens and always shows an icon with its text, so status is never
|
|
10
|
+
* conveyed by colour alone. Not interactive. Announces changes politely to screen readers.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <StatusLabel status="completed" />
|
|
15
|
+
*
|
|
16
|
+
* <StatusLabel status="pending" label="Awaiting approval" size="small" />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
// showIcon comes last so no caller (for example plain JavaScript) can hide the icon
|
|
20
|
+
var StatusLabel = function StatusLabel(props) {
|
|
21
|
+
return jsx(StatusLabelBase, __assign({}, props, {
|
|
22
|
+
showIcon: true
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
StatusLabel.displayName = 'StatusLabel';
|
|
26
|
+
|
|
27
|
+
export { StatusLabel };
|
|
28
|
+
//# sourceMappingURL=StatusLabel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusLabel.mjs","sources":["../../../../src/components/atoms/StatusLabel/StatusLabel.tsx"],"sourcesContent":["import React from 'react'\nimport { StatusLabelBase, type StatusLabelProps } from './StatusLabelBase'\n\nexport type { StatusLabelProps, StatusType, StatusSize } from './StatusLabelBase'\n\n/**\n * StatusLabel conveys the status of something, such as a transaction or task (decision 0018).\n *\n * Uses only the status colour tokens and always shows an icon with its text, so status is never\n * conveyed by colour alone. Not interactive. Announces changes politely to screen readers.\n *\n * @example\n * ```tsx\n * <StatusLabel status=\"completed\" />\n *\n * <StatusLabel status=\"pending\" label=\"Awaiting approval\" size=\"small\" />\n * ```\n */\n// showIcon comes last so no caller (for example plain JavaScript) can hide the icon\nexport const StatusLabel: React.FC<StatusLabelProps> = (props) => <StatusLabelBase {...props} showIcon />\n\nStatusLabel.displayName = 'StatusLabel'\n"],"names":["StatusLabel","props","_jsx","StatusLabelBase","showIcon","displayName"],"mappings":";;;;;AAKA;;;;;;;;;;;;AAYG;AACH;IACaA,WAAW,GAA+B,SAA1CA,WAAWA,CAAgCC,KAAK,EAAK;EAAA,OAAAC,GAAC,CAAAC,eAAe,eAAKF,KAAK,EAAA;AAAEG,IAAAA,QAAQ,EAAG,IAAA;AAAA,GAAA,CAAA,CAAA,CAAA;AAAvC,EAAuC;AAEzGJ,WAAW,CAACK,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Status type options for StatusLabel
|
|
4
|
+
*/
|
|
5
|
+
export type StatusType = 'pending' | 'completed' | 'failed' | 'cancelled' | 'processing' | 'scheduled';
|
|
6
|
+
/**
|
|
7
|
+
* Size options for StatusLabel
|
|
8
|
+
*/
|
|
9
|
+
export type StatusSize = 'small' | 'medium';
|
|
10
|
+
/**
|
|
11
|
+
* Props shared by StatusLabel and the deprecated StatusBadge
|
|
12
|
+
*/
|
|
13
|
+
export interface StatusLabelProps {
|
|
14
|
+
/**
|
|
15
|
+
* The status type to display
|
|
16
|
+
*/
|
|
17
|
+
status: StatusType;
|
|
18
|
+
/**
|
|
19
|
+
* Optional custom label (defaults to status name)
|
|
20
|
+
*/
|
|
21
|
+
label?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Size: small (20px) or medium (24px)
|
|
24
|
+
* @default 'medium'
|
|
25
|
+
*/
|
|
26
|
+
size?: StatusSize;
|
|
27
|
+
/**
|
|
28
|
+
* Whether status changes should be announced to screen readers
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
liveRegion?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Test identifier for automated testing
|
|
34
|
+
*/
|
|
35
|
+
'data-testid'?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Accessible label override. Used as the status's name and announced instead of the visible
|
|
38
|
+
* text and icon (#78).
|
|
39
|
+
*/
|
|
40
|
+
'aria-label'?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Shared implementation of StatusLabel and the deprecated StatusBadge. Internal: not exported
|
|
44
|
+
* from the package. `showIcon` exists only for StatusBadge; StatusLabel always shows the icon
|
|
45
|
+
* (decision 0018).
|
|
46
|
+
*/
|
|
47
|
+
export declare const StatusLabelBase: React.FC<StatusLabelProps & {
|
|
48
|
+
showIcon?: boolean;
|
|
49
|
+
}>;
|