@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,213 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import { useRef, useState, useEffect } 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
|
+
import { forcedColors } from '../../../lib/styleUtils.mjs';
|
|
9
|
+
|
|
10
|
+
var semantic = tokens.semantic;
|
|
11
|
+
var StyledTabList = /*#__PURE__*/styled.div.withConfig({
|
|
12
|
+
displayName: "TabBar__StyledTabList",
|
|
13
|
+
componentId: "sc-1g9ib0y-0"
|
|
14
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n border-bottom: ", " solid ", ";\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: thin;\n \n &::-webkit-scrollbar {\n height: ", ";\n }\n \n &::-webkit-scrollbar-track {\n background: ", ";\n }\n \n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n border-bottom: ", " solid ", ";\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: thin;\n \n &::-webkit-scrollbar {\n height: ", ";\n }\n \n &::-webkit-scrollbar-track {\n background: ", ";\n }\n \n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: ", ";\n }\n"])), semantic.border.width.thin, semantic.color.border.emphasis, tokens.component.tabBar.scrollbar.height, semantic.surface.raised, semantic.color.border["default"], semantic.radius.sm);
|
|
15
|
+
var StyledTab = /*#__PURE__*/styled.button.withConfig({
|
|
16
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
17
|
+
return !prop.startsWith('$');
|
|
18
|
+
},
|
|
19
|
+
displayName: "TabBar__StyledTab",
|
|
20
|
+
componentId: "sc-1g9ib0y-1"
|
|
21
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: ", ";\n padding: ", " ", ";\n font: ", ";\n white-space: nowrap;\n cursor: ", ";\n border: none;\n background: transparent;\n transition: ", ";\n position: relative;\n \n /* Selected tab: the light-blue selected treatment plus a blue underline (decisions 0016, 0020).\n The text darkens with the fill on hover and press so every state stays at least 4.5:1. */\n border-radius: ", " ", " 0 0;\n background-color: ", ";\n color: ", ";\n\n &::after {\n content: '';\n position: absolute;\n bottom: -1px;\n left: 0;\n right: 0;\n height: ", ";\n background-color: ", ";\n transition: ", ";\n }\n\n /* Forced colours drop the fill, so the selected tab's underline carries its state in the\n system selection colour (decision 0038) */\n ", " {\n &::after {\n forced-color-adjust: none;\n background-color: ", ";\n }\n }\n\n &:hover:not(:disabled) {\n background-color: ", ";\n color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n color: ", ";\n }\n\n /* Disabled state */\n opacity: ", ";\n \n /* Focus state */\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n z-index: 1;\n }\n\n"], ["\n display: inline-flex;\n align-items: center;\n gap: ", ";\n padding: ", " ", ";\n font: ", ";\n white-space: nowrap;\n cursor: ", ";\n border: none;\n background: transparent;\n transition: ", ";\n position: relative;\n \n /* Selected tab: the light-blue selected treatment plus a blue underline (decisions 0016, 0020).\n The text darkens with the fill on hover and press so every state stays at least 4.5:1. */\n border-radius: ", " ", " 0 0;\n background-color: ", ";\n color: ", ";\n\n &::after {\n content: '';\n position: absolute;\n bottom: -1px;\n left: 0;\n right: 0;\n height: ", ";\n background-color: ", ";\n transition: ", ";\n }\n\n /* Forced colours drop the fill, so the selected tab's underline carries its state in the\n system selection colour (decision 0038) */\n ", " {\n &::after {\n forced-color-adjust: none;\n background-color: ", ";\n }\n }\n\n &:hover:not(:disabled) {\n background-color: ", ";\n color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n color: ", ";\n }\n\n /* Disabled state */\n opacity: ", ";\n \n /* Focus state */\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n z-index: 1;\n }\n\n"])), semantic.space[200], semantic.space[300], semantic.space[400], tokens.component.button.sizes.medium.font, function (props) {
|
|
22
|
+
return props.$disabled ? 'not-allowed' : 'pointer';
|
|
23
|
+
}, semantic.motion.transition.feedback, semantic.radius.sm, semantic.radius.sm, function (props) {
|
|
24
|
+
return props.$isActive ? semantic.color.fill['accent-muted'] : 'transparent';
|
|
25
|
+
}, function (props) {
|
|
26
|
+
return props.$isActive ? semantic.color.text.accent : semantic.color.text.muted;
|
|
27
|
+
}, semantic.border.width.thick, function (props) {
|
|
28
|
+
return props.$isActive ? semantic.color.fill.accent : 'transparent';
|
|
29
|
+
}, semantic.motion.transition.feedback, forcedColors, function (props) {
|
|
30
|
+
return props.$isActive ? 'Highlight' : 'transparent';
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return props.$isActive ? semantic.color.fill['accent-muted-hover'] : 'transparent';
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return props.$isActive ? semantic.color.text['accent-hover'] : semantic.color.text["default"];
|
|
35
|
+
}, function (props) {
|
|
36
|
+
return props.$isActive ? semantic.color.fill['accent-muted-pressed'] : 'transparent';
|
|
37
|
+
}, function (props) {
|
|
38
|
+
return props.$isActive ? semantic.color.text['accent-pressed'] : semantic.color.text["default"];
|
|
39
|
+
}, function (props) {
|
|
40
|
+
return props.$disabled ? '0.5' : '1';
|
|
41
|
+
}, semantic.border.focus, semantic.border.focusOffset);
|
|
42
|
+
var StyledBadge = /*#__PURE__*/styled.span.withConfig({
|
|
43
|
+
displayName: "TabBar__StyledBadge",
|
|
44
|
+
componentId: "sc-1g9ib0y-2"
|
|
45
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: ", ";\n height: ", ";\n padding: 0 ", ";\n font: ", ";\n font-weight: ", ";\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: ", ";\n height: ", ";\n padding: 0 ", ";\n font: ", ";\n font-weight: ", ";\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n"
|
|
46
|
+
/**
|
|
47
|
+
* TabBar component for tabbed navigation
|
|
48
|
+
*
|
|
49
|
+
* Provides accessible tab navigation with an underline style, keyboard support,
|
|
50
|
+
* and optional badge counts. Follows ARIA tablist pattern.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* const [activeTab, setActiveTab] = useState('all')
|
|
55
|
+
*
|
|
56
|
+
* <TabBar
|
|
57
|
+
* tabs={[
|
|
58
|
+
* { id: 'all', label: 'All', badge: 42 },
|
|
59
|
+
* { id: 'pending', label: 'Pending', badge: 5 },
|
|
60
|
+
* { id: 'completed', label: 'Completed' }
|
|
61
|
+
* ]}
|
|
62
|
+
* activeTab={activeTab}
|
|
63
|
+
* onTabChange={setActiveTab}
|
|
64
|
+
* />
|
|
65
|
+
* ```
|
|
66
|
+
*/])), tokens.component.tabBar.badge.size, tokens.component.tabBar.badge.size, semantic.space[100], tokens.component.tabBar.badge.typography, tokens.component.tabBar.badge.fontWeight, semantic.radius.full, semantic.color.fill.accent, semantic.color.text.inverse);
|
|
67
|
+
/**
|
|
68
|
+
* TabBar component for tabbed navigation
|
|
69
|
+
*
|
|
70
|
+
* Provides accessible tab navigation with an underline style, keyboard support,
|
|
71
|
+
* and optional badge counts. Follows ARIA tablist pattern.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* const [activeTab, setActiveTab] = useState('all')
|
|
76
|
+
*
|
|
77
|
+
* <TabBar
|
|
78
|
+
* tabs={[
|
|
79
|
+
* { id: 'all', label: 'All', badge: 42 },
|
|
80
|
+
* { id: 'pending', label: 'Pending', badge: 5 },
|
|
81
|
+
* { id: 'completed', label: 'Completed' }
|
|
82
|
+
* ]}
|
|
83
|
+
* activeTab={activeTab}
|
|
84
|
+
* onTabChange={setActiveTab}
|
|
85
|
+
* />
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
var TabBar = function TabBar(_a) {
|
|
89
|
+
var tabs = _a.tabs,
|
|
90
|
+
activeTab = _a.activeTab,
|
|
91
|
+
onTabChange = _a.onTabChange;
|
|
92
|
+
// Deprecated: every variant renders as underline (decision 0020)
|
|
93
|
+
_a.variant;
|
|
94
|
+
var _b = _a["aria-label"],
|
|
95
|
+
ariaLabel = _b === void 0 ? 'Tab navigation' : _b,
|
|
96
|
+
dataTestId = _a["data-testid"];
|
|
97
|
+
var tabRefs = useRef([]);
|
|
98
|
+
var _c = useState(function () {
|
|
99
|
+
return tabs.findIndex(function (tab) {
|
|
100
|
+
return tab.id === activeTab;
|
|
101
|
+
});
|
|
102
|
+
}),
|
|
103
|
+
focusedIndex = _c[0],
|
|
104
|
+
setFocusedIndex = _c[1];
|
|
105
|
+
// Update focused index when active tab changes externally
|
|
106
|
+
useEffect(function () {
|
|
107
|
+
var newIndex = tabs.findIndex(function (tab) {
|
|
108
|
+
return tab.id === activeTab;
|
|
109
|
+
});
|
|
110
|
+
if (newIndex !== -1) {
|
|
111
|
+
setFocusedIndex(newIndex);
|
|
112
|
+
}
|
|
113
|
+
}, [activeTab, tabs]);
|
|
114
|
+
var handleTabClick = function handleTabClick(tab, index) {
|
|
115
|
+
if (!tab.disabled) {
|
|
116
|
+
onTabChange(tab.id);
|
|
117
|
+
setFocusedIndex(index);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
var handleKeyDown = function handleKeyDown(event, index) {
|
|
121
|
+
var _a;
|
|
122
|
+
var newIndex = index;
|
|
123
|
+
switch (event.key) {
|
|
124
|
+
case 'ArrowLeft':
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
// Find previous non-disabled tab
|
|
127
|
+
newIndex = index - 1;
|
|
128
|
+
while (newIndex >= 0 && tabs[newIndex].disabled) {
|
|
129
|
+
newIndex--;
|
|
130
|
+
}
|
|
131
|
+
if (newIndex < 0) {
|
|
132
|
+
// Wrap to last non-disabled tab
|
|
133
|
+
newIndex = tabs.length - 1;
|
|
134
|
+
while (newIndex > index && tabs[newIndex].disabled) {
|
|
135
|
+
newIndex--;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
break;
|
|
139
|
+
case 'ArrowRight':
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
// Find next non-disabled tab
|
|
142
|
+
newIndex = index + 1;
|
|
143
|
+
while (newIndex < tabs.length && tabs[newIndex].disabled) {
|
|
144
|
+
newIndex++;
|
|
145
|
+
}
|
|
146
|
+
if (newIndex >= tabs.length) {
|
|
147
|
+
// Wrap to first non-disabled tab
|
|
148
|
+
newIndex = 0;
|
|
149
|
+
while (newIndex < index && tabs[newIndex].disabled) {
|
|
150
|
+
newIndex++;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
case 'Home':
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
// Focus first non-disabled tab
|
|
157
|
+
newIndex = 0;
|
|
158
|
+
while (newIndex < tabs.length && tabs[newIndex].disabled) {
|
|
159
|
+
newIndex++;
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
162
|
+
case 'End':
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
// Focus last non-disabled tab
|
|
165
|
+
newIndex = tabs.length - 1;
|
|
166
|
+
while (newIndex >= 0 && tabs[newIndex].disabled) {
|
|
167
|
+
newIndex--;
|
|
168
|
+
}
|
|
169
|
+
break;
|
|
170
|
+
default:
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (newIndex !== index && newIndex >= 0 && newIndex < tabs.length) {
|
|
174
|
+
setFocusedIndex(newIndex);
|
|
175
|
+
(_a = tabRefs.current[newIndex]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
return jsx(StyledTabList, {
|
|
179
|
+
role: "tablist",
|
|
180
|
+
"aria-label": ariaLabel,
|
|
181
|
+
"data-testid": dataTestId,
|
|
182
|
+
children: tabs.map(function (tab, index) {
|
|
183
|
+
return jsxs(StyledTab, {
|
|
184
|
+
ref: function ref(el) {
|
|
185
|
+
tabRefs.current[index] = el;
|
|
186
|
+
},
|
|
187
|
+
"$isActive": tab.id === activeTab,
|
|
188
|
+
"$disabled": tab.disabled || false,
|
|
189
|
+
role: "tab",
|
|
190
|
+
"aria-selected": tab.id === activeTab,
|
|
191
|
+
"aria-disabled": tab.disabled || false,
|
|
192
|
+
tabIndex: index === focusedIndex ? 0 : -1,
|
|
193
|
+
disabled: tab.disabled,
|
|
194
|
+
onClick: function onClick() {
|
|
195
|
+
return handleTabClick(tab, index);
|
|
196
|
+
},
|
|
197
|
+
onKeyDown: function onKeyDown(e) {
|
|
198
|
+
return handleKeyDown(e, index);
|
|
199
|
+
},
|
|
200
|
+
"data-testid": "".concat(dataTestId, "-tab-").concat(tab.id),
|
|
201
|
+
children: [tab.label, typeof tab.badge === 'number' && tab.badge > 0 && jsx(StyledBadge, {
|
|
202
|
+
"aria-label": "".concat(tab.badge, " items"),
|
|
203
|
+
children: tab.badge > 99 ? '99+' : tab.badge
|
|
204
|
+
})]
|
|
205
|
+
}, tab.id);
|
|
206
|
+
})
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
TabBar.displayName = 'TabBar';
|
|
210
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
211
|
+
|
|
212
|
+
export { TabBar };
|
|
213
|
+
//# sourceMappingURL=TabBar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabBar.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared input states for text-based form controls
|
|
3
|
+
*/
|
|
4
|
+
export type InputState = 'default' | 'focus' | 'error' | 'disabled';
|
|
5
|
+
/**
|
|
6
|
+
* Base styled input component with all common styling
|
|
7
|
+
* Reusable across TextField, TextArea, PasswordInput, NumberInput
|
|
8
|
+
*/
|
|
9
|
+
interface StyledInputBaseProps {
|
|
10
|
+
$hasError?: boolean;
|
|
11
|
+
$disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const StyledInputBase: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Merged<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "style"> & {
|
|
14
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types.js").CSSPropertiesWithVars | undefined;
|
|
15
|
+
}, StyledInputBaseProps>> & string;
|
|
16
|
+
/**
|
|
17
|
+
* Base styled textarea with shared styling
|
|
18
|
+
*/
|
|
19
|
+
export declare const StyledTextAreaBase: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Merged<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "style"> & {
|
|
20
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types.js").CSSPropertiesWithVars | undefined;
|
|
21
|
+
}, StyledInputBaseProps>> & string;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import styled$module, { css } from 'styled-components';
|
|
4
|
+
const styled = styled$module.default || styled$module;
|
|
5
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
6
|
+
|
|
7
|
+
var input = tokens.component.input,
|
|
8
|
+
semantic = tokens.semantic;
|
|
9
|
+
/**
|
|
10
|
+
* Styles shared by the single-line input and the textarea. Each element sets its
|
|
11
|
+
* own min-height and padding. Interpolating a styled component into another's CSS
|
|
12
|
+
* inserts its class selector, not its styles, so the sharing goes through `css`.
|
|
13
|
+
*/
|
|
14
|
+
var inputBaseStyles = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n /* Typography */\n font: ", ";\n color: ", ";\n \n /* Layout */\n box-sizing: border-box; /* the min-height includes the border, without relying on a global reset */\n width: 100%;\n \n /* Visual styling */\n background-color: ", ";\n \n border: ", " solid ", ";\n \n border-radius: ", ";\n \n /* Remove default appearance */\n appearance: none;\n outline: none;\n \n /* Transitions */\n transition: border-color ", " ", ",\n outline ", " ", ";\n \n /* Placeholder */\n &::placeholder {\n color: ", ";\n opacity: 1;\n }\n \n /* Focus state */\n &:focus {\n border-color: ", ";\n outline: ", ";\n outline-offset: ", ";\n }\n \n /* Hover state (only when not disabled) */\n &:hover:not(:disabled) {\n border-color: ", ";\n }\n \n /* Disabled state */\n &:disabled {\n cursor: not-allowed;\n }\n \n /* Remove number input spinners */\n &[type='number']::-webkit-inner-spin-button,\n &[type='number']::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n \n &[type='number'] {\n -moz-appearance: textfield;\n }\n"], ["\n /* Typography */\n font: ", ";\n color: ", ";\n \n /* Layout */\n box-sizing: border-box; /* the min-height includes the border, without relying on a global reset */\n width: 100%;\n \n /* Visual styling */\n background-color: ", ";\n \n border: ", " solid ", ";\n \n border-radius: ", ";\n \n /* Remove default appearance */\n appearance: none;\n outline: none;\n \n /* Transitions */\n transition: border-color ", " ", ",\n outline ", " ", ";\n \n /* Placeholder */\n &::placeholder {\n color: ", ";\n opacity: 1;\n }\n \n /* Focus state */\n &:focus {\n border-color: ", ";\n outline: ", ";\n outline-offset: ", ";\n }\n \n /* Hover state (only when not disabled) */\n &:hover:not(:disabled) {\n border-color: ", ";\n }\n \n /* Disabled state */\n &:disabled {\n cursor: not-allowed;\n }\n \n /* Remove number input spinners */\n &[type='number']::-webkit-inner-spin-button,\n &[type='number']::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n \n &[type='number'] {\n -moz-appearance: textfield;\n }\n"])), input["default"].font, function (_a) {
|
|
15
|
+
var $disabled = _a.$disabled;
|
|
16
|
+
return $disabled ? input.disabled.textColor : input["default"].textColor;
|
|
17
|
+
}, function (_a) {
|
|
18
|
+
var $disabled = _a.$disabled;
|
|
19
|
+
return $disabled ? input.disabled.backgroundColor : input["default"].backgroundColor;
|
|
20
|
+
}, input["default"].borderWidth, function (_a) {
|
|
21
|
+
var $hasError = _a.$hasError,
|
|
22
|
+
$disabled = _a.$disabled;
|
|
23
|
+
if ($disabled) return input.disabled.borderColor;
|
|
24
|
+
if ($hasError) return input.error.borderColor;
|
|
25
|
+
return input["default"].borderColor;
|
|
26
|
+
}, input["default"].borderRadius, tokens.semantic.motion.duration.moderate, tokens.semantic.motion.easing.standard, tokens.semantic.motion.duration.moderate, tokens.semantic.motion.easing.standard, input.placeholder.textColor, function (_a) {
|
|
27
|
+
var $hasError = _a.$hasError;
|
|
28
|
+
return $hasError ? input.error.focus.borderColor : input.focus.borderColor;
|
|
29
|
+
}, input.focus.outline, semantic.border.focusOffset, function (_a) {
|
|
30
|
+
var $hasError = _a.$hasError;
|
|
31
|
+
return $hasError ? input.error.hover.borderColor : input.hover.borderColor;
|
|
32
|
+
});
|
|
33
|
+
var StyledInputBase = /*#__PURE__*/styled.input.withConfig({
|
|
34
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
35
|
+
return !prop.startsWith('$');
|
|
36
|
+
},
|
|
37
|
+
displayName: "InputBase__StyledInputBase",
|
|
38
|
+
componentId: "sc-1bpf4e8-0"
|
|
39
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n min-height: ", ";\n padding: 0 ", ";\n"], ["\n ", "\n min-height: ", ";\n padding: 0 ", ";\n"
|
|
40
|
+
/**
|
|
41
|
+
* Base styled textarea with shared styling
|
|
42
|
+
*/])), inputBaseStyles, semantic.size.control.lg, semantic.space.inset.lg);
|
|
43
|
+
/**
|
|
44
|
+
* Base styled textarea with shared styling
|
|
45
|
+
*/
|
|
46
|
+
var StyledTextAreaBase = /*#__PURE__*/styled.textarea.withConfig({
|
|
47
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
48
|
+
return !prop.startsWith('$');
|
|
49
|
+
},
|
|
50
|
+
displayName: "InputBase__StyledTextAreaBase",
|
|
51
|
+
componentId: "sc-1bpf4e8-1"
|
|
52
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n \n /* TextArea specific: a taller minimum for multi-line entry (decision 0034) */\n min-height: ", ";\n padding: ", " ", ";\n resize: vertical;\n"], ["\n ", "\n \n /* TextArea specific: a taller minimum for multi-line entry (decision 0034) */\n min-height: ", ";\n padding: ", " ", ";\n resize: vertical;\n"])), inputBaseStyles, input.textarea.minHeight, semantic.space.inset.md, semantic.space.inset.lg);
|
|
53
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
54
|
+
|
|
55
|
+
export { StyledInputBase, StyledTextAreaBase };
|
|
56
|
+
//# sourceMappingURL=InputBase.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputBase.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the TextField component
|
|
4
|
+
*/
|
|
5
|
+
export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
6
|
+
/**
|
|
7
|
+
* Label text for the input
|
|
8
|
+
*/
|
|
9
|
+
label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Helper text displayed below the input
|
|
12
|
+
*/
|
|
13
|
+
helperText?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Error message to display
|
|
16
|
+
*/
|
|
17
|
+
error?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the field is required
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
required?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the input is disabled
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Input type
|
|
30
|
+
* @default 'text'
|
|
31
|
+
*/
|
|
32
|
+
type?: 'text' | 'email' | 'tel' | 'url' | 'search';
|
|
33
|
+
/**
|
|
34
|
+
* Unique identifier for the input
|
|
35
|
+
* Generated automatically if not provided
|
|
36
|
+
*/
|
|
37
|
+
id?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Test identifier for automated testing
|
|
40
|
+
*/
|
|
41
|
+
'data-testid'?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* TextField component for text input with label, helper text, and error states
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <TextField
|
|
49
|
+
* label="Email"
|
|
50
|
+
* type="email"
|
|
51
|
+
* helperText="We'll never share your email"
|
|
52
|
+
* required
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject, __rest, __assign } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { forwardRef, useId } from 'react';
|
|
5
|
+
import styled$module from 'styled-components';
|
|
6
|
+
const styled = styled$module.default || styled$module;
|
|
7
|
+
import { StyledInputBase } from './InputBase.mjs';
|
|
8
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
9
|
+
|
|
10
|
+
var field = tokens.component.field;
|
|
11
|
+
// Gaps come from the semantic spacing scale: no component spacing tokens (decision 0022)
|
|
12
|
+
var space = tokens.semantic.space;
|
|
13
|
+
var StyledFieldContainer = /*#__PURE__*/styled.div.withConfig({
|
|
14
|
+
displayName: "TextField__StyledFieldContainer",
|
|
15
|
+
componentId: "sc-1ys3b0-0"
|
|
16
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", ";\n width: 100%;\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", ";\n width: 100%;\n"])), space[200]);
|
|
17
|
+
var StyledLabel = /*#__PURE__*/styled.label.withConfig({
|
|
18
|
+
displayName: "TextField__StyledLabel",
|
|
19
|
+
componentId: "sc-1ys3b0-1"
|
|
20
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", ";\n font: ", ";\n color: ", ";\n\n &[data-disabled='true'] {\n color: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n gap: ", ";\n font: ", ";\n color: ", ";\n\n &[data-disabled='true'] {\n color: ", ";\n }\n"])), space[100], field.label.typography, field.label.color, field.label.colorDisabled);
|
|
21
|
+
var StyledRequiredIndicator = /*#__PURE__*/styled.span.withConfig({
|
|
22
|
+
displayName: "TextField__StyledRequiredIndicator",
|
|
23
|
+
componentId: "sc-1ys3b0-2"
|
|
24
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n font-weight: ", ";\n"], ["\n color: ", ";\n font-weight: ", ";\n"])), field.requiredIndicator.color, field.requiredIndicator.fontWeight);
|
|
25
|
+
var StyledHelperText = /*#__PURE__*/styled.div.withConfig({
|
|
26
|
+
displayName: "TextField__StyledHelperText",
|
|
27
|
+
componentId: "sc-1ys3b0-3"
|
|
28
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font: ", ";\n color: ", ";\n"], ["\n font: ", ";\n color: ", ";\n"
|
|
29
|
+
/**
|
|
30
|
+
* TextField component for text input with label, helper text, and error states
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <TextField
|
|
35
|
+
* label="Email"
|
|
36
|
+
* type="email"
|
|
37
|
+
* helperText="We'll never share your email"
|
|
38
|
+
* required
|
|
39
|
+
* />
|
|
40
|
+
* ```
|
|
41
|
+
*/])), field.helperText.typography, function (_a) {
|
|
42
|
+
var $hasError = _a.$hasError;
|
|
43
|
+
return $hasError ? field.helperText.colorError : field.helperText.color;
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* TextField component for text input with label, helper text, and error states
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <TextField
|
|
51
|
+
* label="Email"
|
|
52
|
+
* type="email"
|
|
53
|
+
* helperText="We'll never share your email"
|
|
54
|
+
* required
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
var TextField = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
59
|
+
var label = _a.label,
|
|
60
|
+
helperText = _a.helperText,
|
|
61
|
+
error = _a.error,
|
|
62
|
+
_b = _a.required,
|
|
63
|
+
required = _b === void 0 ? false : _b,
|
|
64
|
+
_c = _a.disabled,
|
|
65
|
+
disabled = _c === void 0 ? false : _c,
|
|
66
|
+
_d = _a.type,
|
|
67
|
+
type = _d === void 0 ? 'text' : _d,
|
|
68
|
+
providedId = _a.id,
|
|
69
|
+
dataTestId = _a["data-testid"],
|
|
70
|
+
inputProps = __rest(_a, ["label", "helperText", "error", "required", "disabled", "type", "id", 'data-testid']);
|
|
71
|
+
// Generate unique ID if not provided
|
|
72
|
+
var generatedId = useId();
|
|
73
|
+
var id = providedId || generatedId;
|
|
74
|
+
// IDs for ARIA relationships
|
|
75
|
+
var errorId = error ? "".concat(id, "-error") : undefined;
|
|
76
|
+
var helperId = helperText && !error ? "".concat(id, "-helper") : undefined;
|
|
77
|
+
var describedBy = [errorId, helperId].filter(Boolean).join(' ') || undefined;
|
|
78
|
+
var hasError = Boolean(error);
|
|
79
|
+
return jsxs(StyledFieldContainer, {
|
|
80
|
+
"data-testid": dataTestId,
|
|
81
|
+
children: [label && jsxs(StyledLabel, {
|
|
82
|
+
htmlFor: id,
|
|
83
|
+
"data-disabled": disabled,
|
|
84
|
+
children: [label, required && jsx(StyledRequiredIndicator, {
|
|
85
|
+
"aria-label": "required",
|
|
86
|
+
children: "*"
|
|
87
|
+
})]
|
|
88
|
+
}), jsx(StyledInputBase, __assign({
|
|
89
|
+
ref: ref,
|
|
90
|
+
id: id,
|
|
91
|
+
type: type,
|
|
92
|
+
disabled: disabled,
|
|
93
|
+
required: required,
|
|
94
|
+
"aria-required": required,
|
|
95
|
+
"aria-invalid": hasError,
|
|
96
|
+
"aria-describedby": describedBy,
|
|
97
|
+
"$hasError": hasError,
|
|
98
|
+
"$disabled": disabled
|
|
99
|
+
}, inputProps)), error && jsx(StyledHelperText, {
|
|
100
|
+
id: errorId,
|
|
101
|
+
role: "alert",
|
|
102
|
+
"aria-live": "polite",
|
|
103
|
+
"$hasError": true,
|
|
104
|
+
children: error
|
|
105
|
+
}), helperText && !error && jsx(StyledHelperText, {
|
|
106
|
+
id: helperId,
|
|
107
|
+
children: helperText
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
TextField.displayName = 'TextField';
|
|
112
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
113
|
+
|
|
114
|
+
export { TextField };
|
|
115
|
+
//# sourceMappingURL=TextField.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TransactionStatus = 'completed' | 'pending' | 'failed';
|
|
3
|
+
export type TransactionCategory = 'shopping' | 'dining' | 'transport' | 'entertainment' | 'bills' | 'other';
|
|
4
|
+
export interface TransactionListItemProps {
|
|
5
|
+
/** Merchant or transaction name */
|
|
6
|
+
merchant: string;
|
|
7
|
+
/** Transaction amount (positive for income, negative for expense) */
|
|
8
|
+
amount: number;
|
|
9
|
+
/** Transaction date */
|
|
10
|
+
date: Date | string;
|
|
11
|
+
/** Transaction status */
|
|
12
|
+
status?: TransactionStatus;
|
|
13
|
+
/** Transaction category */
|
|
14
|
+
category?: TransactionCategory;
|
|
15
|
+
/** Optional merchant logo URL */
|
|
16
|
+
merchantLogo?: string;
|
|
17
|
+
/** Optional description or note */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Whether this transaction has a receipt attached */
|
|
20
|
+
hasReceipt?: boolean;
|
|
21
|
+
/** Whether this transaction has notes attached */
|
|
22
|
+
hasNote?: boolean;
|
|
23
|
+
/** Currency code */
|
|
24
|
+
currency?: string;
|
|
25
|
+
/** Click handler for the transaction */
|
|
26
|
+
onClick?: () => void;
|
|
27
|
+
/** Test identifier for automated testing */
|
|
28
|
+
'data-testid'?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* TransactionListItem component
|
|
32
|
+
*
|
|
33
|
+
* Displays a single transaction in a list with merchant info, amount, date,
|
|
34
|
+
* status, and optional metadata (category, receipt, notes). Minimum height 72px
|
|
35
|
+
* with interactive states for clickable items.
|
|
36
|
+
*
|
|
37
|
+
* Composes: Avatar, Badge, MoneyDisplay, Icon, DateFormatter, Typography, Stack
|
|
38
|
+
*/
|
|
39
|
+
export declare const TransactionListItem: React.FC<TransactionListItemProps>;
|