@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,64 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { parseISO, format, isToday, isYesterday, isThisWeek } from 'date-fns';
|
|
5
|
+
import styled$module from 'styled-components';
|
|
6
|
+
const styled = styled$module.default || styled$module;
|
|
7
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
8
|
+
|
|
9
|
+
var _a = tokens.semantic,
|
|
10
|
+
typography = _a.typography,
|
|
11
|
+
color = _a.color;
|
|
12
|
+
var TimeStyled = /*#__PURE__*/styled.time.withConfig({
|
|
13
|
+
displayName: "DateFormatter__TimeStyled",
|
|
14
|
+
componentId: "sc-5464cc-0"
|
|
15
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font: ", ";\n color: ", ";\n"], ["\n font: ", ";\n color: ", ";\n"
|
|
16
|
+
/**
|
|
17
|
+
* Formats a date with smart relative/absolute logic
|
|
18
|
+
*/])), typography.label, color.text.muted);
|
|
19
|
+
/**
|
|
20
|
+
* Formats a date with smart relative/absolute logic
|
|
21
|
+
*/
|
|
22
|
+
var formatDateSmart = function formatDateSmart(date, customFormat) {
|
|
23
|
+
// Relative labels for recent dates
|
|
24
|
+
if (isToday(date)) return 'Today';
|
|
25
|
+
if (isYesterday(date)) return 'Yesterday';
|
|
26
|
+
// Show day name for dates within this week
|
|
27
|
+
if (isThisWeek(date, {
|
|
28
|
+
weekStartsOn: 1
|
|
29
|
+
})) {
|
|
30
|
+
return format(date, 'EEEE'); // "Monday", "Tuesday", etc.
|
|
31
|
+
}
|
|
32
|
+
// Fall back to custom format or default full date format
|
|
33
|
+
return format(date, customFormat || 'MMMM dd, yyyy');
|
|
34
|
+
};
|
|
35
|
+
var DateFormatter = function DateFormatter(_a) {
|
|
36
|
+
var dateString = _a.dateString,
|
|
37
|
+
formatString = _a.formatString,
|
|
38
|
+
_b = _a.mode,
|
|
39
|
+
mode = _b === void 0 ? 'absolute' : _b,
|
|
40
|
+
dataTestId = _a["data-testid"];
|
|
41
|
+
var date = parseISO(dateString);
|
|
42
|
+
var displayText;
|
|
43
|
+
switch (mode) {
|
|
44
|
+
case 'relative': // Deprecated alias for 'smart', removed in 3.0 (#82)
|
|
45
|
+
case 'smart':
|
|
46
|
+
// Today, Yesterday or the day name for recent dates; formatted for older ones
|
|
47
|
+
displayText = formatDateSmart(date, formatString);
|
|
48
|
+
break;
|
|
49
|
+
case 'absolute':
|
|
50
|
+
default:
|
|
51
|
+
// Always use the format string (default 'yyyy')
|
|
52
|
+
displayText = format(date, formatString || 'yyyy');
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
return jsx(TimeStyled, {
|
|
56
|
+
dateTime: dateString,
|
|
57
|
+
"data-testid": dataTestId,
|
|
58
|
+
children: displayText
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
var templateObject_1;
|
|
62
|
+
|
|
63
|
+
export { DateFormatter };
|
|
64
|
+
//# sourceMappingURL=DateFormatter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateFormatter.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DateFormatter.mjs';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DividerProps {
|
|
3
|
+
/** Variant style of the divider */
|
|
4
|
+
variant?: 'default' | 'strong' | 'minimal';
|
|
5
|
+
/** Size variation affecting spacing */
|
|
6
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
7
|
+
/** Orientation of the divider */
|
|
8
|
+
orientation?: 'horizontal' | 'vertical';
|
|
9
|
+
/** Data test id for testing */
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Divider is an atomic component that provides visual separation between content sections.
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Multiple variants (default, strong, minimal)
|
|
17
|
+
* - Size variations for different spacing needs
|
|
18
|
+
* - Horizontal and vertical orientations
|
|
19
|
+
* - Semantic token usage for consistent styling
|
|
20
|
+
* - Full accessibility support
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <Divider />
|
|
25
|
+
* <Divider variant="strong" size="xlarge" />
|
|
26
|
+
* <Divider variant="minimal" />
|
|
27
|
+
* <Divider orientation="vertical" />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const Divider: React.FC<DividerProps>;
|
|
@@ -0,0 +1,134 @@
|
|
|
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
|
+
// Destructure tokens for cleaner access
|
|
9
|
+
var separatorTokens = tokens.component.separator;
|
|
10
|
+
// Margins come from the semantic separator spacing: no component spacing tokens (decision 0022)
|
|
11
|
+
var space = tokens.semantic.space;
|
|
12
|
+
var StyledDivider = /*#__PURE__*/styled.div.withConfig({
|
|
13
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
14
|
+
return !prop.startsWith('$');
|
|
15
|
+
},
|
|
16
|
+
displayName: "Divider__StyledDivider",
|
|
17
|
+
componentId: "sc-1l0c8ja-0"
|
|
18
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: none;\n \n /* Apply orientation */\n ", "\n \n /* Apply variant styles */\n ", "\n \n /* Apply size styles (spacing) */\n ", "\n"], ["\n border: none;\n \n /* Apply orientation */\n ", "\n \n /* Apply variant styles */\n ", "\n \n /* Apply size styles (spacing) */\n ", "\n"
|
|
19
|
+
/**
|
|
20
|
+
* Divider is an atomic component that provides visual separation between content sections.
|
|
21
|
+
*
|
|
22
|
+
* Features:
|
|
23
|
+
* - Multiple variants (default, strong, minimal)
|
|
24
|
+
* - Size variations for different spacing needs
|
|
25
|
+
* - Horizontal and vertical orientations
|
|
26
|
+
* - Semantic token usage for consistent styling
|
|
27
|
+
* - Full accessibility support
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Divider />
|
|
32
|
+
* <Divider variant="strong" size="xlarge" />
|
|
33
|
+
* <Divider variant="minimal" />
|
|
34
|
+
* <Divider orientation="vertical" />
|
|
35
|
+
* ```
|
|
36
|
+
*/])), function (_a) {
|
|
37
|
+
var _b = _a.$orientation,
|
|
38
|
+
$orientation = _b === void 0 ? 'horizontal' : _b;
|
|
39
|
+
if ($orientation === 'vertical') {
|
|
40
|
+
return "\n display: inline-block;\n height: auto;\n align-self: stretch;\n border-left: ".concat(tokens.semantic.border.width.thin, " solid;\n border-top: none;\n ");
|
|
41
|
+
}
|
|
42
|
+
return "border-top: ".concat(tokens.semantic.border.width.thin, " solid;");
|
|
43
|
+
}, function (_a) {
|
|
44
|
+
var _b = _a.$variant,
|
|
45
|
+
$variant = _b === void 0 ? 'default' : _b,
|
|
46
|
+
_c = _a.$orientation,
|
|
47
|
+
$orientation = _c === void 0 ? 'horizontal' : _c;
|
|
48
|
+
var borderProperty = $orientation === 'vertical' ? 'border-left' : 'border-top';
|
|
49
|
+
switch ($variant) {
|
|
50
|
+
case 'strong':
|
|
51
|
+
return "".concat(borderProperty, ": ").concat(separatorTokens.variants.strong.border, ";");
|
|
52
|
+
case 'minimal':
|
|
53
|
+
return "".concat(borderProperty, ": ").concat(separatorTokens.variants.minimal.border, ";");
|
|
54
|
+
case 'default':
|
|
55
|
+
default:
|
|
56
|
+
return "".concat(borderProperty, ": ").concat(separatorTokens.variants["default"].border, ";");
|
|
57
|
+
}
|
|
58
|
+
}, function (_a) {
|
|
59
|
+
var _b = _a.$size,
|
|
60
|
+
$size = _b === void 0 ? 'large' : _b,
|
|
61
|
+
_c = _a.$variant,
|
|
62
|
+
$variant = _c === void 0 ? 'default' : _c,
|
|
63
|
+
_d = _a.$orientation,
|
|
64
|
+
$orientation = _d === void 0 ? 'horizontal' : _d;
|
|
65
|
+
if ($variant === 'minimal' && $orientation === 'horizontal') {
|
|
66
|
+
// Minimal variant always uses its predefined spacing for horizontal
|
|
67
|
+
return "margin: ".concat(space[600], " 0;");
|
|
68
|
+
}
|
|
69
|
+
if ($orientation === 'vertical') {
|
|
70
|
+
// Vertical orientation uses horizontal margins (left/right)
|
|
71
|
+
switch ($size) {
|
|
72
|
+
case 'small':
|
|
73
|
+
return "margin: 0 ".concat(space[400], ";");
|
|
74
|
+
case 'medium':
|
|
75
|
+
return "margin: 0 ".concat(space[600], ";");
|
|
76
|
+
case 'xlarge':
|
|
77
|
+
return "margin: 0 ".concat(space[1200], ";");
|
|
78
|
+
case 'large':
|
|
79
|
+
default:
|
|
80
|
+
return "margin: 0 ".concat(space[800], ";");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Horizontal orientation uses vertical margins (top/bottom)
|
|
84
|
+
switch ($size) {
|
|
85
|
+
case 'small':
|
|
86
|
+
return "margin: ".concat(space[400], " 0;");
|
|
87
|
+
case 'medium':
|
|
88
|
+
return "margin: ".concat(space[600], " 0;");
|
|
89
|
+
case 'xlarge':
|
|
90
|
+
return "margin: ".concat(space[1200], " 0;");
|
|
91
|
+
case 'large':
|
|
92
|
+
default:
|
|
93
|
+
return "margin: ".concat(space[800], " 0;");
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
/**
|
|
97
|
+
* Divider is an atomic component that provides visual separation between content sections.
|
|
98
|
+
*
|
|
99
|
+
* Features:
|
|
100
|
+
* - Multiple variants (default, strong, minimal)
|
|
101
|
+
* - Size variations for different spacing needs
|
|
102
|
+
* - Horizontal and vertical orientations
|
|
103
|
+
* - Semantic token usage for consistent styling
|
|
104
|
+
* - Full accessibility support
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* <Divider />
|
|
109
|
+
* <Divider variant="strong" size="xlarge" />
|
|
110
|
+
* <Divider variant="minimal" />
|
|
111
|
+
* <Divider orientation="vertical" />
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
var Divider = function Divider(_a) {
|
|
115
|
+
var _b = _a.variant,
|
|
116
|
+
variant = _b === void 0 ? 'default' : _b,
|
|
117
|
+
_c = _a.size,
|
|
118
|
+
size = _c === void 0 ? 'large' : _c,
|
|
119
|
+
_d = _a.orientation,
|
|
120
|
+
orientation = _d === void 0 ? 'horizontal' : _d,
|
|
121
|
+
dataTestId = _a["data-testid"];
|
|
122
|
+
return jsx(StyledDivider, {
|
|
123
|
+
"$variant": variant,
|
|
124
|
+
"$size": size,
|
|
125
|
+
"$orientation": orientation,
|
|
126
|
+
"data-testid": dataTestId,
|
|
127
|
+
role: "separator",
|
|
128
|
+
"aria-orientation": orientation
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
var templateObject_1;
|
|
132
|
+
|
|
133
|
+
export { Divider };
|
|
134
|
+
//# sourceMappingURL=Divider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Divider.mjs';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { type IconName } from '../../../types/icons.mjs';
|
|
3
|
+
export type { IconName };
|
|
4
|
+
export interface IconProps {
|
|
5
|
+
name: IconName;
|
|
6
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
7
|
+
iconColor?: 'default' | 'emphasis' | 'subdued' | 'disabled' | 'inverse' | 'interactive' | 'error' | 'success' | 'warning' | 'inherit';
|
|
8
|
+
/**
|
|
9
|
+
* Makes the icon meaningful: it's announced as an image with this name. Without `aria-label`
|
|
10
|
+
* or `title`, the icon is decorative and hidden from assistive technology (#85). Use a
|
|
11
|
+
* human-readable name, never the internal icon name; `icons.json`'s `ariaLabelDefault` is a
|
|
12
|
+
* starting point.
|
|
13
|
+
*/
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Like `aria-label`, and also shown as a tooltip. `aria-label` wins if both are given.
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
19
|
+
'data-testid'?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const Icon: FC<IconProps>;
|
|
22
|
+
export default Icon;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject, __assign } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx, jsxs } 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
|
+
import iconsJson from '../../../styles/icons.json.mjs';
|
|
8
|
+
|
|
9
|
+
var IconStyled = /*#__PURE__*/styled.span.withConfig({
|
|
10
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
11
|
+
return !prop.startsWith('$');
|
|
12
|
+
},
|
|
13
|
+
displayName: "Icon__IconStyled",
|
|
14
|
+
componentId: "sc-1105czq-0"
|
|
15
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n \n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n \n /* Use semantic icon colors */\n color: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n \n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n \n /* Use semantic icon colors */\n color: ", ";\n"])), function (_a) {
|
|
16
|
+
var $size = _a.$size;
|
|
17
|
+
return tokens.semantic.size.icon[$size];
|
|
18
|
+
}, function (_a) {
|
|
19
|
+
var $size = _a.$size;
|
|
20
|
+
return tokens.semantic.size.icon[$size];
|
|
21
|
+
}, function (_a) {
|
|
22
|
+
var $iconColor = _a.$iconColor;
|
|
23
|
+
switch ($iconColor) {
|
|
24
|
+
case 'default':
|
|
25
|
+
return tokens.semantic.color.icon["default"];
|
|
26
|
+
case 'emphasis':
|
|
27
|
+
return tokens.semantic.color.icon.emphasis;
|
|
28
|
+
case 'subdued':
|
|
29
|
+
return tokens.semantic.color.icon.muted;
|
|
30
|
+
case 'disabled':
|
|
31
|
+
return tokens.semantic.color.icon.disabled;
|
|
32
|
+
case 'inverse':
|
|
33
|
+
return tokens.semantic.color.icon.inverse;
|
|
34
|
+
case 'interactive':
|
|
35
|
+
return tokens.semantic.color.icon.accent;
|
|
36
|
+
case 'error':
|
|
37
|
+
return tokens.semantic.color.icon.danger;
|
|
38
|
+
case 'success':
|
|
39
|
+
return tokens.semantic.color.icon.success;
|
|
40
|
+
case 'warning':
|
|
41
|
+
return tokens.semantic.color.icon.warning;
|
|
42
|
+
case 'inherit':
|
|
43
|
+
return 'currentColor';
|
|
44
|
+
default:
|
|
45
|
+
return tokens.semantic.color.icon["default"];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var Icon = function Icon(_a) {
|
|
49
|
+
var name = _a.name,
|
|
50
|
+
_b = _a.size,
|
|
51
|
+
size = _b === void 0 ? 'lg' : _b,
|
|
52
|
+
_c = _a.iconColor,
|
|
53
|
+
iconColor = _c === void 0 ? 'default' : _c,
|
|
54
|
+
ariaLabel = _a["aria-label"],
|
|
55
|
+
title = _a.title,
|
|
56
|
+
dataTestId = _a["data-testid"];
|
|
57
|
+
// Decorative unless it's given a name. A blank name is no name, so the icon stays hidden
|
|
58
|
+
var label = (ariaLabel === null || ariaLabel === void 0 ? void 0 : ariaLabel.trim()) || (title === null || title === void 0 ? void 0 : title.trim()) || undefined;
|
|
59
|
+
// Get the icon data from the JSON file
|
|
60
|
+
var iconData = iconsJson[name];
|
|
61
|
+
if (!iconData) {
|
|
62
|
+
console.warn("Icon \"".concat(name, "\" not found in icons.json"));
|
|
63
|
+
return jsx(IconStyled, {
|
|
64
|
+
"$size": size,
|
|
65
|
+
"$iconColor": iconColor,
|
|
66
|
+
"data-testid": dataTestId
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return jsx(IconStyled, {
|
|
70
|
+
"$size": size,
|
|
71
|
+
"$iconColor": iconColor,
|
|
72
|
+
"data-testid": dataTestId,
|
|
73
|
+
children: jsxs("svg", __assign({
|
|
74
|
+
viewBox: "0 0 24 24",
|
|
75
|
+
fill: "currentColor",
|
|
76
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
77
|
+
}, label ? {
|
|
78
|
+
role: 'img',
|
|
79
|
+
'aria-label': label
|
|
80
|
+
} : {
|
|
81
|
+
'aria-hidden': true,
|
|
82
|
+
focusable: false
|
|
83
|
+
}, {
|
|
84
|
+
children: [(title === null || title === void 0 ? void 0 : title.trim()) && jsx("title", {
|
|
85
|
+
children: title
|
|
86
|
+
}), jsx("path", {
|
|
87
|
+
d: iconData.path
|
|
88
|
+
})]
|
|
89
|
+
}))
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
var templateObject_1;
|
|
93
|
+
|
|
94
|
+
export { Icon, Icon as default };
|
|
95
|
+
//# sourceMappingURL=Icon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Icon.mjs';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type IconName } from '../Icon/index.mjs';
|
|
3
|
+
export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant: 'primary' | 'secondary' | 'naked';
|
|
5
|
+
size?: 'small' | 'medium' | 'large';
|
|
6
|
+
iconName: IconName;
|
|
7
|
+
url?: string;
|
|
8
|
+
'aria-label': string;
|
|
9
|
+
'aria-describedby'?: string;
|
|
10
|
+
'aria-expanded'?: boolean;
|
|
11
|
+
'aria-pressed'?: boolean;
|
|
12
|
+
'data-testid'?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const IconButton: React.FC<IconButtonProps>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject, __rest, __assign } 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 { Icon } from '../Icon/Icon.mjs';
|
|
7
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
8
|
+
import { forcedColorsEdge } from '../../../lib/styleUtils.mjs';
|
|
9
|
+
|
|
10
|
+
var _a = tokens.semantic,
|
|
11
|
+
motion = _a.motion,
|
|
12
|
+
border = _a.border,
|
|
13
|
+
space = _a.space,
|
|
14
|
+
size = _a.size,
|
|
15
|
+
_b = tokens.component,
|
|
16
|
+
iconButton = _b.iconButton,
|
|
17
|
+
button = _b.button;
|
|
18
|
+
// Height and width come from size.control as a minimum (decision 0034)
|
|
19
|
+
var control = {
|
|
20
|
+
small: size.control.sm,
|
|
21
|
+
medium: size.control.md,
|
|
22
|
+
large: size.control.lg
|
|
23
|
+
};
|
|
24
|
+
// Padding comes from the semantic spacing scale: no component spacing tokens (decision 0022)
|
|
25
|
+
var padding = {
|
|
26
|
+
small: space.inset.xs,
|
|
27
|
+
medium: space.inset.sm,
|
|
28
|
+
large: space.inset.md
|
|
29
|
+
};
|
|
30
|
+
// Colours and motion come from Button's tokens, so IconButton's variants look and behave exactly like
|
|
31
|
+
// Button's in every state (#130). Only the size and the icon differ
|
|
32
|
+
var variants = {
|
|
33
|
+
primary: {
|
|
34
|
+
bg: button.primary.backgroundColor,
|
|
35
|
+
text: button.primary.textColor,
|
|
36
|
+
hoverBg: button.hover.backgroundColor,
|
|
37
|
+
activeBg: button.active.backgroundColor,
|
|
38
|
+
disabledBg: button.disabled.backgroundColor,
|
|
39
|
+
disabledText: button.disabled.textColor
|
|
40
|
+
},
|
|
41
|
+
secondary: {
|
|
42
|
+
bg: button.variants.secondary.backgroundColor,
|
|
43
|
+
text: button.variants.secondary.textColor,
|
|
44
|
+
hoverBg: button.variants.secondary.hover.backgroundColor,
|
|
45
|
+
activeBg: button.variants.secondary.active.backgroundColor,
|
|
46
|
+
disabledBg: button.variants.secondary.disabled.backgroundColor,
|
|
47
|
+
disabledText: button.variants.secondary.disabled.textColor
|
|
48
|
+
},
|
|
49
|
+
naked: {
|
|
50
|
+
bg: button.variants.naked.backgroundColor,
|
|
51
|
+
text: button.variants.naked.textColor,
|
|
52
|
+
hoverBg: button.variants.naked.hover.backgroundColor,
|
|
53
|
+
activeBg: button.variants.naked.active.backgroundColor,
|
|
54
|
+
disabledBg: button.variants.naked.disabled.backgroundColor,
|
|
55
|
+
disabledText: button.variants.naked.disabled.textColor
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
// JavaScript callers can pass any string, so an unknown variant falls back to primary, as before
|
|
59
|
+
var colours = function colours(variant) {
|
|
60
|
+
var _a;
|
|
61
|
+
return (_a = variants[variant]) !== null && _a !== void 0 ? _a : variants.primary;
|
|
62
|
+
};
|
|
63
|
+
var IconButtonStyled = /*#__PURE__*/styled.button.withConfig({
|
|
64
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
65
|
+
return !prop.startsWith('$');
|
|
66
|
+
},
|
|
67
|
+
displayName: "IconButton__IconButtonStyled",
|
|
68
|
+
componentId: "sc-k8b14t-0"
|
|
69
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n border: none;\n border-radius: ", ";\n transition: ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n height: max-content;\n cursor: pointer;\n position: relative;\n\n min-width: ", ";\n min-height: ", ";\n padding: ", ";\n\n &:hover:not(:disabled) {\n background-color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: not-allowed;\n }\n\n ", "\n"], ["\n background-color: ", ";\n color: ", ";\n border: none;\n border-radius: ", ";\n transition: ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n height: max-content;\n cursor: pointer;\n position: relative;\n\n min-width: ", ";\n min-height: ", ";\n padding: ", ";\n\n &:hover:not(:disabled) {\n background-color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: not-allowed;\n }\n\n ", "\n"])), function (_a) {
|
|
70
|
+
var $variant = _a.$variant;
|
|
71
|
+
return colours($variant).bg;
|
|
72
|
+
}, function (_a) {
|
|
73
|
+
var $variant = _a.$variant;
|
|
74
|
+
return colours($variant).text;
|
|
75
|
+
}, iconButton.primary.borderRadius, motion.transition.feedback, function (_a) {
|
|
76
|
+
var $size = _a.$size;
|
|
77
|
+
return control[$size];
|
|
78
|
+
}, function (_a) {
|
|
79
|
+
var $size = _a.$size;
|
|
80
|
+
return control[$size];
|
|
81
|
+
}, function (_a) {
|
|
82
|
+
var $size = _a.$size;
|
|
83
|
+
return padding[$size];
|
|
84
|
+
}, function (_a) {
|
|
85
|
+
var $variant = _a.$variant;
|
|
86
|
+
return colours($variant).hoverBg;
|
|
87
|
+
}, function (_a) {
|
|
88
|
+
var $variant = _a.$variant;
|
|
89
|
+
return colours($variant).activeBg;
|
|
90
|
+
}, iconButton.focus.outline, border.focusOffset, function (_a) {
|
|
91
|
+
var $variant = _a.$variant;
|
|
92
|
+
return colours($variant).disabledBg;
|
|
93
|
+
}, function (_a) {
|
|
94
|
+
var $variant = _a.$variant;
|
|
95
|
+
return colours($variant).disabledText;
|
|
96
|
+
}, forcedColorsEdge);
|
|
97
|
+
var IconButton = function IconButton(_a) {
|
|
98
|
+
var variant = _a.variant,
|
|
99
|
+
_b = _a.size,
|
|
100
|
+
size = _b === void 0 ? 'medium' : _b,
|
|
101
|
+
url = _a.url,
|
|
102
|
+
_c = _a.iconName,
|
|
103
|
+
iconName = _c === void 0 ? 'close' : _c,
|
|
104
|
+
onClick = _a.onClick,
|
|
105
|
+
ariaLabel = _a["aria-label"],
|
|
106
|
+
ariaDescribedBy = _a["aria-describedby"],
|
|
107
|
+
ariaExpanded = _a["aria-expanded"],
|
|
108
|
+
ariaPressed = _a["aria-pressed"],
|
|
109
|
+
dataTestId = _a["data-testid"],
|
|
110
|
+
disabled = _a.disabled,
|
|
111
|
+
_d = _a.type,
|
|
112
|
+
type = _d === void 0 ? 'button' : _d,
|
|
113
|
+
htmlProps = __rest(_a, ["variant", "size", "url", "iconName", "onClick", 'aria-label', 'aria-describedby', 'aria-expanded', 'aria-pressed', 'data-testid', "disabled", "type"]);
|
|
114
|
+
var handleClick = function handleClick(event) {
|
|
115
|
+
if (onClick) {
|
|
116
|
+
onClick(event);
|
|
117
|
+
} else if (url && url.trim() !== '') {
|
|
118
|
+
// Use proper navigation instead of direct href assignment
|
|
119
|
+
if (url.startsWith('http') || url.startsWith('//')) {
|
|
120
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
121
|
+
} else {
|
|
122
|
+
window.location.assign(url);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var iconSize = size === 'large' ? 'lg' : size === 'small' ? 'sm' : 'md';
|
|
127
|
+
return jsx(IconButtonStyled, __assign({
|
|
128
|
+
"$variant": variant,
|
|
129
|
+
"$size": size,
|
|
130
|
+
onClick: handleClick,
|
|
131
|
+
disabled: disabled,
|
|
132
|
+
type: type,
|
|
133
|
+
"aria-label": ariaLabel,
|
|
134
|
+
"aria-describedby": ariaDescribedBy,
|
|
135
|
+
"aria-expanded": ariaExpanded,
|
|
136
|
+
"aria-pressed": ariaPressed,
|
|
137
|
+
"data-testid": dataTestId
|
|
138
|
+
}, htmlProps, {
|
|
139
|
+
children: jsx(Icon, {
|
|
140
|
+
name: iconName,
|
|
141
|
+
size: iconSize,
|
|
142
|
+
iconColor: "inherit",
|
|
143
|
+
"aria-hidden": "true" // Hide icon from screen readers since button has aria-label
|
|
144
|
+
})
|
|
145
|
+
}));
|
|
146
|
+
};
|
|
147
|
+
var templateObject_1;
|
|
148
|
+
|
|
149
|
+
export { IconButton };
|
|
150
|
+
//# sourceMappingURL=IconButton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './IconButton.mjs';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type MoneyDisplayVariant = 'default' | 'positive' | 'negative' | 'neutral';
|
|
3
|
+
export type MoneyDisplaySize = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
|
+
export type MoneyDisplayWeight = 'regular' | 'medium' | 'bold';
|
|
5
|
+
export type MoneyDisplayAlign = 'left' | 'center' | 'right';
|
|
6
|
+
export interface MoneyDisplayProps {
|
|
7
|
+
/** The monetary amount to display */
|
|
8
|
+
amount: number;
|
|
9
|
+
/** Currency code (ISO 4217) */
|
|
10
|
+
currency?: string;
|
|
11
|
+
/** Visual variant affecting color and style */
|
|
12
|
+
variant?: MoneyDisplayVariant;
|
|
13
|
+
/** Show +/- sign prefix */
|
|
14
|
+
showSign?: boolean;
|
|
15
|
+
/** Size of the amount display */
|
|
16
|
+
size?: MoneyDisplaySize;
|
|
17
|
+
/** Font weight */
|
|
18
|
+
weight?: MoneyDisplayWeight;
|
|
19
|
+
/** Locale for number formatting */
|
|
20
|
+
locale?: string;
|
|
21
|
+
/** Align text */
|
|
22
|
+
align?: MoneyDisplayAlign;
|
|
23
|
+
/** Data test id for testing */
|
|
24
|
+
'data-testid'?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const MoneyDisplay: React.FC<MoneyDisplayProps>;
|