@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SuggestionChipProps {
|
|
3
|
+
/** The suggestion. It's also the button's accessible name, so keep it short and self-explanatory. */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Called when the suggestion is picked. Put its text in the input; never send it (decision 0046). */
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
/** Disables the chip */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Test identifier for automated testing */
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* SuggestionChip - Offers text to put in the agent input
|
|
14
|
+
*
|
|
15
|
+
* The Suggestion chip type from decision 0046 (amending 0016): the one chip that acts on click.
|
|
16
|
+
* Picking it fills the input so the user can edit before sending; it never sends or runs a command,
|
|
17
|
+
* which is why it's a chip and not a Button. AgentInput renders these from its `suggestions` prop.
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - A native button: Enter and Space pick it, and its text is its accessible name
|
|
21
|
+
* - Outlined, with the naked hover and pressed fills; no selected state
|
|
22
|
+
* - One chip height (24px minimum, decision 0035); long text wraps instead of being cut off
|
|
23
|
+
*/
|
|
24
|
+
export declare const SuggestionChip: React.FC<SuggestionChipProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SuggestionChipProps {
|
|
3
|
+
/** The suggestion. It's also the button's accessible name, so keep it short and self-explanatory. */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Called when the suggestion is picked. Put its text in the input; never send it (decision 0046). */
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
/** Disables the chip */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Test identifier for automated testing */
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* SuggestionChip - Offers text to put in the agent input
|
|
14
|
+
*
|
|
15
|
+
* The Suggestion chip type from decision 0046 (amending 0016): the one chip that acts on click.
|
|
16
|
+
* Picking it fills the input so the user can edit before sending; it never sends or runs a command,
|
|
17
|
+
* which is why it's a chip and not a Button. AgentInput renders these from its `suggestions` prop.
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - A native button: Enter and Space pick it, and its text is its accessible name
|
|
21
|
+
* - Outlined, with the naked hover and pressed fills; no selected state
|
|
22
|
+
* - One chip height (24px minimum, decision 0035); long text wraps instead of being cut off
|
|
23
|
+
*/
|
|
24
|
+
export declare const SuggestionChip: React.FC<SuggestionChipProps>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import styled$module from 'styled-components';
|
|
5
|
+
const styled = styled$module.default || styled$module;
|
|
6
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
7
|
+
import { forcedColors } from '../../../lib/styleUtils.mjs';
|
|
8
|
+
import { sizeStyles } from './shared/utils.mjs';
|
|
9
|
+
|
|
10
|
+
var chip = tokens.component.chip,
|
|
11
|
+
semantic = tokens.semantic;
|
|
12
|
+
var color = semantic.color;
|
|
13
|
+
// Outlined, with the naked fill ladder on hover and press (decisions 0030, 0046): the edge keeps it
|
|
14
|
+
// visible on white, the page and AgentInput's docked band
|
|
15
|
+
var StyledSuggestionChip = /*#__PURE__*/styled.button.withConfig({
|
|
16
|
+
displayName: "SuggestionChip__StyledSuggestionChip",
|
|
17
|
+
componentId: "sc-1k0njm-0"
|
|
18
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n margin: 0;\n box-sizing: border-box;\n border: ", " solid ", ";\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n cursor: pointer;\n text-align: start;\n /* A long suggestion wraps inside the chip rather than being cut off (issue 279) */\n white-space: normal;\n overflow-wrap: anywhere;\n transition: ", ";\n ", "\n\n &:hover:not(:disabled) {\n background-color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n }\n\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n &:disabled {\n border-color: ", ";\n color: ", ";\n cursor: not-allowed;\n }\n\n /* Forced colours: a native button gets ButtonBorder and GrayText; keep the edge (decision 0038) */\n ", " {\n border-color: ButtonBorder;\n\n &:disabled {\n border-color: GrayText;\n }\n }\n"], ["\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n margin: 0;\n box-sizing: border-box;\n border: ", " solid ", ";\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n cursor: pointer;\n text-align: start;\n /* A long suggestion wraps inside the chip rather than being cut off (issue 279) */\n white-space: normal;\n overflow-wrap: anywhere;\n transition: ", ";\n ", "\n\n &:hover:not(:disabled) {\n background-color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n }\n\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n &:disabled {\n border-color: ", ";\n color: ", ";\n cursor: not-allowed;\n }\n\n /* Forced colours: a native button gets ButtonBorder and GrayText; keep the edge (decision 0038) */\n ", " {\n border-color: ButtonBorder;\n\n &:disabled {\n border-color: GrayText;\n }\n }\n"
|
|
19
|
+
/**
|
|
20
|
+
* SuggestionChip - Offers text to put in the agent input
|
|
21
|
+
*
|
|
22
|
+
* The Suggestion chip type from decision 0046 (amending 0016): the one chip that acts on click.
|
|
23
|
+
* Picking it fills the input so the user can edit before sending; it never sends or runs a command,
|
|
24
|
+
* which is why it's a chip and not a Button. AgentInput renders these from its `suggestions` prop.
|
|
25
|
+
*
|
|
26
|
+
* Features:
|
|
27
|
+
* - A native button: Enter and Space pick it, and its text is its accessible name
|
|
28
|
+
* - Outlined, with the naked hover and pressed fills; no selected state
|
|
29
|
+
* - One chip height (24px minimum, decision 0035); long text wraps instead of being cut off
|
|
30
|
+
*/])), semantic.border.width.thin, color.border.input, chip["default"].borderRadius, color.fill.none, color.text["default"], semantic.motion.transition.feedback, sizeStyles, color.fill['none-hover'], color.fill['none-pressed'], chip.focus.outline, semantic.border.focusOffset, color.border.emphasis, color.text.disabled, forcedColors);
|
|
31
|
+
/**
|
|
32
|
+
* SuggestionChip - Offers text to put in the agent input
|
|
33
|
+
*
|
|
34
|
+
* The Suggestion chip type from decision 0046 (amending 0016): the one chip that acts on click.
|
|
35
|
+
* Picking it fills the input so the user can edit before sending; it never sends or runs a command,
|
|
36
|
+
* which is why it's a chip and not a Button. AgentInput renders these from its `suggestions` prop.
|
|
37
|
+
*
|
|
38
|
+
* Features:
|
|
39
|
+
* - A native button: Enter and Space pick it, and its text is its accessible name
|
|
40
|
+
* - Outlined, with the naked hover and pressed fills; no selected state
|
|
41
|
+
* - One chip height (24px minimum, decision 0035); long text wraps instead of being cut off
|
|
42
|
+
*/
|
|
43
|
+
var SuggestionChip = function SuggestionChip(_a) {
|
|
44
|
+
var children = _a.children,
|
|
45
|
+
onClick = _a.onClick,
|
|
46
|
+
_b = _a.disabled,
|
|
47
|
+
disabled = _b === void 0 ? false : _b,
|
|
48
|
+
dataTestId = _a["data-testid"];
|
|
49
|
+
return jsx(StyledSuggestionChip, {
|
|
50
|
+
type: "button",
|
|
51
|
+
onClick: onClick,
|
|
52
|
+
disabled: disabled,
|
|
53
|
+
"data-testid": dataTestId,
|
|
54
|
+
children: children
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
SuggestionChip.displayName = 'SuggestionChip';
|
|
58
|
+
var templateObject_1;
|
|
59
|
+
|
|
60
|
+
export { SuggestionChip };
|
|
61
|
+
//# sourceMappingURL=SuggestionChip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuggestionChip.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InternalStyledProps } from './types.mjs';
|
|
2
|
+
export declare const StyledChip: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
3
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types.js").CSSPropertiesWithVars | undefined;
|
|
4
|
+
}, InternalStyledProps>> & string;
|
|
5
|
+
export declare const IconContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
6
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types.js").CSSPropertiesWithVars | undefined;
|
|
7
|
+
}> & string;
|
|
8
|
+
export declare const CloseButton: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Merged<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
9
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types.js").CSSPropertiesWithVars | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
$disabled?: boolean;
|
|
12
|
+
}>> & string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import styled$module from 'styled-components';
|
|
4
|
+
const styled = styled$module.default || styled$module;
|
|
5
|
+
import tokens from '../../../../lib/cssTokens.mjs';
|
|
6
|
+
import { getVariantStyles, sizeStyles } from './utils.mjs';
|
|
7
|
+
import { forcedColorsEdge, forcedColors } from '../../../../lib/styleUtils.mjs';
|
|
8
|
+
|
|
9
|
+
var chip = tokens.component.chip,
|
|
10
|
+
semantic = tokens.semantic;
|
|
11
|
+
// Base styled component using direct prop interpolation like Button
|
|
12
|
+
var StyledChip = /*#__PURE__*/styled.span.withConfig({
|
|
13
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
14
|
+
return !prop.startsWith('$');
|
|
15
|
+
},
|
|
16
|
+
displayName: "ChipBase__StyledChip",
|
|
17
|
+
componentId: "sc-moa6zc-0"
|
|
18
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: max-content;\n border-radius: ", ";\n box-sizing: border-box;\n user-select: none;\n white-space: nowrap;\n transition: ", ";\n cursor: ", ";\n \n /* Forced colours: an edge, and GrayText when disabled, since a span gets no system disabled\n colour (decision 0038). Before the variant styles, so a selected chip's Highlight border wins. */\n ", "\n ", "\n\n ", "\n ", "\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: max-content;\n border-radius: ", ";\n box-sizing: border-box;\n user-select: none;\n white-space: nowrap;\n transition: ", ";\n cursor: ", ";\n \n /* Forced colours: an edge, and GrayText when disabled, since a span gets no system disabled\n colour (decision 0038). Before the variant styles, so a selected chip's Highlight border wins. */\n ", "\n ", "\n\n ", "\n ", "\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n"
|
|
19
|
+
// Icon container for selected indicator or leading icons
|
|
20
|
+
])), chip["default"].borderRadius, semantic.motion.transition.feedback, function (props) {
|
|
21
|
+
return props.$disabled ? 'not-allowed' : props.$clickable ? 'pointer' : 'default';
|
|
22
|
+
}, forcedColorsEdge, function (props) {
|
|
23
|
+
return props.$disabled ? "".concat(forcedColors, " { color: GrayText; }") : '';
|
|
24
|
+
}, getVariantStyles, sizeStyles, chip.focus.outline, semantic.border.focusOffset);
|
|
25
|
+
// Icon container for selected indicator or leading icons
|
|
26
|
+
var IconContainer = /*#__PURE__*/styled.span.withConfig({
|
|
27
|
+
displayName: "ChipBase__IconContainer",
|
|
28
|
+
componentId: "sc-moa6zc-1"
|
|
29
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n margin-right: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n margin-right: ", ";\n"
|
|
30
|
+
// Close button for dismissible chips
|
|
31
|
+
])), tokens.semantic.space[100]);
|
|
32
|
+
// Close button for dismissible chips
|
|
33
|
+
var CloseButton = /*#__PURE__*/styled.button.withConfig({
|
|
34
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
35
|
+
return !prop.startsWith('$');
|
|
36
|
+
},
|
|
37
|
+
displayName: "ChipBase__CloseButton",
|
|
38
|
+
componentId: "sc-moa6zc-2"
|
|
39
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: ", ";\n background: transparent;\n border: none;\n position: relative;\n width: ", ";\n height: ", ";\n padding: ", ";\n\n /* The pointer target is at least 24 \xD7 24px (WCAG 2.5.8, decision 0039): an invisible hit area\n as tall as the chip, centred on the 20px button. It stays inside the chip and its padding, so\n it can't overlap another target. */\n &::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: ", ";\n height: ", ";\n transform: translate(-50%, -50%);\n }\n border-radius: ", ";\n cursor: ", ";\n color: inherit;\n transition: ", ";\n \n &:hover:not(:disabled) {\n background-color: ", ";\n }\n \n &:active:not(:disabled) {\n background-color: ", ";\n }\n \n &:disabled {\n color: ", ";\n }\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n border-radius: ", ";\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: ", ";\n background: transparent;\n border: none;\n position: relative;\n width: ", ";\n height: ", ";\n padding: ", ";\n\n /* The pointer target is at least 24 \xD7 24px (WCAG 2.5.8, decision 0039): an invisible hit area\n as tall as the chip, centred on the 20px button. It stays inside the chip and its padding, so\n it can't overlap another target. */\n &::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: ", ";\n height: ", ";\n transform: translate(-50%, -50%);\n }\n border-radius: ", ";\n cursor: ", ";\n color: inherit;\n transition: ", ";\n \n &:hover:not(:disabled) {\n background-color: ", ";\n }\n \n &:active:not(:disabled) {\n background-color: ", ";\n }\n \n &:disabled {\n color: ", ";\n }\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n border-radius: ", ";\n }\n"])), tokens.semantic.space[200], chip.closeButton.size, chip.closeButton.size, tokens.semantic.space[0], semantic.size.label.medium, semantic.size.label.medium, tokens.semantic.radius.xs, function (props) {
|
|
40
|
+
return props.$disabled ? 'not-allowed' : 'pointer';
|
|
41
|
+
}, semantic.motion.transition.feedback, tokens.semantic.color.fill['none-hover'], tokens.semantic.color.fill['none-pressed'], tokens.semantic.color.text.disabled, chip.focus.outline, semantic.border.focusOffset, chip["default"].borderRadius);
|
|
42
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
43
|
+
|
|
44
|
+
export { CloseButton, IconContainer, StyledChip };
|
|
45
|
+
//# sourceMappingURL=ChipBase.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChipBase.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BaseChipProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Ignored, and removed in 3.0. Chips have one size, 24px (decision 0035).
|
|
6
|
+
*/
|
|
7
|
+
size?: 'small' | 'medium';
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
'aria-describedby'?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Visual variants for the static Chip. Only `default` stays in 3.0 (decision 0016):
|
|
15
|
+
* chips are classified by job, not emphasis.
|
|
16
|
+
*/
|
|
17
|
+
export type ChipVariant = 'default'
|
|
18
|
+
/** @deprecated Removed in 3.0. Chips have no emphasis levels; use `default`. */
|
|
19
|
+
| 'emphasis'
|
|
20
|
+
/** @deprecated Removed in 3.0. Use `default`. */
|
|
21
|
+
| 'subtle'
|
|
22
|
+
/** @deprecated Removed in 3.0. For a clickable action use a Button; for a toggle use `BooleanChip` (`FilterChip` in 3.0). */
|
|
23
|
+
| 'interactive';
|
|
24
|
+
export interface InternalStyledProps {
|
|
25
|
+
$variant: ChipVariant;
|
|
26
|
+
$disabled?: boolean;
|
|
27
|
+
$clickable?: boolean;
|
|
28
|
+
$selected?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Legacy Chip variants.
|
|
32
|
+
* @deprecated Removed in 3.0. `light` is the same as `default`; `dark` maps to the deprecated `emphasis`. Use `default`.
|
|
33
|
+
*/
|
|
34
|
+
export type LegacyVariant = 'light' | 'dark';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChipVariant } from './types.mjs';
|
|
2
|
+
interface StyledChipProps {
|
|
3
|
+
$variant: ChipVariant;
|
|
4
|
+
$disabled?: boolean;
|
|
5
|
+
$clickable?: boolean;
|
|
6
|
+
$selected?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const getVariantStyles: ({ $variant, $selected, $clickable, $disabled }: StyledChipProps) => string;
|
|
9
|
+
export declare const sizeStyles: string;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import tokens from '../../../../lib/cssTokens.mjs';
|
|
3
|
+
import { forcedColors } from '../../../../lib/styleUtils.mjs';
|
|
4
|
+
|
|
5
|
+
var chip = tokens.component.chip,
|
|
6
|
+
semantic = tokens.semantic;
|
|
7
|
+
// Helper function to get variant styles matching Button's approach
|
|
8
|
+
var getVariantStyles = function getVariantStyles(_a) {
|
|
9
|
+
var $variant = _a.$variant,
|
|
10
|
+
$selected = _a.$selected,
|
|
11
|
+
$clickable = _a.$clickable,
|
|
12
|
+
$disabled = _a.$disabled;
|
|
13
|
+
// Selected filter and input chips use the light-blue selected treatment (decision 0016).
|
|
14
|
+
// The text darkens with the fill so every state stays at least 4.5:1.
|
|
15
|
+
if ($selected) {
|
|
16
|
+
// A selected disabled chip looks like any disabled chip; the checkmark keeps the
|
|
17
|
+
// selected state visible (#110)
|
|
18
|
+
if ($disabled) {
|
|
19
|
+
var disabled = chip.variants.subtle.disabled;
|
|
20
|
+
return "\n background-color: ".concat(disabled.backgroundColor, ";\n color: ").concat(disabled.textColor, ";\n ");
|
|
21
|
+
}
|
|
22
|
+
var _b = tokens.semantic.color,
|
|
23
|
+
fill = _b.fill,
|
|
24
|
+
text = _b.text;
|
|
25
|
+
var interactiveStates = $clickable;
|
|
26
|
+
return "\n background-color: ".concat(fill['accent-muted'], ";\n color: ").concat(text.accent, ";\n \n &:hover {\n background-color: ").concat(interactiveStates ? fill['accent-muted-hover'] : fill['accent-muted'], ";\n color: ").concat(interactiveStates ? text['accent-hover'] : text.accent, ";\n }\n \n &:active {\n background-color: ").concat(interactiveStates ? fill['accent-muted-pressed'] : fill['accent-muted'], ";\n color: ").concat(interactiveStates ? text['accent-pressed'] : text.accent, ";\n }\n\n /* Forced colours drop the fill, so a selected chip takes the system selection colours\n (decision 0038); its checkmark follows the text colour */\n ").concat(forcedColors, " {\n forced-color-adjust: none;\n background-color: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n ");
|
|
27
|
+
}
|
|
28
|
+
switch ($variant) {
|
|
29
|
+
case 'emphasis':
|
|
30
|
+
return "\n background-color: ".concat(chip.variants.emphasis.backgroundColor, ";\n color: ").concat(chip.variants.emphasis.textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip.variants.emphasis.disabled.backgroundColor : $clickable ? chip.variants.emphasis.hover.backgroundColor : chip.variants.emphasis.backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip.variants.emphasis.disabled.backgroundColor : $clickable ? chip.variants.emphasis.active.backgroundColor : chip.variants.emphasis.backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip.variants.emphasis.disabled.backgroundColor, ";\n color: ").concat(chip.variants.emphasis.disabled.textColor, ";\n ") : '', "\n ");
|
|
31
|
+
case 'subtle':
|
|
32
|
+
return "\n background-color: ".concat(chip.variants.subtle.backgroundColor, ";\n color: ").concat(chip.variants.subtle.textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip.variants.subtle.disabled.backgroundColor : $clickable ? chip.variants.subtle.hover.backgroundColor : chip.variants.subtle.backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip.variants.subtle.disabled.backgroundColor : $clickable ? chip.variants.subtle.active.backgroundColor : chip.variants.subtle.backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip.variants.subtle.disabled.backgroundColor, ";\n color: ").concat(chip.variants.subtle.disabled.textColor, ";\n ") : '', "\n ");
|
|
33
|
+
case 'interactive':
|
|
34
|
+
return "\n background-color: ".concat(chip.variants.interactive.backgroundColor, ";\n color: ").concat(chip.variants.interactive.textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip.variants.interactive.disabled.backgroundColor : $clickable ? chip.variants.interactive.hover.backgroundColor : chip.variants.interactive.backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip.variants.interactive.disabled.backgroundColor : $clickable ? chip.variants.interactive.active.backgroundColor : chip.variants.interactive.backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip.variants.interactive.disabled.backgroundColor, ";\n color: ").concat(chip.variants.interactive.disabled.textColor, ";\n ") : '', "\n ");
|
|
35
|
+
case 'default':
|
|
36
|
+
default:
|
|
37
|
+
return "\n background-color: ".concat(chip["default"].backgroundColor, ";\n color: ").concat(chip["default"].textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip.disabled.backgroundColor : $clickable ? chip.hover.backgroundColor : chip["default"].backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip.disabled.backgroundColor : $clickable ? chip.active.backgroundColor : chip["default"].backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip.disabled.backgroundColor, ";\n color: ").concat(chip.disabled.textColor, ";\n ") : '', "\n ");
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
// Chips have one size: 24px from the label scale as a minimum, with the content centred
|
|
41
|
+
// and no vertical padding (decisions 0034 and 0035). Horizontal padding comes from the
|
|
42
|
+
// semantic spacing scale (decision 0022).
|
|
43
|
+
var sizeStyles = "\n font: ".concat(chip.sizes.medium.font, ";\n min-height: ").concat(semantic.size.label.medium, ";\n padding: 0 ").concat(semantic.space.inset.sm, ";\n");
|
|
44
|
+
|
|
45
|
+
export { getVariantStyles, sizeStyles };
|
|
46
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../../../src/components/atoms/Chip/shared/utils.ts"],"sourcesContent":["import tokens from '../../../../lib/cssTokens'\nimport { forcedColors } from '../../../../lib/styleUtils'\nimport { ChipVariant } from './types'\n\nconst { component: { chip }, semantic } = tokens\n\ninterface StyledChipProps {\n $variant: ChipVariant\n $disabled?: boolean\n $clickable?: boolean\n $selected?: boolean\n}\n\n// Helper function to get variant styles matching Button's approach\nexport const getVariantStyles = ({ $variant, $selected, $clickable, $disabled }: StyledChipProps) => {\n // Selected filter and input chips use the light-blue selected treatment (decision 0016).\n // The text darkens with the fill so every state stays at least 4.5:1.\n if ($selected) {\n // A selected disabled chip looks like any disabled chip; the checkmark keeps the\n // selected state visible (#110)\n if ($disabled) {\n const { disabled } = chip.variants.subtle\n return `\n background-color: ${disabled.backgroundColor};\n color: ${disabled.textColor};\n `\n }\n\n const { fill, text } = tokens.semantic.color\n const interactiveStates = $clickable\n return `\n background-color: ${fill['accent-muted']};\n color: ${text.accent};\n \n &:hover {\n background-color: ${interactiveStates ? fill['accent-muted-hover'] : fill['accent-muted']};\n color: ${interactiveStates ? text['accent-hover'] : text.accent};\n }\n \n &:active {\n background-color: ${interactiveStates ? fill['accent-muted-pressed'] : fill['accent-muted']};\n color: ${interactiveStates ? text['accent-pressed'] : text.accent};\n }\n\n /* Forced colours drop the fill, so a selected chip takes the system selection colours\n (decision 0038); its checkmark follows the text colour */\n ${forcedColors} {\n forced-color-adjust: none;\n background-color: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n `\n }\n \n switch ($variant) {\n case 'emphasis':\n return `\n background-color: ${chip.variants.emphasis.backgroundColor};\n color: ${chip.variants.emphasis.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.emphasis.disabled.backgroundColor : ($clickable ? chip.variants.emphasis.hover.backgroundColor : chip.variants.emphasis.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.emphasis.disabled.backgroundColor : ($clickable ? chip.variants.emphasis.active.backgroundColor : chip.variants.emphasis.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.emphasis.disabled.backgroundColor};\n color: ${chip.variants.emphasis.disabled.textColor};\n ` : ''}\n `\n case 'subtle':\n return `\n background-color: ${chip.variants.subtle.backgroundColor};\n color: ${chip.variants.subtle.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.hover.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.active.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.subtle.disabled.backgroundColor};\n color: ${chip.variants.subtle.disabled.textColor};\n ` : ''}\n `\n case 'interactive':\n return `\n background-color: ${chip.variants.interactive.backgroundColor};\n color: ${chip.variants.interactive.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.interactive.disabled.backgroundColor : ($clickable ? chip.variants.interactive.hover.backgroundColor : chip.variants.interactive.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.interactive.disabled.backgroundColor : ($clickable ? chip.variants.interactive.active.backgroundColor : chip.variants.interactive.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.interactive.disabled.backgroundColor};\n color: ${chip.variants.interactive.disabled.textColor};\n ` : ''}\n `\n case 'default':\n default:\n return `\n background-color: ${chip.default.backgroundColor};\n color: ${chip.default.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.disabled.backgroundColor : ($clickable ? chip.hover.backgroundColor : chip.default.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.disabled.backgroundColor : ($clickable ? chip.active.backgroundColor : chip.default.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.disabled.backgroundColor};\n color: ${chip.disabled.textColor};\n ` : ''}\n `\n }\n}\n\n// Chips have one size: 24px from the label scale as a minimum, with the content centred\n// and no vertical padding (decisions 0034 and 0035). Horizontal padding comes from the\n// semantic spacing scale (decision 0022).\nexport const sizeStyles = `\n font: ${chip.sizes.medium.font};\n min-height: ${semantic.size.label.medium};\n padding: 0 ${semantic.space.inset.sm};\n`\n\n"],"names":["chip","tokens","component","semantic","getVariantStyles","_a","$variant","$selected","$clickable","$disabled","disabled","variants","subtle","concat","backgroundColor","textColor","_b","color","fill","text","interactiveStates","accent","forcedColors","emphasis","hover","active","interactive","sizeStyles","sizes","medium","font","size","label","space","inset","sm"],"mappings":";;;;AAIqB,IAAAA,IAAI,GAAiBC,MAAM,CAAAC,SAAA,CAAAF,IAAvB;EAAIG,QAAQ,GAAKF,MAAM,CAAAE,QAAX,CAAA;AASrC;IACaC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,EAA+D,EAAA;MAA7DC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;IAAEC,SAAS,GAAAF,EAAA,CAAAE,SAAA;IAAEC,UAAU,GAAAH,EAAA,CAAAG,UAAA;IAAEC,SAAS,GAAAJ,EAAA,CAAAI,SAAA,CA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B,IAAI,CAACC,KAAK,CAACH,MAAM,EAC3B,kBAAA,CAAA,CAAAhB,MAAA,CAAAV,QAAQ,CAAC8B,KAAK,CAACC,KAAK,CAACC,EAAE;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ContainerProps = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
'data-testid'?: string;
|
|
5
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
6
|
+
export declare const Container: ({ children, ...props }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject, __rest, __assign } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import styled$module from 'styled-components';
|
|
5
|
+
const styled = styled$module.default || styled$module;
|
|
6
|
+
import { media, breakpoints } from '../../../lib/styleUtils.mjs';
|
|
7
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
8
|
+
|
|
9
|
+
var space = tokens.semantic.space;
|
|
10
|
+
var StyledContainer = /*#__PURE__*/styled.div.withConfig({
|
|
11
|
+
displayName: "Container__StyledContainer",
|
|
12
|
+
componentId: "sc-17dbj6n-0"
|
|
13
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n margin-left: auto;\n margin-right: auto;\n padding-left: ", ";\n padding-right: ", ";\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n"], ["\n width: 100%;\n margin-left: auto;\n margin-right: auto;\n padding-left: ", ";\n padding-right: ", ";\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n"])), space[600], space[600], media.sm, breakpoints.sm, media.md, breakpoints.md, media.lg, breakpoints.lg, media.xl, breakpoints.xl, media['2xl'], breakpoints['2xl']);
|
|
14
|
+
var Container = function Container(_a) {
|
|
15
|
+
var children = _a.children,
|
|
16
|
+
props = __rest(_a, ["children"]);
|
|
17
|
+
return jsx(StyledContainer, __assign({}, props, {
|
|
18
|
+
children: children
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
var templateObject_1;
|
|
22
|
+
|
|
23
|
+
export { Container };
|
|
24
|
+
//# sourceMappingURL=Container.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Container.mjs';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How DateFormatter shows a date. `'relative'` is deprecated: it has always behaved exactly like
|
|
4
|
+
* `'smart'`, so use `'smart'`. It keeps working until it is removed in 3.0 (#82).
|
|
5
|
+
*/
|
|
6
|
+
export type DateFormatMode = 'absolute' | 'relative' | 'smart';
|
|
7
|
+
export interface DateFormatterProps {
|
|
8
|
+
/** ISO date string to format */
|
|
9
|
+
dateString: string;
|
|
10
|
+
/** Format pattern (defaults to 'yyyy') */
|
|
11
|
+
formatString?: string;
|
|
12
|
+
/**
|
|
13
|
+
* `'absolute'` always uses `formatString`. `'smart'` shows "Today", "Yesterday" or the day name
|
|
14
|
+
* for dates this week, and formats older dates with `formatString`.
|
|
15
|
+
* `'relative'` is deprecated: it behaves exactly like `'smart'`, so use `'smart'`. It keeps
|
|
16
|
+
* working until it is removed in 3.0 (#82).
|
|
17
|
+
* @default 'absolute'
|
|
18
|
+
*/
|
|
19
|
+
mode?: DateFormatMode;
|
|
20
|
+
/** Optional data-testid for testing */
|
|
21
|
+
'data-testid'?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const DateFormatter: React.FC<DateFormatterProps>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { parseISO, format, isToday, isYesterday, isThisWeek } from 'date-fns';
|
|
5
|
+
import styled$module from 'styled-components';
|
|
6
|
+
const styled = styled$module.default || styled$module;
|
|
7
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
8
|
+
|
|
9
|
+
var _a = tokens.semantic,
|
|
10
|
+
typography = _a.typography,
|
|
11
|
+
color = _a.color;
|
|
12
|
+
var TimeStyled = /*#__PURE__*/styled.time.withConfig({
|
|
13
|
+
displayName: "DateFormatter__TimeStyled",
|
|
14
|
+
componentId: "sc-5464cc-0"
|
|
15
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font: ", ";\n color: ", ";\n"], ["\n font: ", ";\n color: ", ";\n"
|
|
16
|
+
/**
|
|
17
|
+
* Formats a date with smart relative/absolute logic
|
|
18
|
+
*/])), typography.label, color.text.muted);
|
|
19
|
+
/**
|
|
20
|
+
* Formats a date with smart relative/absolute logic
|
|
21
|
+
*/
|
|
22
|
+
var formatDateSmart = function formatDateSmart(date, customFormat) {
|
|
23
|
+
// Relative labels for recent dates
|
|
24
|
+
if (isToday(date)) return 'Today';
|
|
25
|
+
if (isYesterday(date)) return 'Yesterday';
|
|
26
|
+
// Show day name for dates within this week
|
|
27
|
+
if (isThisWeek(date, {
|
|
28
|
+
weekStartsOn: 1
|
|
29
|
+
})) {
|
|
30
|
+
return format(date, 'EEEE'); // "Monday", "Tuesday", etc.
|
|
31
|
+
}
|
|
32
|
+
// Fall back to custom format or default full date format
|
|
33
|
+
return format(date, customFormat || 'MMMM dd, yyyy');
|
|
34
|
+
};
|
|
35
|
+
var DateFormatter = function DateFormatter(_a) {
|
|
36
|
+
var dateString = _a.dateString,
|
|
37
|
+
formatString = _a.formatString,
|
|
38
|
+
_b = _a.mode,
|
|
39
|
+
mode = _b === void 0 ? 'absolute' : _b,
|
|
40
|
+
dataTestId = _a["data-testid"];
|
|
41
|
+
var date = parseISO(dateString);
|
|
42
|
+
var displayText;
|
|
43
|
+
switch (mode) {
|
|
44
|
+
case 'relative': // Deprecated alias for 'smart', removed in 3.0 (#82)
|
|
45
|
+
case 'smart':
|
|
46
|
+
// Today, Yesterday or the day name for recent dates; formatted for older ones
|
|
47
|
+
displayText = formatDateSmart(date, formatString);
|
|
48
|
+
break;
|
|
49
|
+
case 'absolute':
|
|
50
|
+
default:
|
|
51
|
+
// Always use the format string (default 'yyyy')
|
|
52
|
+
displayText = format(date, formatString || 'yyyy');
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
return jsx(TimeStyled, {
|
|
56
|
+
dateTime: dateString,
|
|
57
|
+
"data-testid": dataTestId,
|
|
58
|
+
children: displayText
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
var templateObject_1;
|
|
62
|
+
|
|
63
|
+
export { DateFormatter };
|
|
64
|
+
//# sourceMappingURL=DateFormatter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateFormatter.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DateFormatter.mjs';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DividerProps {
|
|
3
|
+
/** Variant style of the divider */
|
|
4
|
+
variant?: 'default' | 'strong' | 'minimal';
|
|
5
|
+
/** Size variation affecting spacing */
|
|
6
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
7
|
+
/** Orientation of the divider */
|
|
8
|
+
orientation?: 'horizontal' | 'vertical';
|
|
9
|
+
/** Data test id for testing */
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Divider is an atomic component that provides visual separation between content sections.
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Multiple variants (default, strong, minimal)
|
|
17
|
+
* - Size variations for different spacing needs
|
|
18
|
+
* - Horizontal and vertical orientations
|
|
19
|
+
* - Semantic token usage for consistent styling
|
|
20
|
+
* - Full accessibility support
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <Divider />
|
|
25
|
+
* <Divider variant="strong" size="xlarge" />
|
|
26
|
+
* <Divider variant="minimal" />
|
|
27
|
+
* <Divider orientation="vertical" />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const Divider: React.FC<DividerProps>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import styled$module from 'styled-components';
|
|
5
|
+
const styled = styled$module.default || styled$module;
|
|
6
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
7
|
+
|
|
8
|
+
// Destructure tokens for cleaner access
|
|
9
|
+
var separatorTokens = tokens.component.separator;
|
|
10
|
+
// Margins come from the semantic separator spacing: no component spacing tokens (decision 0022)
|
|
11
|
+
var space = tokens.semantic.space;
|
|
12
|
+
var StyledDivider = /*#__PURE__*/styled.div.withConfig({
|
|
13
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
14
|
+
return !prop.startsWith('$');
|
|
15
|
+
},
|
|
16
|
+
displayName: "Divider__StyledDivider",
|
|
17
|
+
componentId: "sc-1l0c8ja-0"
|
|
18
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: none;\n \n /* Apply orientation */\n ", "\n \n /* Apply variant styles */\n ", "\n \n /* Apply size styles (spacing) */\n ", "\n"], ["\n border: none;\n \n /* Apply orientation */\n ", "\n \n /* Apply variant styles */\n ", "\n \n /* Apply size styles (spacing) */\n ", "\n"
|
|
19
|
+
/**
|
|
20
|
+
* Divider is an atomic component that provides visual separation between content sections.
|
|
21
|
+
*
|
|
22
|
+
* Features:
|
|
23
|
+
* - Multiple variants (default, strong, minimal)
|
|
24
|
+
* - Size variations for different spacing needs
|
|
25
|
+
* - Horizontal and vertical orientations
|
|
26
|
+
* - Semantic token usage for consistent styling
|
|
27
|
+
* - Full accessibility support
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Divider />
|
|
32
|
+
* <Divider variant="strong" size="xlarge" />
|
|
33
|
+
* <Divider variant="minimal" />
|
|
34
|
+
* <Divider orientation="vertical" />
|
|
35
|
+
* ```
|
|
36
|
+
*/])), function (_a) {
|
|
37
|
+
var _b = _a.$orientation,
|
|
38
|
+
$orientation = _b === void 0 ? 'horizontal' : _b;
|
|
39
|
+
if ($orientation === 'vertical') {
|
|
40
|
+
return "\n display: inline-block;\n height: auto;\n align-self: stretch;\n border-left: ".concat(tokens.semantic.border.width.thin, " solid;\n border-top: none;\n ");
|
|
41
|
+
}
|
|
42
|
+
return "border-top: ".concat(tokens.semantic.border.width.thin, " solid;");
|
|
43
|
+
}, function (_a) {
|
|
44
|
+
var _b = _a.$variant,
|
|
45
|
+
$variant = _b === void 0 ? 'default' : _b,
|
|
46
|
+
_c = _a.$orientation,
|
|
47
|
+
$orientation = _c === void 0 ? 'horizontal' : _c;
|
|
48
|
+
var borderProperty = $orientation === 'vertical' ? 'border-left' : 'border-top';
|
|
49
|
+
switch ($variant) {
|
|
50
|
+
case 'strong':
|
|
51
|
+
return "".concat(borderProperty, ": ").concat(separatorTokens.variants.strong.border, ";");
|
|
52
|
+
case 'minimal':
|
|
53
|
+
return "".concat(borderProperty, ": ").concat(separatorTokens.variants.minimal.border, ";");
|
|
54
|
+
case 'default':
|
|
55
|
+
default:
|
|
56
|
+
return "".concat(borderProperty, ": ").concat(separatorTokens.variants["default"].border, ";");
|
|
57
|
+
}
|
|
58
|
+
}, function (_a) {
|
|
59
|
+
var _b = _a.$size,
|
|
60
|
+
$size = _b === void 0 ? 'large' : _b,
|
|
61
|
+
_c = _a.$variant,
|
|
62
|
+
$variant = _c === void 0 ? 'default' : _c,
|
|
63
|
+
_d = _a.$orientation,
|
|
64
|
+
$orientation = _d === void 0 ? 'horizontal' : _d;
|
|
65
|
+
if ($variant === 'minimal' && $orientation === 'horizontal') {
|
|
66
|
+
// Minimal variant always uses its predefined spacing for horizontal
|
|
67
|
+
return "margin: ".concat(space[600], " 0;");
|
|
68
|
+
}
|
|
69
|
+
if ($orientation === 'vertical') {
|
|
70
|
+
// Vertical orientation uses horizontal margins (left/right)
|
|
71
|
+
switch ($size) {
|
|
72
|
+
case 'small':
|
|
73
|
+
return "margin: 0 ".concat(space[400], ";");
|
|
74
|
+
case 'medium':
|
|
75
|
+
return "margin: 0 ".concat(space[600], ";");
|
|
76
|
+
case 'xlarge':
|
|
77
|
+
return "margin: 0 ".concat(space[1200], ";");
|
|
78
|
+
case 'large':
|
|
79
|
+
default:
|
|
80
|
+
return "margin: 0 ".concat(space[800], ";");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Horizontal orientation uses vertical margins (top/bottom)
|
|
84
|
+
switch ($size) {
|
|
85
|
+
case 'small':
|
|
86
|
+
return "margin: ".concat(space[400], " 0;");
|
|
87
|
+
case 'medium':
|
|
88
|
+
return "margin: ".concat(space[600], " 0;");
|
|
89
|
+
case 'xlarge':
|
|
90
|
+
return "margin: ".concat(space[1200], " 0;");
|
|
91
|
+
case 'large':
|
|
92
|
+
default:
|
|
93
|
+
return "margin: ".concat(space[800], " 0;");
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
/**
|
|
97
|
+
* Divider is an atomic component that provides visual separation between content sections.
|
|
98
|
+
*
|
|
99
|
+
* Features:
|
|
100
|
+
* - Multiple variants (default, strong, minimal)
|
|
101
|
+
* - Size variations for different spacing needs
|
|
102
|
+
* - Horizontal and vertical orientations
|
|
103
|
+
* - Semantic token usage for consistent styling
|
|
104
|
+
* - Full accessibility support
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* <Divider />
|
|
109
|
+
* <Divider variant="strong" size="xlarge" />
|
|
110
|
+
* <Divider variant="minimal" />
|
|
111
|
+
* <Divider orientation="vertical" />
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
var Divider = function Divider(_a) {
|
|
115
|
+
var _b = _a.variant,
|
|
116
|
+
variant = _b === void 0 ? 'default' : _b,
|
|
117
|
+
_c = _a.size,
|
|
118
|
+
size = _c === void 0 ? 'large' : _c,
|
|
119
|
+
_d = _a.orientation,
|
|
120
|
+
orientation = _d === void 0 ? 'horizontal' : _d,
|
|
121
|
+
dataTestId = _a["data-testid"];
|
|
122
|
+
return jsx(StyledDivider, {
|
|
123
|
+
"$variant": variant,
|
|
124
|
+
"$size": size,
|
|
125
|
+
"$orientation": orientation,
|
|
126
|
+
"data-testid": dataTestId,
|
|
127
|
+
role: "separator",
|
|
128
|
+
"aria-orientation": orientation
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
var templateObject_1;
|
|
132
|
+
|
|
133
|
+
export { Divider };
|
|
134
|
+
//# sourceMappingURL=Divider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|