@common-origin/design-system 2.19.0 → 2.21.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 +1012 -512
- package/dist/client.js.map +1 -1
- package/dist/components/atoms/AILabel/AILabel.d.mts +30 -0
- package/dist/components/atoms/AILabel/AILabel.d.ts +30 -0
- package/dist/components/atoms/AILabel/AILabel.mjs +94 -0
- package/dist/components/atoms/AILabel/AILabel.mjs.map +1 -0
- package/dist/components/atoms/AILabel/index.d.mts +1 -0
- package/dist/components/atoms/AILabel/index.d.ts +1 -0
- 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/SuggestionChip.d.mts +24 -0
- package/dist/components/atoms/Chip/SuggestionChip.d.ts +24 -0
- package/dist/components/atoms/Chip/SuggestionChip.mjs +61 -0
- package/dist/components/atoms/Chip/SuggestionChip.mjs.map +1 -0
- package/dist/components/atoms/Chip/index.d.mts +5 -0
- package/dist/components/atoms/Chip/index.d.ts +1 -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 +21 -0
- package/dist/components/atoms/index.d.ts +1 -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 +92 -0
- package/dist/components/molecules/AgentInput/AgentInput.d.ts +63 -1
- package/dist/components/molecules/AgentInput/AgentInput.mjs +1099 -0
- package/dist/components/molecules/AgentInput/AgentInput.mjs.map +1 -0
- package/dist/components/molecules/AgentInput/agentInputSpeech.d.mts +45 -0
- package/dist/components/molecules/AgentInput/agentInputSpeech.d.ts +2 -0
- package/dist/components/molecules/AgentInput/agentInputSpeech.mjs +53 -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/AgentInput/index.d.ts +1 -1
- 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 +76 -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 +56 -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 +100 -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/data.js +316 -3
- package/dist/data.js.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -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 +122 -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/styles/icons.json +30 -1
- package/dist/{data.esm.js → styles/icons.json.mjs} +33 -1466
- package/dist/styles/icons.json.mjs.map +1 -0
- package/dist/styles/tokens.d.mts +3718 -0
- package/dist/styles/tokens.d.ts +545 -1
- package/dist/styles/tokens.json +284 -2
- package/dist/styles/tokens.json.mjs +1736 -0
- package/dist/{tokens/index.esm.js.map → styles/tokens.json.mjs.map} +1 -1
- package/dist/tokens/index.js +284 -2
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/{index.esm.js → index.mjs} +285 -3
- package/dist/tokens/index.mjs.map +1 -0
- package/dist/tokens/styles/tokens.d.mts +3718 -0
- package/dist/tokens/styles/tokens.d.ts +545 -1
- package/dist/tokens/tokens.d.mts +4 -0
- package/dist/tokens/types/tokens.d.mts +6 -0
- package/dist/tokens.css +242 -0
- package/dist/tokens.css.d.mts +4 -0
- package/dist/types/icons.d.mts +25 -0
- package/dist/types/icons.d.ts +1 -1
- 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
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ require('react-dom');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
exports.AILabel = client.AILabel;
|
|
13
14
|
exports.AccountCard = client.AccountCard;
|
|
14
15
|
exports.ActionSheet = client.ActionSheet;
|
|
15
16
|
exports.AgentInput = client.AgentInput;
|
|
@@ -61,6 +62,7 @@ exports.StatusBadge = client.StatusBadge;
|
|
|
61
62
|
exports.StatusLabel = client.StatusLabel;
|
|
62
63
|
exports.StyledInputBase = client.StyledInputBase;
|
|
63
64
|
exports.StyledTextAreaBase = client.StyledTextAreaBase;
|
|
65
|
+
exports.SuggestionChip = client.SuggestionChip;
|
|
64
66
|
exports.TabBar = client.TabBar;
|
|
65
67
|
exports.Tag = client.Tag;
|
|
66
68
|
exports.TextField = client.TextField;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export { Avatar } from './components/atoms/Avatar/Avatar.mjs';
|
|
2
|
+
export { Badge } from './components/atoms/Badge/Badge.mjs';
|
|
3
|
+
export { Box } from './components/atoms/Box/Box.mjs';
|
|
4
|
+
export { Button } from './components/atoms/Button/Button.mjs';
|
|
5
|
+
export { CategoryBadge } from './components/atoms/CategoryBadge/CategoryBadge.mjs';
|
|
6
|
+
export { CategoryLabel } from './components/atoms/CategoryLabel/CategoryLabel.mjs';
|
|
7
|
+
export { Chip, LegacyChip } from './components/atoms/Chip/Chip.mjs';
|
|
8
|
+
export { InputChip } from './components/atoms/Chip/InputChip.mjs';
|
|
9
|
+
export { FilterChip } from './components/atoms/Chip/FilterChip.mjs';
|
|
10
|
+
export { BooleanChip } from './components/atoms/Chip/BooleanChip.mjs';
|
|
11
|
+
export { SuggestionChip } from './components/atoms/Chip/SuggestionChip.mjs';
|
|
12
|
+
export { Container } from './components/atoms/Container/Container.mjs';
|
|
13
|
+
export { Picture } from './components/atoms/Picture/Picture.mjs';
|
|
14
|
+
export { DateFormatter } from './components/atoms/DateFormatter/DateFormatter.mjs';
|
|
15
|
+
export { Icon } from './components/atoms/Icon/Icon.mjs';
|
|
16
|
+
export { IconButton } from './components/atoms/IconButton/IconButton.mjs';
|
|
17
|
+
export { MoneyDisplay } from './components/atoms/MoneyDisplay/MoneyDisplay.mjs';
|
|
18
|
+
export { ProgressBar } from './components/atoms/ProgressBar/ProgressBar.mjs';
|
|
19
|
+
export { Divider } from './components/atoms/Divider/Divider.mjs';
|
|
20
|
+
export { Stack } from './components/atoms/Stack/Stack.mjs';
|
|
21
|
+
export { StatusBadge } from './components/atoms/StatusBadge/StatusBadge.mjs';
|
|
22
|
+
export { StatusLabel } from './components/atoms/StatusLabel/StatusLabel.mjs';
|
|
23
|
+
export { Tag } from './components/atoms/Tag/Tag.mjs';
|
|
24
|
+
export { Typography } from './components/atoms/Typography/Typography.mjs';
|
|
25
|
+
export { AILabel } from './components/atoms/AILabel/AILabel.mjs';
|
|
26
|
+
export { AccountCard } from './components/molecules/AccountCard/AccountCard.mjs';
|
|
27
|
+
export { ActionSheet } from './components/molecules/ActionSheet/ActionSheet.mjs';
|
|
28
|
+
export { AgentInput } from './components/molecules/AgentInput/AgentInput.mjs';
|
|
29
|
+
export { Alert } from './components/molecules/Alert/Alert.mjs';
|
|
30
|
+
export { InlineAlert } from './components/molecules/InlineAlert/InlineAlert.mjs';
|
|
31
|
+
export { Breadcrumbs } from './components/molecules/Breadcrumbs/Breadcrumbs.mjs';
|
|
32
|
+
export { CardSmall } from './components/molecules/CardSmall/CardSmall.mjs';
|
|
33
|
+
export { CardLarge } from './components/molecules/CardLarge/CardLarge.mjs';
|
|
34
|
+
export { Checkbox } from './components/molecules/Checkbox/Checkbox.mjs';
|
|
35
|
+
export { ChipGroup } from './components/molecules/ChipGroup/ChipGroup.mjs';
|
|
36
|
+
export { CodeBlock } from './components/molecules/CodeBlock/CodeBlock.mjs';
|
|
37
|
+
export { DateGroup } from './components/molecules/DateGroup/DateGroup.mjs';
|
|
38
|
+
export { EmptyState } from './components/molecules/EmptyState/EmptyState.mjs';
|
|
39
|
+
export { FeatureBlock } from './components/molecules/FeatureBlock/FeatureBlock.mjs';
|
|
40
|
+
export { Dropdown } from './components/molecules/Dropdown/Dropdown.mjs';
|
|
41
|
+
export { List } from './components/molecules/List/List.mjs';
|
|
42
|
+
export { ListItem } from './components/molecules/List/ListItem.mjs';
|
|
43
|
+
export { Modal } from './components/molecules/Modal/Modal.mjs';
|
|
44
|
+
export { NumberInput } from './components/molecules/NumberInput/NumberInput.mjs';
|
|
45
|
+
export { PageTitle } from './components/molecules/PageTitle/PageTitle.mjs';
|
|
46
|
+
export { PasswordField } from './components/molecules/PasswordField/PasswordField.mjs';
|
|
47
|
+
export { SearchField } from './components/molecules/SearchField/SearchField.mjs';
|
|
48
|
+
export { Sheet } from './components/molecules/Sheet/Sheet.mjs';
|
|
49
|
+
export { Slider } from './components/molecules/Slider/Slider.mjs';
|
|
50
|
+
export { TabBar } from './components/molecules/TabBar/TabBar.mjs';
|
|
51
|
+
export { TextField } from './components/molecules/TextField/TextField.mjs';
|
|
52
|
+
export { StyledInputBase, StyledTextAreaBase } from './components/molecules/TextField/InputBase.mjs';
|
|
53
|
+
export { TransactionListItem } from './components/molecules/TransactionListItem/TransactionListItem.mjs';
|
|
54
|
+
export { Grid, GridCol, ResponsiveGrid } from './components/layout/GridSystem/GridSystem.mjs';
|
|
55
|
+
export { tokens } from './types/tokens.mjs';
|
|
56
|
+
export { iconsData } from './types/icons.mjs';
|
|
57
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Tokens } from '../styles/tokens.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* The tokens as components read them (decision 0041): the same shape and type as `tokens.json`,
|
|
4
|
+
* with every value a CSS variable that falls back to the resolved value, so a region can change a
|
|
5
|
+
* token through tokens.css. Breakpoints stay values.
|
|
6
|
+
*
|
|
7
|
+
* Use the resolved values from `tokens.json` instead where a value is read as data rather than
|
|
8
|
+
* CSS, such as a duration parsed for a timer.
|
|
9
|
+
*
|
|
10
|
+
* Jest maps this module to `tokens.json` (jest.config.js), so unit tests assert resolved values;
|
|
11
|
+
* the browser specs check the variables.
|
|
12
|
+
*/
|
|
13
|
+
declare const tokens: Tokens;
|
|
14
|
+
export default tokens;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import tokensJson from '../styles/tokens.json.mjs';
|
|
3
|
+
import { withCssVariables } from './cssVariables.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The tokens as components read them (decision 0041): the same shape and type as `tokens.json`,
|
|
7
|
+
* with every value a CSS variable that falls back to the resolved value, so a region can change a
|
|
8
|
+
* token through tokens.css. Breakpoints stay values.
|
|
9
|
+
*
|
|
10
|
+
* Use the resolved values from `tokens.json` instead where a value is read as data rather than
|
|
11
|
+
* CSS, such as a duration parsed for a timer.
|
|
12
|
+
*
|
|
13
|
+
* Jest maps this module to `tokens.json` (jest.config.js), so unit tests assert resolved values;
|
|
14
|
+
* the browser specs check the variables.
|
|
15
|
+
*/
|
|
16
|
+
var tokens = withCssVariables(tokensJson);
|
|
17
|
+
|
|
18
|
+
export { tokens as default };
|
|
19
|
+
//# sourceMappingURL=cssTokens.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssTokens.mjs","sources":["../../src/lib/cssTokens.ts"],"sourcesContent":["import tokensJson from '../styles/tokens.json'\nimport type { Tokens } from '../styles/tokens'\nimport { withCssVariables } from './cssVariables'\n\n/**\n * The tokens as components read them (decision 0041): the same shape and type as `tokens.json`,\n * with every value a CSS variable that falls back to the resolved value, so a region can change a\n * token through tokens.css. Breakpoints stay values.\n *\n * Use the resolved values from `tokens.json` instead where a value is read as data rather than\n * CSS, such as a duration parsed for a timer.\n *\n * Jest maps this module to `tokens.json` (jest.config.js), so unit tests assert resolved values;\n * the browser specs check the variables.\n */\nconst tokens: Tokens = withCssVariables(tokensJson as Tokens)\n\nexport default tokens\n"],"names":["tokens","withCssVariables","tokensJson"],"mappings":";;;;AAIA;;;;;;;;;;AAUG;AACH,IAAMA,MAAM,GAAWC,gBAAgB,CAACC,UAAoB;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CSS variable tokens.css declares for a token path: Style Dictionary's `name/kebab` with the
|
|
3
|
+
* `co` prefix. `semantic.color.text.default` is `--co-semantic-color-text-default`, and
|
|
4
|
+
* `semantic.border.focusOffset` is `--co-semantic-border-focus-offset`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function cssVariableName(path: string[]): string;
|
|
7
|
+
type Tree = {
|
|
8
|
+
[key: string]: string | Tree;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A copy of a token tree with the same shape, where every value reads its CSS variable and falls
|
|
12
|
+
* back to the resolved value: `var(--co-semantic-color-text-default, #212529)`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function withCssVariables<T extends Tree>(tree: T, path?: string[]): T;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __spreadArray } from '../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
|
|
4
|
+
// Components read tokens as CSS variables, with the resolved value as the fallback (decision 0041).
|
|
5
|
+
// A product that loads tokens.css can change a token for a region (a density or motion mode, a
|
|
6
|
+
// theme); one that doesn't renders exactly the resolved values.
|
|
7
|
+
/**
|
|
8
|
+
* The CSS variable tokens.css declares for a token path: Style Dictionary's `name/kebab` with the
|
|
9
|
+
* `co` prefix. `semantic.color.text.default` is `--co-semantic-color-text-default`, and
|
|
10
|
+
* `semantic.border.focusOffset` is `--co-semantic-border-focus-offset`.
|
|
11
|
+
*/
|
|
12
|
+
function cssVariableName(path) {
|
|
13
|
+
return "--".concat(__spreadArray(['co'], path, true).join('-').replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase());
|
|
14
|
+
}
|
|
15
|
+
/** Breakpoints stay values: a CSS variable can't be used in a media query */
|
|
16
|
+
var keepsValue = function keepsValue(path) {
|
|
17
|
+
return path[1] === 'breakpoint';
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A copy of a token tree with the same shape, where every value reads its CSS variable and falls
|
|
21
|
+
* back to the resolved value: `var(--co-semantic-color-text-default, #212529)`.
|
|
22
|
+
*/
|
|
23
|
+
function withCssVariables(tree, path) {
|
|
24
|
+
if (path === void 0) {
|
|
25
|
+
path = [];
|
|
26
|
+
}
|
|
27
|
+
return Object.fromEntries(Object.entries(tree).map(function (_a) {
|
|
28
|
+
var key = _a[0],
|
|
29
|
+
value = _a[1];
|
|
30
|
+
var at = __spreadArray(__spreadArray([], path, true), [key], false);
|
|
31
|
+
if (typeof value !== 'string') return [key, withCssVariables(value, at)];
|
|
32
|
+
return [key, keepsValue(at) ? value : "var(".concat(cssVariableName(at), ", ").concat(value, ")")];
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { cssVariableName, withCssVariables };
|
|
37
|
+
//# sourceMappingURL=cssVariables.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssVariables.mjs","sources":["../../src/lib/cssVariables.ts"],"sourcesContent":["// Components read tokens as CSS variables, with the resolved value as the fallback (decision 0041).\n// A product that loads tokens.css can change a token for a region (a density or motion mode, a\n// theme); one that doesn't renders exactly the resolved values.\n\n/**\n * The CSS variable tokens.css declares for a token path: Style Dictionary's `name/kebab` with the\n * `co` prefix. `semantic.color.text.default` is `--co-semantic-color-text-default`, and\n * `semantic.border.focusOffset` is `--co-semantic-border-focus-offset`.\n */\nexport function cssVariableName(path: string[]): string {\n return `--${['co', ...path]\n .join('-')\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase()}`\n}\n\n/** Breakpoints stay values: a CSS variable can't be used in a media query */\nconst keepsValue = (path: string[]) => path[1] === 'breakpoint'\n\ntype Tree = { [key: string]: string | Tree }\n\n/**\n * A copy of a token tree with the same shape, where every value reads its CSS variable and falls\n * back to the resolved value: `var(--co-semantic-color-text-default, #212529)`.\n */\nexport function withCssVariables<T extends Tree>(tree: T, path: string[] = []): T {\n return Object.fromEntries(\n Object.entries(tree).map(([key, value]) => {\n const at = [...path, key]\n if (typeof value !== 'string') return [key, withCssVariables(value, at)]\n return [key, keepsValue(at) ? value : `var(${cssVariableName(at)}, ${value})`]\n })\n ) as T\n}\n"],"names":["cssVariableName","path","concat","__spreadArray","join","replace","toLowerCase","keepsValue","withCssVariables","tree","Object","fromEntries","entries","map","_a","key","value","at"],"mappings":";;;AAAA;AACA;AACA;AAEA;;;;AAIG;AACG,SAAUA,eAAeA,CAACC,IAAc,EAAA;AAC5C,EAAA,OAAO,IAAA,CAAAC,MAAA,CAAKC,eAAC,IAAI,CAAA,EAAKF,IAAI,EACvB,IAAA,CAAA,CAAAG,IAAI,CAAC,GAAG,CAAC,CACTC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CACnCC,WAAW,EAAE,CAAE,CAAA;AACpB,CAAA;AAEA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIN,IAAc;AAAK,EAAA,OAAAA,IAAI,CAAC,CAAC,CAAC,KAAK,YAAY,CAAA;AAAxB,CAAwB,CAAA;AAI/D;;;AAGG;AACa,SAAAO,gBAAgBA,CAAiBC,IAAO,EAAER,IAAmB,EAAA;AAAnB,EAAA,IAAAA,IAAA,KAAA,KAAA,CAAA,EAAA;AAAAA,IAAAA,IAAmB,GAAA,EAAA,CAAA;AAAA,GAAA;AAC3E,EAAA,OAAOS,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACH,IAAI,CAAC,CAACI,GAAG,CAAC,UAACC,EAAY,EAAA;QAAXC,GAAG,GAAAD,EAAA,CAAA,CAAA,CAAA;AAAEE,MAAAA,KAAK,GAAAF,EAAA,CAAA,CAAA,CAAA,CAAA;AACnC,IAAA,IAAMG,EAAE,GAAOd,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAAF,IAAI,EAAE,IAAA,CAAA,EAAA,CAAAc,GAAG,SAAC,CAAA;AACzB,IAAA,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE,OAAO,CAACD,GAAG,EAAEP,gBAAgB,CAACQ,KAAK,EAAEC,EAAE,CAAC,CAAC,CAAA;AACxE,IAAA,OAAO,CAACF,GAAG,EAAER,UAAU,CAACU,EAAE,CAAC,GAAGD,KAAK,GAAG,MAAO,CAAAd,MAAA,CAAAF,eAAe,CAACiB,EAAE,CAAC,EAAK,IAAA,CAAA,CAAAf,MAAA,CAAAc,KAAK,EAAG,GAAA,CAAA,CAAC,CAAA;AAChF,GAAC,CAAC,CACE,CAAA;AACR;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const breakpoints: {
|
|
2
|
+
xs: string;
|
|
3
|
+
sm: string;
|
|
4
|
+
md: string;
|
|
5
|
+
lg: string;
|
|
6
|
+
xl: string;
|
|
7
|
+
'2xl': string;
|
|
8
|
+
};
|
|
9
|
+
export declare const media: {
|
|
10
|
+
xs: string;
|
|
11
|
+
sm: string;
|
|
12
|
+
md: string;
|
|
13
|
+
lg: string;
|
|
14
|
+
xl: string;
|
|
15
|
+
'2xl': string;
|
|
16
|
+
};
|
|
17
|
+
export declare const forcedColors = "@media (forced-colors: active)";
|
|
18
|
+
/** A control's edge in forced colours, for a control that shows its edge with a fill alone. The
|
|
19
|
+
* border follows the text colour the browser picks: ButtonText, LinkText, or GrayText when disabled. */
|
|
20
|
+
export declare const forcedColorsEdge: string;
|
|
21
|
+
export declare const reducedMotion = "@media (prefers-reduced-motion: reduce)";
|
|
22
|
+
export declare const exitAnimation: import("styled-components").RuleSet<object>;
|
|
23
|
+
export declare const visuallyHidden: import("styled-components").RuleSet<object>;
|
|
24
|
+
export interface RowState {
|
|
25
|
+
background: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const rowStates: Record<'unselected' | 'selected', Record<'rest' | 'hover' | 'pressed', RowState>>;
|
|
29
|
+
/**
|
|
30
|
+
* The background (and, when selected, text) of an interactive row in every state.
|
|
31
|
+
* - `focused`: keyboard focus that isn't DOM focus, such as a listbox option under
|
|
32
|
+
* aria-activedescendant. It shows the hover state.
|
|
33
|
+
* - `disabled`: shows the resting state, with no hover or press.
|
|
34
|
+
* - `textSelector`: a descendant to colour when the row's text isn't the row itself, for example
|
|
35
|
+
* text set by Typography. Pass it without `&`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const interactiveRow: ({ selected, focused, disabled, textSelector, }?: {
|
|
38
|
+
selected?: boolean;
|
|
39
|
+
focused?: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
textSelector?: string;
|
|
42
|
+
}) => string;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { keyframes, css } from 'styled-components';
|
|
4
|
+
import tokens from './cssTokens.mjs';
|
|
5
|
+
|
|
6
|
+
// Breakpoints from the semantic tokens (decision 0014)
|
|
7
|
+
var breakpoints = {
|
|
8
|
+
xs: tokens.semantic.breakpoint.xs,
|
|
9
|
+
sm: tokens.semantic.breakpoint.sm,
|
|
10
|
+
md: tokens.semantic.breakpoint.md,
|
|
11
|
+
lg: tokens.semantic.breakpoint.lg,
|
|
12
|
+
xl: tokens.semantic.breakpoint.xl,
|
|
13
|
+
'2xl': tokens.semantic.breakpoint['2xl']
|
|
14
|
+
};
|
|
15
|
+
// Media query helpers
|
|
16
|
+
var media = {
|
|
17
|
+
xs: "@media (min-width: ".concat(breakpoints.xs, ")"),
|
|
18
|
+
sm: "@media (min-width: ".concat(breakpoints.sm, ")"),
|
|
19
|
+
md: "@media (min-width: ".concat(breakpoints.md, ")"),
|
|
20
|
+
lg: "@media (min-width: ".concat(breakpoints.lg, ")"),
|
|
21
|
+
xl: "@media (min-width: ".concat(breakpoints.xl, ")"),
|
|
22
|
+
'2xl': "@media (min-width: ".concat(breakpoints['2xl'], ")")
|
|
23
|
+
};
|
|
24
|
+
// Windows Contrast Themes and other forced-colours modes (decision 0038). The browser swaps in
|
|
25
|
+
// the user's system colours, drops background colours and box-shadows, and keeps borders and
|
|
26
|
+
// outlines. Inside this query, give a control that shows its edge with a fill alone a border,
|
|
27
|
+
// and draw selected and checked states with system colours: ButtonText for control edges,
|
|
28
|
+
// Highlight and HighlightText for selected and checked, GrayText for disabled, CanvasText for
|
|
29
|
+
// content. Use forced-color-adjust: none only on a fill that carries state.
|
|
30
|
+
var forcedColors = '@media (forced-colors: active)';
|
|
31
|
+
/** A control's edge in forced colours, for a control that shows its edge with a fill alone. The
|
|
32
|
+
* border follows the text colour the browser picks: ButtonText, LinkText, or GrayText when disabled. */
|
|
33
|
+
var forcedColorsEdge = "".concat(forcedColors, " {\n border: ").concat(tokens.semantic.border.width.thin, " solid currentColor;\n}");
|
|
34
|
+
// Wrap fallbacks for people who ask for less motion (decision 0005): movement becomes
|
|
35
|
+
// an instant change or a simple fade. Colour and opacity transitions need no fallback.
|
|
36
|
+
var reducedMotion = '@media (prefers-reduced-motion: reduce)';
|
|
37
|
+
// No `from` keyframe: the fade starts from the element's current opacity, including a
|
|
38
|
+
// still-running entrance, so closing mid-entrance doesn't jump back to fully visible.
|
|
39
|
+
var fadeOut = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n to { opacity: 0; }\n"], ["\n to { opacity: 0; }\n"
|
|
40
|
+
// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of
|
|
41
|
+
// the element's `animation` declarations while it exits: the entrance stays in the list,
|
|
42
|
+
// so it isn't restarted, and the fade runs on top of it. A fade is already the
|
|
43
|
+
// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop
|
|
44
|
+
// still catches clicks (so they can't reach the page behind it) and the panel is inert.
|
|
45
|
+
// Exits accelerate: things leaving speed up as they go (decision 0037).
|
|
46
|
+
])));
|
|
47
|
+
// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of
|
|
48
|
+
// the element's `animation` declarations while it exits: the entrance stays in the list,
|
|
49
|
+
// so it isn't restarted, and the fade runs on top of it. A fade is already the
|
|
50
|
+
// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop
|
|
51
|
+
// still catches clicks (so they can't reach the page behind it) and the panel is inert.
|
|
52
|
+
// Exits accelerate: things leaving speed up as they go (decision 0037).
|
|
53
|
+
var exitAnimation = css(templateObject_2 || (templateObject_2 = __makeTemplateObject([", ", " ", " ", " forwards"], [", ", " ", " ", " forwards"
|
|
54
|
+
// Content for screen readers only. The 1px size and -1px margin are part of the standard
|
|
55
|
+
// visually-hidden technique, not design values, so they aren't tokens.
|
|
56
|
+
])), fadeOut, tokens.semantic.motion.duration.fast, tokens.semantic.motion.easing.accelerate);
|
|
57
|
+
// Content for screen readers only. The 1px size and -1px margin are part of the standard
|
|
58
|
+
// visually-hidden technique, not design values, so they aren't tokens.
|
|
59
|
+
var visuallyHidden = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n"], ["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n"
|
|
60
|
+
// One interaction pattern for rows and items: list items, menu and listbox options, sidebars
|
|
61
|
+
// (decision 0030). Unselected rows follow the naked Button's ladder; selected rows follow the
|
|
62
|
+
// light-blue selected ladder, with the text darkening with its fill (decision 0016). Unselected
|
|
63
|
+
// rows leave their text colour to the component, so a destructive row can stay red.
|
|
64
|
+
])));
|
|
65
|
+
// One interaction pattern for rows and items: list items, menu and listbox options, sidebars
|
|
66
|
+
// (decision 0030). Unselected rows follow the naked Button's ladder; selected rows follow the
|
|
67
|
+
// light-blue selected ladder, with the text darkening with its fill (decision 0016). Unselected
|
|
68
|
+
// rows leave their text colour to the component, so a destructive row can stay red.
|
|
69
|
+
var _a = tokens.semantic.color,
|
|
70
|
+
rowFill = _a.fill,
|
|
71
|
+
rowText = _a.text;
|
|
72
|
+
var rowStates = {
|
|
73
|
+
unselected: {
|
|
74
|
+
rest: {
|
|
75
|
+
background: 'transparent'
|
|
76
|
+
},
|
|
77
|
+
hover: {
|
|
78
|
+
background: rowFill.muted
|
|
79
|
+
},
|
|
80
|
+
pressed: {
|
|
81
|
+
background: rowFill["default"]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
selected: {
|
|
85
|
+
rest: {
|
|
86
|
+
background: rowFill['accent-muted'],
|
|
87
|
+
text: rowText.accent
|
|
88
|
+
},
|
|
89
|
+
hover: {
|
|
90
|
+
background: rowFill['accent-muted-hover'],
|
|
91
|
+
text: rowText['accent-hover']
|
|
92
|
+
},
|
|
93
|
+
pressed: {
|
|
94
|
+
background: rowFill['accent-muted-pressed'],
|
|
95
|
+
text: rowText['accent-pressed']
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var rowDeclarations = function rowDeclarations(_a, textSelector) {
|
|
100
|
+
var background = _a.background,
|
|
101
|
+
text = _a.text;
|
|
102
|
+
if (!text) return "background-color: ".concat(background, ";");
|
|
103
|
+
return textSelector ? "background-color: ".concat(background, ";\n ").concat(textSelector, " { color: ").concat(text, "; }") : "background-color: ".concat(background, ";\n color: ").concat(text, ";");
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The background (and, when selected, text) of an interactive row in every state.
|
|
107
|
+
* - `focused`: keyboard focus that isn't DOM focus, such as a listbox option under
|
|
108
|
+
* aria-activedescendant. It shows the hover state.
|
|
109
|
+
* - `disabled`: shows the resting state, with no hover or press.
|
|
110
|
+
* - `textSelector`: a descendant to colour when the row's text isn't the row itself, for example
|
|
111
|
+
* text set by Typography. Pass it without `&`.
|
|
112
|
+
*/
|
|
113
|
+
var interactiveRow = function interactiveRow(_a) {
|
|
114
|
+
var _b = _a === void 0 ? {} : _a,
|
|
115
|
+
_c = _b.selected,
|
|
116
|
+
selected = _c === void 0 ? false : _c,
|
|
117
|
+
_d = _b.focused,
|
|
118
|
+
focused = _d === void 0 ? false : _d,
|
|
119
|
+
_e = _b.disabled,
|
|
120
|
+
disabled = _e === void 0 ? false : _e,
|
|
121
|
+
textSelector = _b.textSelector;
|
|
122
|
+
var states = selected ? rowStates.selected : rowStates.unselected;
|
|
123
|
+
if (disabled) return "".concat(rowDeclarations(states.rest, textSelector), "\n").concat(rowForcedColors({
|
|
124
|
+
selected: selected,
|
|
125
|
+
focused: focused,
|
|
126
|
+
disabled: disabled,
|
|
127
|
+
textSelector: textSelector
|
|
128
|
+
}));
|
|
129
|
+
return "\n ".concat(rowDeclarations(focused ? states.hover : states.rest, textSelector), "\n\n &:hover {\n ").concat(rowDeclarations(states.hover, textSelector), "\n }\n\n &:active {\n ").concat(rowDeclarations(states.pressed, textSelector), "\n }\n\n ").concat(rowForcedColors({
|
|
130
|
+
selected: selected,
|
|
131
|
+
focused: focused,
|
|
132
|
+
disabled: disabled,
|
|
133
|
+
textSelector: textSelector
|
|
134
|
+
}), "\n");
|
|
135
|
+
};
|
|
136
|
+
// Rows in forced colours (decision 0038): fills are dropped, so a selected row takes the system
|
|
137
|
+
// selection colours, and a hovered or keyboard-active row is outlined in Highlight.
|
|
138
|
+
var rowForcedColors = function rowForcedColors(_a) {
|
|
139
|
+
var selected = _a.selected,
|
|
140
|
+
focused = _a.focused,
|
|
141
|
+
disabled = _a.disabled,
|
|
142
|
+
textSelector = _a.textSelector;
|
|
143
|
+
var text = function text(color) {
|
|
144
|
+
return textSelector ? "color: ".concat(color, ";\n ").concat(textSelector, " { color: ").concat(color, "; }") : "color: ".concat(color, ";");
|
|
145
|
+
};
|
|
146
|
+
var hover = "outline: ".concat(tokens.semantic.border.width.thin, " solid Highlight;\n outline-offset: calc(-1 * ").concat(tokens.semantic.border.width.thin, ");");
|
|
147
|
+
// A row that doesn't respond (disabled, or not interactive at all) keeps its selection but has
|
|
148
|
+
// no hover outline. Disabled text is the component's to colour: callers also pass this for
|
|
149
|
+
// static rows, which must stay CanvasText.
|
|
150
|
+
// A selected row keeps forced-color-adjust: auto: the browser keeps system colours an author
|
|
151
|
+
// sets, so the row stays Highlight with HighlightText. Its descendants' own colours would be
|
|
152
|
+
// forced to CanvasText, so they inherit HighlightText, and anything drawn with a fill inside
|
|
153
|
+
// (a chip or tag as the row's badge) drops it and keeps its edge. The doubled class outranks
|
|
154
|
+
// the descendants' own rules.
|
|
155
|
+
return "".concat(forcedColors, " {\n ").concat(selected ? "background-color: Highlight;\n ".concat(text('HighlightText'), "\n && * {\n color: inherit;\n background-color: transparent;\n }") : '', "\n ").concat(!disabled && focused ? hover : '', "\n ").concat(disabled ? '' : "&:hover {\n ".concat(hover, "\n }"), "\n }");
|
|
156
|
+
};
|
|
157
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
158
|
+
|
|
159
|
+
export { breakpoints, exitAnimation, forcedColors, forcedColorsEdge, interactiveRow, media, reducedMotion, rowStates, visuallyHidden };
|
|
160
|
+
//# sourceMappingURL=styleUtils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleUtils.mjs","sources":["../../src/lib/styleUtils.ts"],"sourcesContent":["import { css, keyframes } from 'styled-components'\nimport tokens from './cssTokens'\n\n// Breakpoints from the semantic tokens (decision 0014)\nexport const breakpoints = {\n xs: tokens.semantic.breakpoint.xs,\n sm: tokens.semantic.breakpoint.sm,\n md: tokens.semantic.breakpoint.md,\n lg: tokens.semantic.breakpoint.lg,\n xl: tokens.semantic.breakpoint.xl,\n '2xl': tokens.semantic.breakpoint['2xl'],\n}\n\n// Media query helpers\nexport const media = {\n xs: `@media (min-width: ${breakpoints.xs})`,\n sm: `@media (min-width: ${breakpoints.sm})`,\n md: `@media (min-width: ${breakpoints.md})`,\n lg: `@media (min-width: ${breakpoints.lg})`,\n xl: `@media (min-width: ${breakpoints.xl})`,\n '2xl': `@media (min-width: ${breakpoints['2xl']})`,\n}\n\n// Windows Contrast Themes and other forced-colours modes (decision 0038). The browser swaps in\n// the user's system colours, drops background colours and box-shadows, and keeps borders and\n// outlines. Inside this query, give a control that shows its edge with a fill alone a border,\n// and draw selected and checked states with system colours: ButtonText for control edges,\n// Highlight and HighlightText for selected and checked, GrayText for disabled, CanvasText for\n// content. Use forced-color-adjust: none only on a fill that carries state.\nexport const forcedColors = '@media (forced-colors: active)'\n\n/** A control's edge in forced colours, for a control that shows its edge with a fill alone. The\n * border follows the text colour the browser picks: ButtonText, LinkText, or GrayText when disabled. */\nexport const forcedColorsEdge = `${forcedColors} {\n border: ${tokens.semantic.border.width.thin} solid currentColor;\n}`\n\n// Wrap fallbacks for people who ask for less motion (decision 0005): movement becomes\n// an instant change or a simple fade. Colour and opacity transitions need no fallback.\nexport const reducedMotion = '@media (prefers-reduced-motion: reduce)'\n\n// No `from` keyframe: the fade starts from the element's current opacity, including a\n// still-running entrance, so closing mid-entrance doesn't jump back to fully visible.\nconst fadeOut = keyframes`\n to { opacity: 0; }\n`\n\n// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of\n// the element's `animation` declarations while it exits: the entrance stays in the list,\n// so it isn't restarted, and the fade runs on top of it. A fade is already the\n// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop\n// still catches clicks (so they can't reach the page behind it) and the panel is inert.\n// Exits accelerate: things leaving speed up as they go (decision 0037).\nexport const exitAnimation = css`, ${fadeOut} ${tokens.semantic.motion.duration.fast} ${tokens.semantic.motion.easing.accelerate} forwards`\n\n// Content for screen readers only. The 1px size and -1px margin are part of the standard\n// visually-hidden technique, not design values, so they aren't tokens.\nexport const visuallyHidden = css`\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n`\n\n// One interaction pattern for rows and items: list items, menu and listbox options, sidebars\n// (decision 0030). Unselected rows follow the naked Button's ladder; selected rows follow the\n// light-blue selected ladder, with the text darkening with its fill (decision 0016). Unselected\n// rows leave their text colour to the component, so a destructive row can stay red.\nconst { fill: rowFill, text: rowText } = tokens.semantic.color\n\nexport interface RowState {\n background: string\n text?: string\n}\n\nexport const rowStates: Record<'unselected' | 'selected', Record<'rest' | 'hover' | 'pressed', RowState>> = {\n unselected: {\n rest: { background: 'transparent' },\n hover: { background: rowFill.muted },\n pressed: { background: rowFill.default },\n },\n selected: {\n rest: { background: rowFill['accent-muted'], text: rowText.accent },\n hover: { background: rowFill['accent-muted-hover'], text: rowText['accent-hover'] },\n pressed: { background: rowFill['accent-muted-pressed'], text: rowText['accent-pressed'] },\n },\n}\n\nconst rowDeclarations = ({ background, text }: RowState, textSelector?: string) => {\n if (!text) return `background-color: ${background};`\n return textSelector\n ? `background-color: ${background};\\n ${textSelector} { color: ${text}; }`\n : `background-color: ${background};\\n color: ${text};`\n}\n\n/**\n * The background (and, when selected, text) of an interactive row in every state.\n * - `focused`: keyboard focus that isn't DOM focus, such as a listbox option under\n * aria-activedescendant. It shows the hover state.\n * - `disabled`: shows the resting state, with no hover or press.\n * - `textSelector`: a descendant to colour when the row's text isn't the row itself, for example\n * text set by Typography. Pass it without `&`.\n */\nexport const interactiveRow = ({\n selected = false,\n focused = false,\n disabled = false,\n textSelector,\n}: {\n selected?: boolean\n focused?: boolean\n disabled?: boolean\n textSelector?: string\n} = {}) => {\n const states = selected ? rowStates.selected : rowStates.unselected\n if (disabled) return `${rowDeclarations(states.rest, textSelector)}\\n${rowForcedColors({ selected, focused, disabled, textSelector })}`\n return `\n ${rowDeclarations(focused ? states.hover : states.rest, textSelector)}\n\n &:hover {\n ${rowDeclarations(states.hover, textSelector)}\n }\n\n &:active {\n ${rowDeclarations(states.pressed, textSelector)}\n }\n\n ${rowForcedColors({ selected, focused, disabled, textSelector })}\n`\n}\n\n// Rows in forced colours (decision 0038): fills are dropped, so a selected row takes the system\n// selection colours, and a hovered or keyboard-active row is outlined in Highlight.\nconst rowForcedColors = ({\n selected,\n focused,\n disabled,\n textSelector,\n}: {\n selected: boolean\n focused: boolean\n disabled: boolean\n textSelector?: string\n}) => {\n const text = (color: string) => (textSelector ? `color: ${color};\\n ${textSelector} { color: ${color}; }` : `color: ${color};`)\n const hover = `outline: ${tokens.semantic.border.width.thin} solid Highlight;\\n outline-offset: calc(-1 * ${tokens.semantic.border.width.thin});`\n // A row that doesn't respond (disabled, or not interactive at all) keeps its selection but has\n // no hover outline. Disabled text is the component's to colour: callers also pass this for\n // static rows, which must stay CanvasText.\n // A selected row keeps forced-color-adjust: auto: the browser keeps system colours an author\n // sets, so the row stays Highlight with HighlightText. Its descendants' own colours would be\n // forced to CanvasText, so they inherit HighlightText, and anything drawn with a fill inside\n // (a chip or tag as the row's badge) drops it and keeps its edge. The doubled class outranks\n // the descendants' own rules.\n return `${forcedColors} {\n ${selected ? `background-color: Highlight;\\n ${text('HighlightText')}\\n && * {\\n color: inherit;\\n background-color: transparent;\\n }` : ''}\n ${!disabled && focused ? hover : ''}\n ${disabled ? '' : `&:hover {\\n ${hover}\\n }`}\n }`\n}\n"],"names":["breakpoints","xs","tokens","semantic","breakpoint","sm","md","lg","xl","media","concat","forcedColors","forcedColorsEdge","border","width","thin","reducedMotion","fadeOut","keyframes","templateObject_1","__makeTemplateObject","exitAnimation","css","templateObject_2","motion","duration","fast","easing","accelerate","visuallyHidden","_a","color","rowFill","fill","rowText","text","rowStates","unselected","rest","background","hover","muted","pressed","selected","accent","rowDeclarations","textSelector","interactiveRow","_b","_c","_d","focused","_e","disabled","states","rowForcedColors"],"mappings":";;;;;AAGA;AACO,IAAMA,WAAW,GAAG;AACzBC,EAAAA,EAAE,EAAEC,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACH,EAAE;AACjCI,EAAAA,EAAE,EAAEH,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACC,EAAE;AACjCC,EAAAA,EAAE,EAAEJ,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACE,EAAE;AACjCC,EAAAA,EAAE,EAAEL,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACG,EAAE;AACjCC,EAAAA,EAAE,EAAEN,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACI,EAAE;AACjC,EAAA,KAAK,EAAEN,MAAM,CAACC,QAAQ,CAACC,UAAU,CAAC,KAAK,CAAA;EACxC;AAED;AACO,IAAMK,KAAK,GAAG;EACnBR,EAAE,EAAE,qBAAA,CAAAS,MAAA,CAAsBV,WAAW,CAACC,EAAE,EAAG,GAAA,CAAA;EAC3CI,EAAE,EAAE,qBAAA,CAAAK,MAAA,CAAsBV,WAAW,CAACK,EAAE,EAAG,GAAA,CAAA;EAC3CC,EAAE,EAAE,qBAAA,CAAAI,MAAA,CAAsBV,WAAW,CAACM,EAAE,EAAG,GAAA,CAAA;EAC3CC,EAAE,EAAE,qBAAA,CAAAG,MAAA,CAAsBV,WAAW,CAACO,EAAE,EAAG,GAAA,CAAA;EAC3CC,EAAE,EAAE,qBAAA,CAAAE,MAAA,CAAsBV,WAAW,CAACQ,EAAE,EAAG,GAAA,CAAA;EAC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AAC,qFAAkF,GAAG,EAAE,EAAA,QAAA,CAAA,CAAAzB,MAAA,CAC5J,CAAC2C,QAAQ,IAAIF,OAAO,GAAGX,KAAK,GAAG,EAAE,mBACjCa,QAAQ,GAAG,EAAE,GAAG,2BAAoBb,KAAK,EAAA,SAAA,CAAS,UACpD,CAAA;AACJ,CAAC,CAAA;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Tokens } from '../types/tokens.mjs';
|
|
2
|
+
type Semantic = Tokens['semantic'];
|
|
3
|
+
/** Box's spacing props (`p`, `m`, `gap`…): the old layout scale's keys, read from `space`. */
|
|
4
|
+
export declare const spaceByLayoutKey: Record<keyof Semantic['spacing']['layout'], string>;
|
|
5
|
+
/** Box's `borderRadius` prop: the old radius keys, read from `radius`. */
|
|
6
|
+
export declare const radiusByKey: Record<keyof Semantic['border']['radius'], string>;
|
|
7
|
+
/** Box's `bg` prop: the old background keys, read from `surface` and `color.fill`. */
|
|
8
|
+
export declare const backgroundByKey: Record<keyof Semantic['color']['background'], string>;
|
|
9
|
+
/** Box's `color` prop: text colours, old and new keys. */
|
|
10
|
+
export declare const textColorByKey: Record<keyof Semantic['color']['text'], string>;
|
|
11
|
+
/** Box's border props: border colours, old and new keys. */
|
|
12
|
+
export declare const borderColorByKey: Record<keyof Semantic['color']['border'], string>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import tokens from './cssTokens.mjs';
|
|
3
|
+
|
|
4
|
+
// Props whose values are token keys keep their published vocabulary in 2.x (P7), but read the
|
|
5
|
+
// semantic grammar's names (decision 0031, #189). Each map covers every key the prop type allows,
|
|
6
|
+
// so TypeScript fails here if a key is added without a mapping.
|
|
7
|
+
var semantic = tokens.semantic;
|
|
8
|
+
var color = semantic.color,
|
|
9
|
+
space = semantic.space,
|
|
10
|
+
radius = semantic.radius,
|
|
11
|
+
surface = semantic.surface;
|
|
12
|
+
/** Box's spacing props (`p`, `m`, `gap`…): the old layout scale's keys, read from `space`. */
|
|
13
|
+
var spaceByLayoutKey = {
|
|
14
|
+
none: space[0],
|
|
15
|
+
xs: space[100],
|
|
16
|
+
sm: space[200],
|
|
17
|
+
md: space[300],
|
|
18
|
+
lg: space[400],
|
|
19
|
+
xl: space[500],
|
|
20
|
+
'2xl': space[600],
|
|
21
|
+
'3xl': space[700],
|
|
22
|
+
'4xl': space[800],
|
|
23
|
+
'5xl': space[900],
|
|
24
|
+
'6xl': space[1000],
|
|
25
|
+
'7xl': space[1200],
|
|
26
|
+
'8xl': space[1400],
|
|
27
|
+
'9xl': space[1600],
|
|
28
|
+
'10xl': space[2000],
|
|
29
|
+
'11xl': space[2400],
|
|
30
|
+
// A keyword, not a step: it stays until the keyword question is settled (0031)
|
|
31
|
+
auto: semantic.spacing.layout.auto
|
|
32
|
+
};
|
|
33
|
+
/** Box's `borderRadius` prop: the old radius keys, read from `radius`. */
|
|
34
|
+
var radiusByKey = {
|
|
35
|
+
none: radius.none,
|
|
36
|
+
xs: radius.xs,
|
|
37
|
+
sm: radius.sm,
|
|
38
|
+
md: radius.md,
|
|
39
|
+
lg: radius.lg,
|
|
40
|
+
xl: radius.xl,
|
|
41
|
+
'2xl': radius['2xl'],
|
|
42
|
+
'3xl': radius['3xl'],
|
|
43
|
+
circle: radius.full
|
|
44
|
+
};
|
|
45
|
+
/** Box's `bg` prop: the old background keys, read from `surface` and `color.fill`. */
|
|
46
|
+
var backgroundByKey = {
|
|
47
|
+
"default": surface.base,
|
|
48
|
+
page: surface.base,
|
|
49
|
+
subtle: surface.raised,
|
|
50
|
+
overlay: surface.scrim,
|
|
51
|
+
emphasis: color.fill.emphasis,
|
|
52
|
+
'emphasis-hover': color.fill['emphasis-hover'],
|
|
53
|
+
'emphasis-active': color.fill['emphasis-pressed'],
|
|
54
|
+
surface: color.fill.muted,
|
|
55
|
+
inverse: color.fill.inverse,
|
|
56
|
+
interactive: color.fill.accent,
|
|
57
|
+
'interactive-hover': color.fill['accent-hover'],
|
|
58
|
+
'interactive-active': color.fill['accent-pressed'],
|
|
59
|
+
'interactive-subtle': color.fill['accent-muted'],
|
|
60
|
+
'interactive-subtle-hover': color.fill['accent-muted-hover'],
|
|
61
|
+
'interactive-subtle-active': color.fill['accent-muted-pressed'],
|
|
62
|
+
error: color.fill.danger,
|
|
63
|
+
'error-hover': color.fill['danger-hover'],
|
|
64
|
+
'error-active': color.fill['danger-pressed'],
|
|
65
|
+
'error-subtle': color.fill['danger-muted'],
|
|
66
|
+
success: color.fill.success,
|
|
67
|
+
'success-subtle': color.fill['success-muted'],
|
|
68
|
+
warning: color.fill.warning,
|
|
69
|
+
'warning-subtle': color.fill['warning-muted'],
|
|
70
|
+
disabled: color.fill.disabled,
|
|
71
|
+
neutral: color.fill["default"],
|
|
72
|
+
'neutral-hover': color.fill['default-hover'],
|
|
73
|
+
'neutral-active': color.fill['default-pressed'],
|
|
74
|
+
transparent: color.fill.none,
|
|
75
|
+
'hover-overlay': color.fill['none-hover'],
|
|
76
|
+
'active-overlay': color.fill['none-pressed'],
|
|
77
|
+
'inverse-overlay': color.fill['inverse-none-hover'],
|
|
78
|
+
// Moved to the component tier (decision 0031 §6)
|
|
79
|
+
progressTrack: tokens.component.track.background
|
|
80
|
+
};
|
|
81
|
+
/** Box's `color` prop: text colours, old and new keys. */
|
|
82
|
+
var textColorByKey = {
|
|
83
|
+
"default": color.text["default"],
|
|
84
|
+
emphasis: color.text.emphasis,
|
|
85
|
+
inverse: color.text.inverse,
|
|
86
|
+
disabled: color.text.disabled,
|
|
87
|
+
success: color.text.success,
|
|
88
|
+
warning: color.text.warning,
|
|
89
|
+
muted: color.text.muted,
|
|
90
|
+
accent: color.text.accent,
|
|
91
|
+
'accent-hover': color.text['accent-hover'],
|
|
92
|
+
'accent-pressed': color.text['accent-pressed'],
|
|
93
|
+
danger: color.text.danger,
|
|
94
|
+
ai: color.text.ai,
|
|
95
|
+
subdued: color.text.muted,
|
|
96
|
+
interactive: color.text.accent,
|
|
97
|
+
'interactive-hover': color.text['accent-hover'],
|
|
98
|
+
'interactive-active': color.text['accent-pressed'],
|
|
99
|
+
error: color.text.danger
|
|
100
|
+
};
|
|
101
|
+
/** Box's border props: border colours, old and new keys. */
|
|
102
|
+
var borderColorByKey = {
|
|
103
|
+
"default": color.border["default"],
|
|
104
|
+
success: color.border.success,
|
|
105
|
+
warning: color.border.warning,
|
|
106
|
+
none: color.border.none,
|
|
107
|
+
emphasis: color.border.emphasis,
|
|
108
|
+
input: color.border.input,
|
|
109
|
+
'input-hover': color.border['input-hover'],
|
|
110
|
+
focus: color.border.focus,
|
|
111
|
+
accent: color.border.accent,
|
|
112
|
+
danger: color.border.danger,
|
|
113
|
+
subtle: color.border.emphasis,
|
|
114
|
+
control: color.border.input,
|
|
115
|
+
// `strong` split by use (0031); as a generic firm outline it is the hovered-input border
|
|
116
|
+
strong: color.border['input-hover'],
|
|
117
|
+
interactive: color.border.accent,
|
|
118
|
+
error: color.border.danger
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export { backgroundByKey, borderColorByKey, radiusByKey, spaceByLayoutKey, textColorByKey };
|
|
122
|
+
//# sourceMappingURL=tokenAliases.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenAliases.mjs","sources":["../../src/lib/tokenAliases.ts"],"sourcesContent":["import tokens from './cssTokens'\nimport type { Tokens } from '../types/tokens'\n\n// Props whose values are token keys keep their published vocabulary in 2.x (P7), but read the\n// semantic grammar's names (decision 0031, #189). Each map covers every key the prop type allows,\n// so TypeScript fails here if a key is added without a mapping.\nconst { semantic } = tokens\nconst { color, space, radius, surface } = semantic\n\ntype Semantic = Tokens['semantic']\n\n/** Box's spacing props (`p`, `m`, `gap`…): the old layout scale's keys, read from `space`. */\nexport const spaceByLayoutKey: Record<keyof Semantic['spacing']['layout'], string> = {\n none: space[0],\n xs: space[100],\n sm: space[200],\n md: space[300],\n lg: space[400],\n xl: space[500],\n '2xl': space[600],\n '3xl': space[700],\n '4xl': space[800],\n '5xl': space[900],\n '6xl': space[1000],\n '7xl': space[1200],\n '8xl': space[1400],\n '9xl': space[1600],\n '10xl': space[2000],\n '11xl': space[2400],\n // A keyword, not a step: it stays until the keyword question is settled (0031)\n auto: semantic.spacing.layout.auto,\n}\n\n/** Box's `borderRadius` prop: the old radius keys, read from `radius`. */\nexport const radiusByKey: Record<keyof Semantic['border']['radius'], string> = {\n none: radius.none,\n xs: radius.xs,\n sm: radius.sm,\n md: radius.md,\n lg: radius.lg,\n xl: radius.xl,\n '2xl': radius['2xl'],\n '3xl': radius['3xl'],\n circle: radius.full,\n}\n\n/** Box's `bg` prop: the old background keys, read from `surface` and `color.fill`. */\nexport const backgroundByKey: Record<keyof Semantic['color']['background'], string> = {\n default: surface.base,\n page: surface.base,\n subtle: surface.raised,\n overlay: surface.scrim,\n emphasis: color.fill.emphasis,\n 'emphasis-hover': color.fill['emphasis-hover'],\n 'emphasis-active': color.fill['emphasis-pressed'],\n surface: color.fill.muted,\n inverse: color.fill.inverse,\n interactive: color.fill.accent,\n 'interactive-hover': color.fill['accent-hover'],\n 'interactive-active': color.fill['accent-pressed'],\n 'interactive-subtle': color.fill['accent-muted'],\n 'interactive-subtle-hover': color.fill['accent-muted-hover'],\n 'interactive-subtle-active': color.fill['accent-muted-pressed'],\n error: color.fill.danger,\n 'error-hover': color.fill['danger-hover'],\n 'error-active': color.fill['danger-pressed'],\n 'error-subtle': color.fill['danger-muted'],\n success: color.fill.success,\n 'success-subtle': color.fill['success-muted'],\n warning: color.fill.warning,\n 'warning-subtle': color.fill['warning-muted'],\n disabled: color.fill.disabled,\n neutral: color.fill.default,\n 'neutral-hover': color.fill['default-hover'],\n 'neutral-active': color.fill['default-pressed'],\n transparent: color.fill.none,\n 'hover-overlay': color.fill['none-hover'],\n 'active-overlay': color.fill['none-pressed'],\n 'inverse-overlay': color.fill['inverse-none-hover'],\n // Moved to the component tier (decision 0031 §6)\n progressTrack: tokens.component.track.background,\n}\n\n/** Box's `color` prop: text colours, old and new keys. */\nexport const textColorByKey: Record<keyof Semantic['color']['text'], string> = {\n default: color.text.default,\n emphasis: color.text.emphasis,\n inverse: color.text.inverse,\n disabled: color.text.disabled,\n success: color.text.success,\n warning: color.text.warning,\n muted: color.text.muted,\n accent: color.text.accent,\n 'accent-hover': color.text['accent-hover'],\n 'accent-pressed': color.text['accent-pressed'],\n danger: color.text.danger,\n ai: color.text.ai,\n subdued: color.text.muted,\n interactive: color.text.accent,\n 'interactive-hover': color.text['accent-hover'],\n 'interactive-active': color.text['accent-pressed'],\n error: color.text.danger,\n}\n\n/** Box's border props: border colours, old and new keys. */\nexport const borderColorByKey: Record<keyof Semantic['color']['border'], string> = {\n default: color.border.default,\n success: color.border.success,\n warning: color.border.warning,\n none: color.border.none,\n emphasis: color.border.emphasis,\n input: color.border.input,\n 'input-hover': color.border['input-hover'],\n focus: color.border.focus,\n accent: color.border.accent,\n danger: color.border.danger,\n subtle: color.border.emphasis,\n control: color.border.input,\n // `strong` split by use (0031); as a generic firm outline it is the hovered-input border\n strong: color.border['input-hover'],\n interactive: color.border.accent,\n error: color.border.danger,\n}\n"],"names":["semantic","tokens","color","space","radius","surface","spaceByLayoutKey","none","xs","sm","md","lg","xl","auto","spacing","layout","radiusByKey","circle","full","backgroundByKey","base","page","subtle","raised","overlay","scrim","emphasis","fill","muted","inverse","interactive","accent","error","danger","success","warning","disabled","neutral","transparent","progressTrack","component","track","background","textColorByKey","text","ai","subdued","borderColorByKey","border","input","focus","control","strong"],"mappings":";;;AAGA;AACA;AACA;AACQ,IAAAA,QAAQ,GAAKC,MAAM,CAAAD,QAAX,CAAA;AACR,IAAAE,KAAK,GAA6BF,QAAQ,MAArC;EAAEG,KAAK,GAAsBH,QAAQ,CAAAG,KAA9B;EAAEC,MAAM,GAAcJ,QAAQ,CAAtBI,MAAA;EAAEC,OAAO,GAAKL,QAAQ,QAAb,CAAA;AAIrC;AACO,IAAMM,gBAAgB,GAAwD;AACnFC,EAAA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A,KAAK,EAAEhD,KAAK,CAAC8C,MAAM,CAACE,KAAK;AACzBnB,EAAAA,MAAM,EAAE7B,KAAK,CAAC8C,MAAM,CAACjB,MAAM;AAC3BE,EAAAA,MAAM,EAAE/B,KAAK,CAAC8C,MAAM,CAACf,MAAM;AAC3BX,EAAAA,MAAM,EAAEpB,KAAK,CAAC8C,MAAM,CAACtB,QAAQ;AAC7ByB,EAAAA,OAAO,EAAEjD,KAAK,CAAC8C,MAAM,CAACC,KAAK;AAC3B;AACAG,EAAAA,MAAM,EAAElD,KAAK,CAAC8C,MAAM,CAAC,aAAa,CAAC;AACnClB,EAAAA,WAAW,EAAE5B,KAAK,CAAC8C,MAAM,CAACjB,MAAM;AAChCC,EAAAA,KAAK,EAAE9B,KAAK,CAAC8C,MAAM,CAACf,MAAAA;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
export declare const EXIT_DURATION_MS: number;
|
|
3
|
+
/**
|
|
4
|
+
* Keeps an element mounted for `exitMs` after `isOpen` turns false, so its exit
|
|
5
|
+
* animation can run before it unmounts (decision 0005).
|
|
6
|
+
*/
|
|
7
|
+
export declare function usePresence(isOpen: boolean, exitMs?: number): {
|
|
8
|
+
isPresent: boolean;
|
|
9
|
+
isExiting: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Makes an element inert while `isInert` is true, so an exiting overlay's controls leave
|
|
13
|
+
* the tab order and can't be activated. Set through the DOM because React 18 has no
|
|
14
|
+
* `inert` prop.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useInert(ref: RefObject<HTMLElement | null>, isInert: boolean): void;
|