@common-origin/design-system 2.18.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 +1122 -785
- 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/types.d.ts +3 -1
- package/dist/components/atoms/Chip/shared/utils.d.mts +10 -0
- package/dist/components/atoms/Chip/shared/utils.d.ts +2 -3
- 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/data.js +261 -14
- package/dist/data.js.map +1 -1
- 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.d.ts +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.d.ts +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.d.ts +23 -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.d.ts +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 -1219
- package/dist/styles/icons.json.mjs.map +1 -0
- package/dist/styles/tokens.d.mts +3174 -0
- package/dist/styles/tokens.d.ts +3174 -0
- package/dist/styles/tokens.json +257 -12
- package/dist/{tokens/index.esm.js → styles/tokens.json.mjs} +259 -20
- package/dist/{tokens/index.esm.js.map → styles/tokens.json.mjs.map} +1 -1
- package/dist/tokens/index.js +261 -14
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/index.mjs +1462 -0
- package/dist/tokens/index.mjs.map +1 -0
- package/dist/tokens/styles/tokens.d.mts +3174 -0
- package/dist/tokens/styles/tokens.d.ts +3174 -0
- package/dist/tokens/tokens.d.mts +4 -0
- package/dist/tokens/types/tokens.d.mts +6 -0
- package/dist/tokens/types/tokens.d.ts +3 -1204
- package/dist/tokens.css +710 -430
- 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.d.ts +3 -1204
- 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 +29 -13
- package/dist/client.esm.js +0 -7952
- 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,103 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject, __rest, __assign } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import styled$module from 'styled-components';
|
|
6
|
+
const styled = styled$module.default || styled$module;
|
|
7
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
8
|
+
|
|
9
|
+
// Destructure tokens
|
|
10
|
+
var semantic = tokens.semantic;
|
|
11
|
+
var initials = tokens.component.avatar.initials;
|
|
12
|
+
var color = semantic.color,
|
|
13
|
+
size = semantic.size;
|
|
14
|
+
var radius = semantic.radius;
|
|
15
|
+
var AvatarContainer = /*#__PURE__*/styled.div.withConfig({
|
|
16
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
17
|
+
return !prop.startsWith('$');
|
|
18
|
+
},
|
|
19
|
+
displayName: "Avatar__AvatarContainer",
|
|
20
|
+
componentId: "sc-ezn4ax-0"
|
|
21
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n overflow: hidden;\n flex-shrink: 0;\n"], ["\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n overflow: hidden;\n flex-shrink: 0;\n"])), function (_a) {
|
|
22
|
+
var $size = _a.$size;
|
|
23
|
+
return size.avatar[$size];
|
|
24
|
+
}, function (_a) {
|
|
25
|
+
var $size = _a.$size;
|
|
26
|
+
return size.avatar[$size];
|
|
27
|
+
}, radius.full, color.fill.muted);
|
|
28
|
+
var AvatarImage = /*#__PURE__*/styled.img.withConfig({
|
|
29
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
30
|
+
return !prop.startsWith('$');
|
|
31
|
+
},
|
|
32
|
+
displayName: "Avatar__AvatarImage",
|
|
33
|
+
componentId: "sc-ezn4ax-1"
|
|
34
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: ", ";\n /* Remove the img role since the container already has role=\"img\" */\n"], ["\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: ", ";\n /* Remove the img role since the container already has role=\"img\" */\n"])), radius.full);
|
|
35
|
+
var AvatarInitials = /*#__PURE__*/styled.span.withConfig({
|
|
36
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
37
|
+
return !prop.startsWith('$');
|
|
38
|
+
},
|
|
39
|
+
displayName: "Avatar__AvatarInitials",
|
|
40
|
+
componentId: "sc-ezn4ax-2"
|
|
41
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n color: ", ";\n line-height: ", ";\n text-transform: uppercase;\n user-select: none;\n"], ["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n color: ", ";\n line-height: ", ";\n text-transform: uppercase;\n user-select: none;\n"
|
|
42
|
+
// Helper function to get initials from name
|
|
43
|
+
])), initials.fontFamily, initials.fontWeight, function (_a) {
|
|
44
|
+
var $size = _a.$size;
|
|
45
|
+
return initials.fontSize[$size];
|
|
46
|
+
}, color.text["default"], initials.lineHeight);
|
|
47
|
+
// Helper function to get initials from name
|
|
48
|
+
var getInitials = function getInitials(name) {
|
|
49
|
+
return name.split(' ').map(function (word) {
|
|
50
|
+
return word.charAt(0);
|
|
51
|
+
}).join('').slice(0, 2).toUpperCase();
|
|
52
|
+
};
|
|
53
|
+
var Avatar = function Avatar(_a) {
|
|
54
|
+
var name = _a.name,
|
|
55
|
+
picture = _a.picture,
|
|
56
|
+
_b = _a.size,
|
|
57
|
+
size = _b === void 0 ? 'md' : _b,
|
|
58
|
+
dataTestId = _a["data-testid"],
|
|
59
|
+
props = __rest(_a, ["name", "picture", "size", 'data-testid']);
|
|
60
|
+
// Remove styled-only props from the rest
|
|
61
|
+
var _c = props;
|
|
62
|
+
_c.$size;
|
|
63
|
+
var htmlProps = __rest(_c, ["$size"]);
|
|
64
|
+
var _d = useState(false),
|
|
65
|
+
imageError = _d[0],
|
|
66
|
+
setImageError = _d[1];
|
|
67
|
+
var _e = useState(false),
|
|
68
|
+
imageLoaded = _e[0],
|
|
69
|
+
setImageLoaded = _e[1];
|
|
70
|
+
var handleImageError = function handleImageError() {
|
|
71
|
+
setImageError(true);
|
|
72
|
+
};
|
|
73
|
+
var handleImageLoad = function handleImageLoad() {
|
|
74
|
+
setImageLoaded(true);
|
|
75
|
+
};
|
|
76
|
+
var showImage = picture && !imageError;
|
|
77
|
+
var initials = getInitials(name);
|
|
78
|
+
return jsx(AvatarContainer, __assign({
|
|
79
|
+
"$size": size,
|
|
80
|
+
"data-testid": dataTestId,
|
|
81
|
+
"data-size": size,
|
|
82
|
+
role: "img",
|
|
83
|
+
"aria-label": "Avatar for ".concat(name)
|
|
84
|
+
}, htmlProps, {
|
|
85
|
+
children: showImage ? jsx(AvatarImage, {
|
|
86
|
+
"$size": size,
|
|
87
|
+
src: picture,
|
|
88
|
+
alt: "Avatar of ".concat(name),
|
|
89
|
+
onError: handleImageError,
|
|
90
|
+
onLoad: handleImageLoad,
|
|
91
|
+
"data-state": imageLoaded ? 'loaded' : 'loading'
|
|
92
|
+
}) : jsx(AvatarInitials, {
|
|
93
|
+
"$size": size,
|
|
94
|
+
"data-initials": initials,
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
children: initials
|
|
97
|
+
})
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
100
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
101
|
+
|
|
102
|
+
export { Avatar };
|
|
103
|
+
//# sourceMappingURL=Avatar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Avatar.mjs';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BadgeProps {
|
|
3
|
+
/** Content to wrap with the badge */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Number to display in the badge. If 0, badge is hidden */
|
|
6
|
+
count?: number;
|
|
7
|
+
/** Maximum number to display before showing "99+" */
|
|
8
|
+
max?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Visual variant of the badge. `accent` is the blue highlight. `primary` is a deprecated alias
|
|
11
|
+
* for `accent`, because Button's `primary` is near-black (decision 0029). It keeps working
|
|
12
|
+
* until it is removed in 3.0.
|
|
13
|
+
* @default 'default'
|
|
14
|
+
*/
|
|
15
|
+
variant?: 'default' | 'accent' | 'primary' | 'error' | 'warning' | 'success';
|
|
16
|
+
/** Show only a dot indicator instead of count */
|
|
17
|
+
dot?: boolean;
|
|
18
|
+
/** Screen reader label for the badge */
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
/** Additional CSS class */
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Test identifier for automated testing */
|
|
23
|
+
'data-testid'?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const Badge: React.FC<BadgeProps>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import styled$module, { keyframes } from 'styled-components';
|
|
5
|
+
const styled = styled$module.default || styled$module;
|
|
6
|
+
import { reducedMotion, forcedColors, visuallyHidden } from '../../../lib/styleUtils.mjs';
|
|
7
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
8
|
+
import { Typography } from '../Typography/Typography.mjs';
|
|
9
|
+
|
|
10
|
+
var semantic = tokens.semantic;
|
|
11
|
+
var color = semantic.color;
|
|
12
|
+
var radius = semantic.radius;
|
|
13
|
+
var _a = tokens.component.badge,
|
|
14
|
+
dot = _a.dot,
|
|
15
|
+
count = _a.count,
|
|
16
|
+
ring = _a.ring;
|
|
17
|
+
var scaleIn = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n from {\n transform: scale(0.8);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n"], ["\n from {\n transform: scale(0.8);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n"])));
|
|
18
|
+
var BadgeWrapper = /*#__PURE__*/styled.span.withConfig({
|
|
19
|
+
displayName: "Badge__BadgeWrapper",
|
|
20
|
+
componentId: "sc-tjz4pp-0"
|
|
21
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n vertical-align: middle;\n flex-shrink: 0;\n"], ["\n position: relative;\n display: inline-flex;\n vertical-align: middle;\n flex-shrink: 0;\n"])));
|
|
22
|
+
var BadgeIndicator = /*#__PURE__*/styled.span.withConfig({
|
|
23
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
24
|
+
return !prop.startsWith('$');
|
|
25
|
+
},
|
|
26
|
+
displayName: "Badge__BadgeIndicator",
|
|
27
|
+
componentId: "sc-tjz4pp-1"
|
|
28
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: ", ";\n align-items: center;\n justify-content: center;\n min-width: ", ";\n height: ", ";\n padding: ", ";\n border-radius: ", ";\n line-height: ", ";\n white-space: nowrap;\n box-shadow: 0 0 0 ", " ", ";\n animation: ", " ", " ", ";\n\n ", " {\n animation: none;\n }\n\n /* Forced colours drop fills (decision 0038): a dot is only a fill, so it keeps one in the\n text colour; a count gets an edge around its number */\n ", "\n \n ", "\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: ", ";\n align-items: center;\n justify-content: center;\n min-width: ", ";\n height: ", ";\n padding: ", ";\n border-radius: ", ";\n line-height: ", ";\n white-space: nowrap;\n box-shadow: 0 0 0 ", " ", ";\n animation: ", " ", " ", ";\n\n ", " {\n animation: none;\n }\n\n /* Forced colours drop fills (decision 0038): a dot is only a fill, so it keeps one in the\n text colour; a count gets an edge around its number */\n ", "\n \n ", "\n"])), function (props) {
|
|
29
|
+
return props.$isVisible ? 'flex' : 'none';
|
|
30
|
+
}, function (props) {
|
|
31
|
+
return props.$isDot ? dot.size : count.minWidth;
|
|
32
|
+
}, function (props) {
|
|
33
|
+
return props.$isDot ? dot.size : count.height;
|
|
34
|
+
}, function (props) {
|
|
35
|
+
return props.$isDot ? '0' : "0 ".concat(semantic.space.inset.xs);
|
|
36
|
+
}, radius.full, count.lineHeight, ring.width, semantic.surface.base, scaleIn, semantic.motion.duration.moderate, semantic.motion.easing.decelerate, reducedMotion, function (props) {
|
|
37
|
+
return props.$isDot ? "".concat(forcedColors, " { forced-color-adjust: none; background-color: CanvasText; }") : "".concat(forcedColors, " { border: ").concat(semantic.border.width.thin, " solid currentColor; }");
|
|
38
|
+
}, function (props) {
|
|
39
|
+
switch (props.$variant) {
|
|
40
|
+
case 'accent':
|
|
41
|
+
case 'primary':
|
|
42
|
+
// Deprecated alias for 'accent', removed in 3.0 (#169)
|
|
43
|
+
return "\n background-color: ".concat(color.fill.accent, ";\n color: ").concat(color.text.inverse, ";\n ");
|
|
44
|
+
case 'error':
|
|
45
|
+
return "\n background-color: ".concat(color.fill.danger, ";\n color: ").concat(color.text.inverse, ";\n ");
|
|
46
|
+
case 'warning':
|
|
47
|
+
return "\n background-color: ".concat(color.fill.warning, ";\n color: ").concat(color.text.inverse, ";\n ");
|
|
48
|
+
case 'success':
|
|
49
|
+
return "\n background-color: ".concat(color.fill.success, ";\n color: ").concat(color.text.inverse, ";\n ");
|
|
50
|
+
default:
|
|
51
|
+
return "\n background-color: ".concat(color.fill.emphasis, ";\n color: ").concat(color.text.inverse, ";\n ");
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
var ScreenReaderOnly = /*#__PURE__*/styled.span.withConfig({
|
|
55
|
+
displayName: "Badge__ScreenReaderOnly",
|
|
56
|
+
componentId: "sc-tjz4pp-2"
|
|
57
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), visuallyHidden);
|
|
58
|
+
var Badge = function Badge(_a) {
|
|
59
|
+
var children = _a.children,
|
|
60
|
+
_b = _a.count,
|
|
61
|
+
count = _b === void 0 ? 0 : _b,
|
|
62
|
+
_c = _a.max,
|
|
63
|
+
max = _c === void 0 ? 99 : _c,
|
|
64
|
+
_d = _a.variant,
|
|
65
|
+
variant = _d === void 0 ? 'default' : _d,
|
|
66
|
+
_e = _a.dot,
|
|
67
|
+
dot = _e === void 0 ? false : _e,
|
|
68
|
+
ariaLabel = _a["aria-label"],
|
|
69
|
+
className = _a.className,
|
|
70
|
+
dataTestId = _a["data-testid"];
|
|
71
|
+
var isVisible = dot || count > 0;
|
|
72
|
+
var displayCount = count > max ? "".concat(max, "+") : count.toString();
|
|
73
|
+
// Generate default aria-label if not provided
|
|
74
|
+
var defaultAriaLabel = dot ? 'New notification indicator' : count === 1 ? '1 notification' : "".concat(count, " notifications");
|
|
75
|
+
var label = ariaLabel || defaultAriaLabel;
|
|
76
|
+
return jsxs(BadgeWrapper, {
|
|
77
|
+
className: className,
|
|
78
|
+
"data-testid": dataTestId,
|
|
79
|
+
children: [children, jsxs(BadgeIndicator, {
|
|
80
|
+
"$variant": variant,
|
|
81
|
+
"$isDot": dot,
|
|
82
|
+
"$isVisible": isVisible,
|
|
83
|
+
role: "status",
|
|
84
|
+
"aria-live": "polite",
|
|
85
|
+
children: [!dot && jsx(Typography, {
|
|
86
|
+
variant: "caption",
|
|
87
|
+
color: "inverse",
|
|
88
|
+
children: displayCount
|
|
89
|
+
}), jsx(ScreenReaderOnly, {
|
|
90
|
+
children: label
|
|
91
|
+
})]
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
96
|
+
|
|
97
|
+
export { Badge };
|
|
98
|
+
//# sourceMappingURL=Badge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Tokens } from '../../../types/tokens.mjs';
|
|
3
|
+
export interface BoxProps {
|
|
4
|
+
display?: 'block' | 'inline' | 'inline-block' | 'flex' | 'inline-flex' | 'none';
|
|
5
|
+
flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
6
|
+
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
7
|
+
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
|
|
8
|
+
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
9
|
+
gap?: keyof Tokens['semantic']['spacing']['layout'];
|
|
10
|
+
m?: keyof Tokens['semantic']['spacing']['layout'];
|
|
11
|
+
mt?: keyof Tokens['semantic']['spacing']['layout'];
|
|
12
|
+
mr?: keyof Tokens['semantic']['spacing']['layout'];
|
|
13
|
+
mb?: keyof Tokens['semantic']['spacing']['layout'];
|
|
14
|
+
ml?: keyof Tokens['semantic']['spacing']['layout'];
|
|
15
|
+
mx?: keyof Tokens['semantic']['spacing']['layout'];
|
|
16
|
+
my?: keyof Tokens['semantic']['spacing']['layout'];
|
|
17
|
+
p?: keyof Tokens['semantic']['spacing']['layout'];
|
|
18
|
+
pt?: keyof Tokens['semantic']['spacing']['layout'];
|
|
19
|
+
pr?: keyof Tokens['semantic']['spacing']['layout'];
|
|
20
|
+
pb?: keyof Tokens['semantic']['spacing']['layout'];
|
|
21
|
+
pl?: keyof Tokens['semantic']['spacing']['layout'];
|
|
22
|
+
px?: keyof Tokens['semantic']['spacing']['layout'];
|
|
23
|
+
py?: keyof Tokens['semantic']['spacing']['layout'];
|
|
24
|
+
width?: string;
|
|
25
|
+
height?: string;
|
|
26
|
+
maxWidth?: string;
|
|
27
|
+
maxHeight?: string;
|
|
28
|
+
minWidth?: string;
|
|
29
|
+
minHeight?: string;
|
|
30
|
+
position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
|
|
31
|
+
top?: string;
|
|
32
|
+
right?: string;
|
|
33
|
+
bottom?: string;
|
|
34
|
+
left?: string;
|
|
35
|
+
borderRadius?: keyof Tokens['semantic']['border']['radius'];
|
|
36
|
+
border?: keyof Tokens['semantic']['color']['border'];
|
|
37
|
+
borderTop?: keyof Tokens['semantic']['color']['border'];
|
|
38
|
+
borderRight?: keyof Tokens['semantic']['color']['border'];
|
|
39
|
+
borderBottom?: keyof Tokens['semantic']['color']['border'];
|
|
40
|
+
borderLeft?: keyof Tokens['semantic']['color']['border'];
|
|
41
|
+
bg?: keyof Tokens['semantic']['color']['background'];
|
|
42
|
+
color?: keyof Tokens['semantic']['color']['text'];
|
|
43
|
+
shadow?: keyof Tokens['semantic']['elevation'];
|
|
44
|
+
cursor?: 'auto' | 'default' | 'pointer' | 'wait' | 'text' | 'move' | 'help' | 'not-allowed';
|
|
45
|
+
transition?: string;
|
|
46
|
+
hoverShadow?: keyof Tokens['semantic']['elevation'];
|
|
47
|
+
hoverTransform?: string;
|
|
48
|
+
overflow?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
49
|
+
overflowX?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
50
|
+
overflowY?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
51
|
+
as?: React.ElementType;
|
|
52
|
+
children?: React.ReactNode;
|
|
53
|
+
id?: string;
|
|
54
|
+
style?: React.CSSProperties;
|
|
55
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
56
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
57
|
+
tabIndex?: number;
|
|
58
|
+
role?: string;
|
|
59
|
+
'aria-label'?: string;
|
|
60
|
+
'data-testid'?: string;
|
|
61
|
+
}
|
|
62
|
+
export declare const Box: React.FC<BoxProps>;
|
|
@@ -0,0 +1,246 @@
|
|
|
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, { css } from 'styled-components';
|
|
5
|
+
const styled = styled$module.default || styled$module;
|
|
6
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
7
|
+
import { spaceByLayoutKey, radiusByKey, borderColorByKey, backgroundByKey, textColorByKey } from '../../../lib/tokenAliases.mjs';
|
|
8
|
+
import { reducedMotion } from '../../../lib/styleUtils.mjs';
|
|
9
|
+
|
|
10
|
+
var StyledBox = /*#__PURE__*/styled.div.withConfig({
|
|
11
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
12
|
+
return !prop.startsWith('$');
|
|
13
|
+
},
|
|
14
|
+
displayName: "Box__StyledBox",
|
|
15
|
+
componentId: "sc-aj0jhd-0"
|
|
16
|
+
})(templateObject_51 || (templateObject_51 = __makeTemplateObject(["\n ", "\n \n // Flexbox\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Margin\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Padding\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Size\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Position\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Borders\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Background & Color\n ", "\n ", "\n \n // Elevation (shadow)\n ", "\n \n // Cursor\n ", "\n \n // Transition\n ", "\n \n // Hover states\n ", "\n \n // Overflow\n ", "\n ", "\n ", "\n"], ["\n ", "\n \n // Flexbox\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Margin\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Padding\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Size\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Position\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Borders\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Background & Color\n ", "\n ", "\n \n // Elevation (shadow)\n ", "\n \n // Cursor\n ", "\n \n // Transition\n ", "\n \n // Hover states\n ", "\n \n // Overflow\n ", "\n ", "\n ", "\n"
|
|
17
|
+
// Transform component that maps clean props to $-prefixed props for styled-components
|
|
18
|
+
])), function (props) {
|
|
19
|
+
return props.$display && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["display: ", ";"], ["display: ", ";"])), props.$display);
|
|
20
|
+
}, function (props) {
|
|
21
|
+
return props.$flexDirection && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["flex-direction: ", ";"], ["flex-direction: ", ";"])), props.$flexDirection);
|
|
22
|
+
}, function (props) {
|
|
23
|
+
return props.$justifyContent && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["justify-content: ", ";"], ["justify-content: ", ";"])), props.$justifyContent);
|
|
24
|
+
}, function (props) {
|
|
25
|
+
return props.$alignItems && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["align-items: ", ";"], ["align-items: ", ";"])), props.$alignItems);
|
|
26
|
+
}, function (props) {
|
|
27
|
+
return props.$flexWrap && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["flex-wrap: ", ";"], ["flex-wrap: ", ";"])), props.$flexWrap);
|
|
28
|
+
}, function (props) {
|
|
29
|
+
return props.$gap && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["gap: ", ";"], ["gap: ", ";"])), spaceByLayoutKey[props.$gap]);
|
|
30
|
+
}, function (props) {
|
|
31
|
+
return props.$m && css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["margin: ", ";"], ["margin: ", ";"])), spaceByLayoutKey[props.$m]);
|
|
32
|
+
}, function (props) {
|
|
33
|
+
return props.$mt && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["margin-top: ", ";"], ["margin-top: ", ";"])), spaceByLayoutKey[props.$mt]);
|
|
34
|
+
}, function (props) {
|
|
35
|
+
return props.$mr && css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["margin-right: ", ";"], ["margin-right: ", ";"])), spaceByLayoutKey[props.$mr]);
|
|
36
|
+
}, function (props) {
|
|
37
|
+
return props.$mb && css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["margin-bottom: ", ";"], ["margin-bottom: ", ";"])), spaceByLayoutKey[props.$mb]);
|
|
38
|
+
}, function (props) {
|
|
39
|
+
return props.$ml && css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["margin-left: ", ";"], ["margin-left: ", ";"])), spaceByLayoutKey[props.$ml]);
|
|
40
|
+
}, function (props) {
|
|
41
|
+
return props.$mx && css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n margin-left: ", ";\n margin-right: ", ";\n "], ["\n margin-left: ", ";\n margin-right: ", ";\n "])), spaceByLayoutKey[props.$mx], spaceByLayoutKey[props.$mx]);
|
|
42
|
+
}, function (props) {
|
|
43
|
+
return props.$my && css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), spaceByLayoutKey[props.$my], spaceByLayoutKey[props.$my]);
|
|
44
|
+
}, function (props) {
|
|
45
|
+
return props.$p && css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["padding: ", ";"], ["padding: ", ";"])), spaceByLayoutKey[props.$p]);
|
|
46
|
+
}, function (props) {
|
|
47
|
+
return props.$pt && css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["padding-top: ", ";"], ["padding-top: ", ";"])), spaceByLayoutKey[props.$pt]);
|
|
48
|
+
}, function (props) {
|
|
49
|
+
return props.$pr && css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["padding-right: ", ";"], ["padding-right: ", ";"])), spaceByLayoutKey[props.$pr]);
|
|
50
|
+
}, function (props) {
|
|
51
|
+
return props.$pb && css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["padding-bottom: ", ";"], ["padding-bottom: ", ";"])), spaceByLayoutKey[props.$pb]);
|
|
52
|
+
}, function (props) {
|
|
53
|
+
return props.$pl && css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["padding-left: ", ";"], ["padding-left: ", ";"])), spaceByLayoutKey[props.$pl]);
|
|
54
|
+
}, function (props) {
|
|
55
|
+
return props.$px && css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n padding-left: ", ";\n padding-right: ", ";\n "])), spaceByLayoutKey[props.$px], spaceByLayoutKey[props.$px]);
|
|
56
|
+
}, function (props) {
|
|
57
|
+
return props.$py && css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n "])), spaceByLayoutKey[props.$py], spaceByLayoutKey[props.$py]);
|
|
58
|
+
}, function (props) {
|
|
59
|
+
return props.$width && css(templateObject_21 || (templateObject_21 = __makeTemplateObject(["width: ", ";"], ["width: ", ";"])), props.$width);
|
|
60
|
+
}, function (props) {
|
|
61
|
+
return props.$height && css(templateObject_22 || (templateObject_22 = __makeTemplateObject(["height: ", ";"], ["height: ", ";"])), props.$height);
|
|
62
|
+
}, function (props) {
|
|
63
|
+
return props.$maxWidth && css(templateObject_23 || (templateObject_23 = __makeTemplateObject(["max-width: ", ";"], ["max-width: ", ";"])), props.$maxWidth);
|
|
64
|
+
}, function (props) {
|
|
65
|
+
return props.$maxHeight && css(templateObject_24 || (templateObject_24 = __makeTemplateObject(["max-height: ", ";"], ["max-height: ", ";"])), props.$maxHeight);
|
|
66
|
+
}, function (props) {
|
|
67
|
+
return props.$minWidth && css(templateObject_25 || (templateObject_25 = __makeTemplateObject(["min-width: ", ";"], ["min-width: ", ";"])), props.$minWidth);
|
|
68
|
+
}, function (props) {
|
|
69
|
+
return props.$minHeight && css(templateObject_26 || (templateObject_26 = __makeTemplateObject(["min-height: ", ";"], ["min-height: ", ";"])), props.$minHeight);
|
|
70
|
+
}, function (props) {
|
|
71
|
+
return props.$position && css(templateObject_27 || (templateObject_27 = __makeTemplateObject(["position: ", ";"], ["position: ", ";"])), props.$position);
|
|
72
|
+
}, function (props) {
|
|
73
|
+
return props.$top && css(templateObject_28 || (templateObject_28 = __makeTemplateObject(["top: ", ";"], ["top: ", ";"])), props.$top);
|
|
74
|
+
}, function (props) {
|
|
75
|
+
return props.$right && css(templateObject_29 || (templateObject_29 = __makeTemplateObject(["right: ", ";"], ["right: ", ";"])), props.$right);
|
|
76
|
+
}, function (props) {
|
|
77
|
+
return props.$bottom && css(templateObject_30 || (templateObject_30 = __makeTemplateObject(["bottom: ", ";"], ["bottom: ", ";"])), props.$bottom);
|
|
78
|
+
}, function (props) {
|
|
79
|
+
return props.$left && css(templateObject_31 || (templateObject_31 = __makeTemplateObject(["left: ", ";"], ["left: ", ";"])), props.$left);
|
|
80
|
+
}, function (props) {
|
|
81
|
+
return props.$borderRadius && css(templateObject_32 || (templateObject_32 = __makeTemplateObject(["border-radius: ", ";"], ["border-radius: ", ";"])), radiusByKey[props.$borderRadius]);
|
|
82
|
+
}, function (props) {
|
|
83
|
+
return props.$border && css(templateObject_33 || (templateObject_33 = __makeTemplateObject(["border: ", " solid ", ";"], ["border: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$border]);
|
|
84
|
+
}, function (props) {
|
|
85
|
+
return props.$borderTop && css(templateObject_34 || (templateObject_34 = __makeTemplateObject(["border-top: ", " solid ", ";"], ["border-top: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderTop]);
|
|
86
|
+
}, function (props) {
|
|
87
|
+
return props.$borderRight && css(templateObject_35 || (templateObject_35 = __makeTemplateObject(["border-right: ", " solid ", ";"], ["border-right: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderRight]);
|
|
88
|
+
}, function (props) {
|
|
89
|
+
return props.$borderBottom && css(templateObject_36 || (templateObject_36 = __makeTemplateObject(["border-bottom: ", " solid ", ";"], ["border-bottom: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderBottom]);
|
|
90
|
+
}, function (props) {
|
|
91
|
+
return props.$borderLeft && css(templateObject_37 || (templateObject_37 = __makeTemplateObject(["border-left: ", " solid ", ";"], ["border-left: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderLeft]);
|
|
92
|
+
}, function (props) {
|
|
93
|
+
return props.$bg && css(templateObject_38 || (templateObject_38 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), backgroundByKey[props.$bg]);
|
|
94
|
+
}, function (props) {
|
|
95
|
+
return props.$color && css(templateObject_39 || (templateObject_39 = __makeTemplateObject(["color: ", ";"], ["color: ", ";"])), textColorByKey[props.$color]);
|
|
96
|
+
}, function (props) {
|
|
97
|
+
return props.$shadow && css(templateObject_40 || (templateObject_40 = __makeTemplateObject(["box-shadow: ", ";"], ["box-shadow: ", ";"])), tokens.semantic.elevation[props.$shadow]);
|
|
98
|
+
}, function (props) {
|
|
99
|
+
return props.$cursor && css(templateObject_41 || (templateObject_41 = __makeTemplateObject(["cursor: ", ";"], ["cursor: ", ";"])), props.$cursor);
|
|
100
|
+
}, function (props) {
|
|
101
|
+
return props.$transition && css(templateObject_42 || (templateObject_42 = __makeTemplateObject(["transition: ", ";"], ["transition: ", ";"])), props.$transition);
|
|
102
|
+
}, function (props) {
|
|
103
|
+
return (props.$hoverShadow || props.$hoverTransform) && css(templateObject_47 || (templateObject_47 = __makeTemplateObject(["\n &:hover {\n ", "\n ", "\n }\n \n /* Pressed settles back: the shadow drops to raised and any lift returns (issue 185). Pressing a\n control inside the card (an action button) presses that control, not the card. */\n &:active {\n transform: translateY(0);\n }\n\n ", "\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n /* Reduced motion keeps the state change and drops the movement (decision 0015) */\n ", "\n "], ["\n &:hover {\n ", "\n ", "\n }\n \n /* Pressed settles back: the shadow drops to raised and any lift returns (issue 185). Pressing a\n control inside the card (an action button) presses that control, not the card. */\n &:active {\n transform: translateY(0);\n }\n\n ", "\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n /* Reduced motion keeps the state change and drops the movement (decision 0015) */\n ", "\n "])), props.$hoverShadow && css(templateObject_43 || (templateObject_43 = __makeTemplateObject(["box-shadow: ", ";"], ["box-shadow: ", ";"])), tokens.semantic.elevation[props.$hoverShadow]), props.$hoverTransform && css(templateObject_44 || (templateObject_44 = __makeTemplateObject(["transform: ", ";"], ["transform: ", ";"])), props.$hoverTransform), props.$hoverShadow && css(templateObject_45 || (templateObject_45 = __makeTemplateObject(["\n &:active:not(:has(:is(button, a, [role=\"button\"]):active)) {\n box-shadow: ", ";\n }\n "], ["\n &:active:not(:has(:is(button, a, [role=\"button\"]):active)) {\n box-shadow: ", ";\n }\n "])), tokens.semantic.elevation.raised), tokens.semantic.border.focus, tokens.semantic.border.focusOffset, props.$hoverTransform && css(templateObject_46 || (templateObject_46 = __makeTemplateObject(["\n ", " {\n &:hover {\n transform: none;\n }\n }\n "], ["\n ", " {\n &:hover {\n transform: none;\n }\n }\n "])), reducedMotion));
|
|
104
|
+
}, function (props) {
|
|
105
|
+
return props.$overflow && css(templateObject_48 || (templateObject_48 = __makeTemplateObject(["overflow: ", ";"], ["overflow: ", ";"])), props.$overflow);
|
|
106
|
+
}, function (props) {
|
|
107
|
+
return props.$overflowX && css(templateObject_49 || (templateObject_49 = __makeTemplateObject(["overflow-x: ", ";"], ["overflow-x: ", ";"])), props.$overflowX);
|
|
108
|
+
}, function (props) {
|
|
109
|
+
return props.$overflowY && css(templateObject_50 || (templateObject_50 = __makeTemplateObject(["overflow-y: ", ";"], ["overflow-y: ", ";"])), props.$overflowY);
|
|
110
|
+
});
|
|
111
|
+
// Transform component that maps clean props to $-prefixed props for styled-components
|
|
112
|
+
var BoxTransform = function BoxTransform(props) {
|
|
113
|
+
var
|
|
114
|
+
// Display
|
|
115
|
+
display = props.display,
|
|
116
|
+
// Flexbox
|
|
117
|
+
flexDirection = props.flexDirection,
|
|
118
|
+
justifyContent = props.justifyContent,
|
|
119
|
+
alignItems = props.alignItems,
|
|
120
|
+
flexWrap = props.flexWrap,
|
|
121
|
+
gap = props.gap,
|
|
122
|
+
// Spacing
|
|
123
|
+
m = props.m,
|
|
124
|
+
mt = props.mt,
|
|
125
|
+
mr = props.mr,
|
|
126
|
+
mb = props.mb,
|
|
127
|
+
ml = props.ml,
|
|
128
|
+
mx = props.mx,
|
|
129
|
+
my = props.my,
|
|
130
|
+
p = props.p,
|
|
131
|
+
pt = props.pt,
|
|
132
|
+
pr = props.pr,
|
|
133
|
+
pb = props.pb,
|
|
134
|
+
pl = props.pl,
|
|
135
|
+
px = props.px,
|
|
136
|
+
py = props.py,
|
|
137
|
+
// Size
|
|
138
|
+
width = props.width,
|
|
139
|
+
height = props.height,
|
|
140
|
+
maxWidth = props.maxWidth,
|
|
141
|
+
maxHeight = props.maxHeight,
|
|
142
|
+
minWidth = props.minWidth,
|
|
143
|
+
minHeight = props.minHeight,
|
|
144
|
+
// Position
|
|
145
|
+
position = props.position,
|
|
146
|
+
top = props.top,
|
|
147
|
+
right = props.right,
|
|
148
|
+
bottom = props.bottom,
|
|
149
|
+
left = props.left,
|
|
150
|
+
// Borders
|
|
151
|
+
borderRadius = props.borderRadius,
|
|
152
|
+
border = props.border,
|
|
153
|
+
borderTop = props.borderTop,
|
|
154
|
+
borderRight = props.borderRight,
|
|
155
|
+
borderBottom = props.borderBottom,
|
|
156
|
+
borderLeft = props.borderLeft,
|
|
157
|
+
// Background & Color
|
|
158
|
+
bg = props.bg,
|
|
159
|
+
color = props.color,
|
|
160
|
+
// Shadow
|
|
161
|
+
shadow = props.shadow,
|
|
162
|
+
// Cursor
|
|
163
|
+
cursor = props.cursor,
|
|
164
|
+
// Transition
|
|
165
|
+
transition = props.transition,
|
|
166
|
+
// Hover states
|
|
167
|
+
hoverShadow = props.hoverShadow,
|
|
168
|
+
hoverTransform = props.hoverTransform,
|
|
169
|
+
// Overflow
|
|
170
|
+
overflow = props.overflow,
|
|
171
|
+
overflowX = props.overflowX,
|
|
172
|
+
overflowY = props.overflowY,
|
|
173
|
+
// Standard props
|
|
174
|
+
as = props.as,
|
|
175
|
+
children = props.children,
|
|
176
|
+
onClick = props.onClick,
|
|
177
|
+
onKeyDown = props.onKeyDown,
|
|
178
|
+
tabIndex = props.tabIndex,
|
|
179
|
+
role = props.role,
|
|
180
|
+
ariaLabel = props["aria-label"],
|
|
181
|
+
dataTestId = props["data-testid"],
|
|
182
|
+
rest = __rest(props, ["display", "flexDirection", "justifyContent", "alignItems", "flexWrap", "gap", "m", "mt", "mr", "mb", "ml", "mx", "my", "p", "pt", "pr", "pb", "pl", "px", "py", "width", "height", "maxWidth", "maxHeight", "minWidth", "minHeight", "position", "top", "right", "bottom", "left", "borderRadius", "border", "borderTop", "borderRight", "borderBottom", "borderLeft", "bg", "color", "shadow", "cursor", "transition", "hoverShadow", "hoverTransform", "overflow", "overflowX", "overflowY", "as", "children", "onClick", "onKeyDown", "tabIndex", "role", 'aria-label', 'data-testid']);
|
|
183
|
+
return jsx(StyledBox, __assign({
|
|
184
|
+
as: as,
|
|
185
|
+
"data-testid": dataTestId,
|
|
186
|
+
"$display": display,
|
|
187
|
+
"$flexDirection": flexDirection,
|
|
188
|
+
"$justifyContent": justifyContent,
|
|
189
|
+
"$alignItems": alignItems,
|
|
190
|
+
"$flexWrap": flexWrap,
|
|
191
|
+
"$gap": gap,
|
|
192
|
+
"$m": m,
|
|
193
|
+
"$mt": mt,
|
|
194
|
+
"$mr": mr,
|
|
195
|
+
"$mb": mb,
|
|
196
|
+
"$ml": ml,
|
|
197
|
+
"$mx": mx,
|
|
198
|
+
"$my": my,
|
|
199
|
+
"$p": p,
|
|
200
|
+
"$pt": pt,
|
|
201
|
+
"$pr": pr,
|
|
202
|
+
"$pb": pb,
|
|
203
|
+
"$pl": pl,
|
|
204
|
+
"$px": px,
|
|
205
|
+
"$py": py,
|
|
206
|
+
"$width": width,
|
|
207
|
+
"$height": height,
|
|
208
|
+
"$maxWidth": maxWidth,
|
|
209
|
+
"$maxHeight": maxHeight,
|
|
210
|
+
"$minWidth": minWidth,
|
|
211
|
+
"$minHeight": minHeight,
|
|
212
|
+
"$position": position,
|
|
213
|
+
"$top": top,
|
|
214
|
+
"$right": right,
|
|
215
|
+
"$bottom": bottom,
|
|
216
|
+
"$left": left,
|
|
217
|
+
"$borderRadius": borderRadius,
|
|
218
|
+
"$border": border,
|
|
219
|
+
"$borderTop": borderTop,
|
|
220
|
+
"$borderRight": borderRight,
|
|
221
|
+
"$borderBottom": borderBottom,
|
|
222
|
+
"$borderLeft": borderLeft,
|
|
223
|
+
"$bg": bg,
|
|
224
|
+
"$color": color,
|
|
225
|
+
"$shadow": shadow,
|
|
226
|
+
"$cursor": cursor,
|
|
227
|
+
"$transition": transition,
|
|
228
|
+
"$hoverShadow": hoverShadow,
|
|
229
|
+
"$hoverTransform": hoverTransform,
|
|
230
|
+
"$overflow": overflow,
|
|
231
|
+
"$overflowX": overflowX,
|
|
232
|
+
"$overflowY": overflowY,
|
|
233
|
+
onClick: onClick,
|
|
234
|
+
onKeyDown: onKeyDown,
|
|
235
|
+
tabIndex: tabIndex,
|
|
236
|
+
role: role,
|
|
237
|
+
"aria-label": ariaLabel
|
|
238
|
+
}, rest, {
|
|
239
|
+
children: children
|
|
240
|
+
}));
|
|
241
|
+
};
|
|
242
|
+
var Box = BoxTransform;
|
|
243
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47, templateObject_48, templateObject_49, templateObject_50, templateObject_51;
|
|
244
|
+
|
|
245
|
+
export { Box };
|
|
246
|
+
//# sourceMappingURL=Box.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Box.mjs';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type IconName } from '../Icon/index.mjs';
|
|
3
|
+
/**
|
|
4
|
+
* Button variants. `accent` is the blue call to action one level above `primary`;
|
|
5
|
+
* use at most one per view (decision 0016).
|
|
6
|
+
*/
|
|
7
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'naked' | 'accent'
|
|
8
|
+
/** @deprecated Use `accent`. `emphasis` will be removed in 3.0. */
|
|
9
|
+
| 'emphasis' | 'danger';
|
|
10
|
+
export interface BaseButtonProps {
|
|
11
|
+
/**
|
|
12
|
+
* Visual style. `accent` is the blue call to action above `primary` (at most one per view).
|
|
13
|
+
* `emphasis` is a deprecated alias for `accent` and will be removed in 3.0.
|
|
14
|
+
* @default 'primary'
|
|
15
|
+
*/
|
|
16
|
+
variant?: ButtonVariant;
|
|
17
|
+
size?: 'small' | 'medium' | 'large';
|
|
18
|
+
url?: string;
|
|
19
|
+
purpose?: 'button' | 'link';
|
|
20
|
+
target?: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
iconName?: IconName;
|
|
23
|
+
id?: string;
|
|
24
|
+
'data-testid'?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Custom link component (e.g., Next.js Link, React Router Link)
|
|
27
|
+
* Receives href, children, and other props
|
|
28
|
+
* @example linkComponent={NextLink} or linkComponent={ReactRouterLink}
|
|
29
|
+
*/
|
|
30
|
+
linkComponent?: React.ComponentType<any>;
|
|
31
|
+
}
|
|
32
|
+
export interface ButtonProps extends BaseButtonProps, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof BaseButtonProps> {
|
|
33
|
+
purpose?: 'button';
|
|
34
|
+
}
|
|
35
|
+
export interface LinkProps extends BaseButtonProps, Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof BaseButtonProps> {
|
|
36
|
+
purpose: 'link';
|
|
37
|
+
}
|
|
38
|
+
type CustomButtonProps = ButtonProps | LinkProps;
|
|
39
|
+
export declare const Button: React.FC<CustomButtonProps>;
|
|
40
|
+
export {};
|