@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,340 @@
|
|
|
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, useState, useRef, useEffect, useMemo } from 'react';
|
|
5
|
+
import styled$module from 'styled-components';
|
|
6
|
+
const styled = styled$module.default || styled$module;
|
|
7
|
+
import { Icon } from '../../atoms/Icon/Icon.mjs';
|
|
8
|
+
import { IconButton } from '../../atoms/IconButton/IconButton.mjs';
|
|
9
|
+
import { ListItem } from '../List/ListItem.mjs';
|
|
10
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
11
|
+
import { rowStates } from '../../../lib/styleUtils.mjs';
|
|
12
|
+
|
|
13
|
+
var semantic = tokens.semantic,
|
|
14
|
+
component = tokens.component;
|
|
15
|
+
var StyledSearchContainer = /*#__PURE__*/styled.div.withConfig({
|
|
16
|
+
displayName: "SearchField__StyledSearchContainer",
|
|
17
|
+
componentId: "sc-qhz9i8-0"
|
|
18
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n"], ["\n position: relative;\n width: 100%;\n"])));
|
|
19
|
+
var StyledInputWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
20
|
+
displayName: "SearchField__StyledInputWrapper",
|
|
21
|
+
componentId: "sc-qhz9i8-1"
|
|
22
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", ";\n /* The field's height comes from size.control.lg as a minimum, matching the other fields\n (decision 0034); the padding only matters if the content grows past it */\n box-sizing: border-box;\n min-height: ", ";\n padding: ", " ", ";\n background-color: ", ";\n border: ", " solid ", ";\n border-radius: ", ";\n transition: border-color ", " ", ", outline ", " ", ";\n \n ", "\n \n ", "\n \n &:hover:not([data-disabled='true']) {\n border-color: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n gap: ", ";\n /* The field's height comes from size.control.lg as a minimum, matching the other fields\n (decision 0034); the padding only matters if the content grows past it */\n box-sizing: border-box;\n min-height: ", ";\n padding: ", " ", ";\n background-color: ", ";\n border: ", " solid ", ";\n border-radius: ", ";\n transition: border-color ", " ", ", outline ", " ", ";\n \n ", "\n \n ", "\n \n &:hover:not([data-disabled='true']) {\n border-color: ", ";\n }\n"])), semantic.space[200], semantic.size.control.lg, semantic.space[200], semantic.space[300], component.input["default"].backgroundColor, component.input["default"].borderWidth, component.input["default"].borderColor, component.input["default"].borderRadius, semantic.motion.duration.moderate, semantic.motion.easing.standard, semantic.motion.duration.moderate, semantic.motion.easing.standard, function (props) {
|
|
23
|
+
return props.$isFocused && "\n border-color: ".concat(component.input.focus.borderColor, ";\n outline: ").concat(component.input.focus.outline, ";\n outline-offset: ").concat(semantic.border.focusOffset, ";\n ");
|
|
24
|
+
}, function (props) {
|
|
25
|
+
return props.$disabled && "\n background-color: ".concat(component.input.disabled.backgroundColor, ";\n border-color: ").concat(component.input.disabled.borderColor, ";\n cursor: not-allowed;\n ");
|
|
26
|
+
}, component.input.hover.borderColor);
|
|
27
|
+
var StyledInput = /*#__PURE__*/styled.input.withConfig({
|
|
28
|
+
displayName: "SearchField__StyledInput",
|
|
29
|
+
componentId: "sc-qhz9i8-2"
|
|
30
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex: 1;\n border: none;\n background: transparent;\n font: ", ";\n color: ", ";\n outline: none;\n \n &::placeholder {\n color: ", ";\n /* Firefox fades placeholders to 0.54 by default, which would undo the 4.5:1 contrast */\n opacity: 1;\n }\n \n &:disabled {\n color: ", ";\n cursor: not-allowed;\n }\n"], ["\n flex: 1;\n border: none;\n background: transparent;\n font: ", ";\n color: ", ";\n outline: none;\n \n &::placeholder {\n color: ", ";\n /* Firefox fades placeholders to 0.54 by default, which would undo the 4.5:1 contrast */\n opacity: 1;\n }\n \n &:disabled {\n color: ", ";\n cursor: not-allowed;\n }\n"])), semantic.typography.body, semantic.color.text["default"], component.input.placeholder.textColor, semantic.color.text.disabled);
|
|
31
|
+
var StyledSuggestionsList = /*#__PURE__*/styled.ul.withConfig({
|
|
32
|
+
displayName: "SearchField__StyledSuggestionsList",
|
|
33
|
+
componentId: "sc-qhz9i8-3"
|
|
34
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n top: calc(100% + ", ");\n left: 0;\n right: 0;\n max-height: ", ";\n overflow-y: auto;\n background-color: ", ";\n border: ", " solid ", ";\n border-radius: ", ";\n box-shadow: ", ";\n list-style: none;\n padding: ", " 0;\n margin: 0;\n z-index: ", ";\n\n /* The highlighted suggestion has keyboard focus, which is grey, not the light-blue selected\n treatment (decision 0029). Its row is the option's first child. While pressed, the row's own\n pressed state shows (decision 0030) */\n & > [data-highlighted] > :first-child:not(:active) {\n background-color: ", ";\n }\n"], ["\n position: absolute;\n top: calc(100% + ", ");\n left: 0;\n right: 0;\n max-height: ", ";\n overflow-y: auto;\n background-color: ", ";\n border: ", " solid ", ";\n border-radius: ", ";\n box-shadow: ", ";\n list-style: none;\n padding: ", " 0;\n margin: 0;\n z-index: ", ";\n\n /* The highlighted suggestion has keyboard focus, which is grey, not the light-blue selected\n treatment (decision 0029). Its row is the option's first child. While pressed, the row's own\n pressed state shows (decision 0030) */\n & > [data-highlighted] > :first-child:not(:active) {\n background-color: ", ";\n }\n"])), semantic.space[100], tokens.semantic.size.menu.maxHeight, semantic.surface.raised, semantic.border.width.thin, semantic.color.border["default"], semantic.radius.md, semantic.elevation.floating, semantic.space[100], semantic.layer.dropdown, rowStates.unselected.hover.background);
|
|
35
|
+
var StyledSectionHeader = /*#__PURE__*/styled.div.withConfig({
|
|
36
|
+
displayName: "SearchField__StyledSectionHeader",
|
|
37
|
+
componentId: "sc-qhz9i8-4"
|
|
38
|
+
})(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: ", " ", ";\n font: ", ";\n color: ", ";\n text-transform: uppercase;\n letter-spacing: ", ";\n"], ["\n padding: ", " ", ";\n font: ", ";\n color: ", ";\n text-transform: uppercase;\n letter-spacing: ", ";\n"])), semantic.space[200], semantic.space[300], tokens.component.searchField.sectionHeader.typography, semantic.color.text.muted, tokens.component.searchField.sectionHeader.letterSpacing);
|
|
39
|
+
var debounce = function debounce(func, wait) {
|
|
40
|
+
var timeout = null;
|
|
41
|
+
return function () {
|
|
42
|
+
var args = [];
|
|
43
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
44
|
+
args[_i] = arguments[_i];
|
|
45
|
+
}
|
|
46
|
+
if (timeout) clearTimeout(timeout);
|
|
47
|
+
timeout = setTimeout(function () {
|
|
48
|
+
return func.apply(void 0, args);
|
|
49
|
+
}, wait);
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* SearchField component with autocomplete and recent searches
|
|
54
|
+
*
|
|
55
|
+
* Provides intelligent search with debouncing, keyboard navigation,
|
|
56
|
+
* suggestions, and recent search history. Fully accessible with ARIA.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* const [search, setSearch] = useState('')
|
|
61
|
+
* const [suggestions] = useState([
|
|
62
|
+
* { id: '1', label: 'Apple', category: 'Fruit' },
|
|
63
|
+
* { id: '2', label: 'Banana', category: 'Fruit' }
|
|
64
|
+
* ])
|
|
65
|
+
*
|
|
66
|
+
* <SearchField
|
|
67
|
+
* value={search}
|
|
68
|
+
* onChange={setSearch}
|
|
69
|
+
* suggestions={suggestions}
|
|
70
|
+
* recentSearches={['coffee', 'tea']}
|
|
71
|
+
* onSuggestionSelect={(item) => console.log('Selected:', item)}
|
|
72
|
+
* />
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
var SearchField = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
76
|
+
var value = _a.value,
|
|
77
|
+
onChange = _a.onChange,
|
|
78
|
+
_b = _a.suggestions,
|
|
79
|
+
suggestions = _b === void 0 ? [] : _b,
|
|
80
|
+
_c = _a.showRecentSearches,
|
|
81
|
+
showRecentSearches = _c === void 0 ? true : _c,
|
|
82
|
+
_d = _a.recentSearches,
|
|
83
|
+
recentSearches = _d === void 0 ? [] : _d,
|
|
84
|
+
onSuggestionSelect = _a.onSuggestionSelect,
|
|
85
|
+
onClearRecentSearches = _a.onClearRecentSearches,
|
|
86
|
+
_e = _a.debounceMs,
|
|
87
|
+
debounceMs = _e === void 0 ? 300 : _e,
|
|
88
|
+
_f = _a.placeholder,
|
|
89
|
+
placeholder = _f === void 0 ? 'Search...' : _f,
|
|
90
|
+
_g = _a.disabled,
|
|
91
|
+
disabled = _g === void 0 ? false : _g,
|
|
92
|
+
_h = _a.loading,
|
|
93
|
+
loading = _h === void 0 ? false : _h,
|
|
94
|
+
_j = _a["aria-label"],
|
|
95
|
+
ariaLabel = _j === void 0 ? 'Search' : _j,
|
|
96
|
+
dataTestId = _a["data-testid"],
|
|
97
|
+
inputProps = __rest(_a, ["value", "onChange", "suggestions", "showRecentSearches", "recentSearches", "onSuggestionSelect", "onClearRecentSearches", "debounceMs", "placeholder", "disabled", "loading", 'aria-label', 'data-testid']);
|
|
98
|
+
var _k = useState(false),
|
|
99
|
+
isFocused = _k[0],
|
|
100
|
+
setIsFocused = _k[1];
|
|
101
|
+
var _l = useState(false),
|
|
102
|
+
showSuggestions = _l[0],
|
|
103
|
+
setShowSuggestions = _l[1];
|
|
104
|
+
var _m = useState(-1),
|
|
105
|
+
highlightedIndex = _m[0],
|
|
106
|
+
setHighlightedIndex = _m[1];
|
|
107
|
+
var _o = useState(value);
|
|
108
|
+
_o[0];
|
|
109
|
+
var setDebouncedValue = _o[1];
|
|
110
|
+
var inputRef = useRef(null);
|
|
111
|
+
var listRef = useRef(null);
|
|
112
|
+
// Combine refs
|
|
113
|
+
useEffect(function () {
|
|
114
|
+
if (ref) {
|
|
115
|
+
if (typeof ref === 'function') {
|
|
116
|
+
ref(inputRef.current);
|
|
117
|
+
} else {
|
|
118
|
+
ref.current = inputRef.current;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, [ref]);
|
|
122
|
+
// Debounced search
|
|
123
|
+
var debouncedOnChange = useMemo(function () {
|
|
124
|
+
return debounce(function (newValue) {
|
|
125
|
+
setDebouncedValue(newValue);
|
|
126
|
+
}, debounceMs);
|
|
127
|
+
}, [debounceMs]);
|
|
128
|
+
useEffect(function () {
|
|
129
|
+
debouncedOnChange(value);
|
|
130
|
+
}, [value, debouncedOnChange]);
|
|
131
|
+
// Combined list of suggestions and recent searches
|
|
132
|
+
var displayItems = useMemo(function () {
|
|
133
|
+
var items = [];
|
|
134
|
+
if (value.trim()) {
|
|
135
|
+
// Show matching suggestions
|
|
136
|
+
suggestions.forEach(function (s) {
|
|
137
|
+
return items.push({
|
|
138
|
+
type: 'suggestion',
|
|
139
|
+
data: s
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
} else if (showRecentSearches && recentSearches.length > 0) {
|
|
143
|
+
// Show recent searches when empty
|
|
144
|
+
recentSearches.forEach(function (r) {
|
|
145
|
+
return items.push({
|
|
146
|
+
type: 'recent',
|
|
147
|
+
data: r
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
if (onClearRecentSearches) {
|
|
151
|
+
items.push({
|
|
152
|
+
type: 'clear',
|
|
153
|
+
data: 'clear'
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return items;
|
|
158
|
+
}, [value, suggestions, recentSearches, showRecentSearches, onClearRecentSearches]);
|
|
159
|
+
var handleInputChange = function handleInputChange(e) {
|
|
160
|
+
var newValue = e.target.value;
|
|
161
|
+
onChange(newValue);
|
|
162
|
+
setShowSuggestions(true);
|
|
163
|
+
setHighlightedIndex(-1);
|
|
164
|
+
};
|
|
165
|
+
var handleFocus = function handleFocus(e) {
|
|
166
|
+
var _a;
|
|
167
|
+
setIsFocused(true);
|
|
168
|
+
setShowSuggestions(true);
|
|
169
|
+
(_a = inputProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
170
|
+
};
|
|
171
|
+
var handleBlur = function handleBlur(e) {
|
|
172
|
+
var _a;
|
|
173
|
+
// Delay to allow click events on suggestions
|
|
174
|
+
setTimeout(function () {
|
|
175
|
+
setIsFocused(false);
|
|
176
|
+
setShowSuggestions(false);
|
|
177
|
+
setHighlightedIndex(-1);
|
|
178
|
+
}, 200);
|
|
179
|
+
(_a = inputProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
180
|
+
};
|
|
181
|
+
var handleSuggestionClick = function handleSuggestionClick(item) {
|
|
182
|
+
var _a;
|
|
183
|
+
if (item.type === 'clear') {
|
|
184
|
+
onClearRecentSearches === null || onClearRecentSearches === void 0 ? void 0 : onClearRecentSearches();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
var suggestion = item.data;
|
|
188
|
+
if (typeof suggestion === 'string') {
|
|
189
|
+
onChange(suggestion);
|
|
190
|
+
onSuggestionSelect === null || onSuggestionSelect === void 0 ? void 0 : onSuggestionSelect(suggestion);
|
|
191
|
+
} else {
|
|
192
|
+
onChange(suggestion.label);
|
|
193
|
+
onSuggestionSelect === null || onSuggestionSelect === void 0 ? void 0 : onSuggestionSelect(suggestion);
|
|
194
|
+
}
|
|
195
|
+
setShowSuggestions(false);
|
|
196
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
197
|
+
};
|
|
198
|
+
var handleClear = function handleClear() {
|
|
199
|
+
var _a;
|
|
200
|
+
onChange('');
|
|
201
|
+
setShowSuggestions(false);
|
|
202
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
203
|
+
};
|
|
204
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
205
|
+
var _a;
|
|
206
|
+
if (!showSuggestions || displayItems.length === 0) return;
|
|
207
|
+
switch (e.key) {
|
|
208
|
+
case 'ArrowDown':
|
|
209
|
+
e.preventDefault();
|
|
210
|
+
setHighlightedIndex(function (prev) {
|
|
211
|
+
return prev < displayItems.length - 1 ? prev + 1 : prev;
|
|
212
|
+
});
|
|
213
|
+
break;
|
|
214
|
+
case 'ArrowUp':
|
|
215
|
+
e.preventDefault();
|
|
216
|
+
setHighlightedIndex(function (prev) {
|
|
217
|
+
return prev > 0 ? prev - 1 : -1;
|
|
218
|
+
});
|
|
219
|
+
break;
|
|
220
|
+
case 'Enter':
|
|
221
|
+
e.preventDefault();
|
|
222
|
+
if (highlightedIndex >= 0 && highlightedIndex < displayItems.length) {
|
|
223
|
+
handleSuggestionClick(displayItems[highlightedIndex]);
|
|
224
|
+
}
|
|
225
|
+
break;
|
|
226
|
+
case 'Escape':
|
|
227
|
+
e.preventDefault();
|
|
228
|
+
setShowSuggestions(false);
|
|
229
|
+
setHighlightedIndex(-1);
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
(_a = inputProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
233
|
+
};
|
|
234
|
+
// Scroll highlighted item into view
|
|
235
|
+
useEffect(function () {
|
|
236
|
+
var _a;
|
|
237
|
+
if (highlightedIndex >= 0 && listRef.current) {
|
|
238
|
+
var items = listRef.current.querySelectorAll('li');
|
|
239
|
+
(_a = items[highlightedIndex]) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
240
|
+
block: 'nearest'
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}, [highlightedIndex]);
|
|
244
|
+
var showClearButton = value.length > 0 && !disabled;
|
|
245
|
+
var hasItems = displayItems.length > 0;
|
|
246
|
+
return jsxs(StyledSearchContainer, {
|
|
247
|
+
"$isFocused": isFocused,
|
|
248
|
+
"$disabled": disabled,
|
|
249
|
+
"data-testid": dataTestId,
|
|
250
|
+
children: [jsxs(StyledInputWrapper, {
|
|
251
|
+
"$isFocused": isFocused,
|
|
252
|
+
"$disabled": disabled,
|
|
253
|
+
"data-disabled": disabled,
|
|
254
|
+
children: [jsx(Icon, {
|
|
255
|
+
name: "search",
|
|
256
|
+
size: "sm",
|
|
257
|
+
iconColor: "subdued"
|
|
258
|
+
}), jsx(StyledInput, __assign({
|
|
259
|
+
ref: inputRef,
|
|
260
|
+
type: "text",
|
|
261
|
+
value: value,
|
|
262
|
+
onChange: handleInputChange,
|
|
263
|
+
onFocus: handleFocus,
|
|
264
|
+
onBlur: handleBlur,
|
|
265
|
+
onKeyDown: handleKeyDown,
|
|
266
|
+
placeholder: placeholder,
|
|
267
|
+
disabled: disabled,
|
|
268
|
+
"aria-label": ariaLabel,
|
|
269
|
+
"aria-autocomplete": "list",
|
|
270
|
+
"aria-controls": showSuggestions && hasItems ? 'search-suggestions' : undefined,
|
|
271
|
+
"aria-expanded": showSuggestions && hasItems,
|
|
272
|
+
"aria-activedescendant": highlightedIndex >= 0 ? "suggestion-".concat(highlightedIndex) : undefined,
|
|
273
|
+
role: "combobox"
|
|
274
|
+
}, inputProps)), loading && jsx(Icon, {
|
|
275
|
+
name: "refresh",
|
|
276
|
+
size: "sm",
|
|
277
|
+
iconColor: "subdued",
|
|
278
|
+
"aria-label": "Loading"
|
|
279
|
+
}), showClearButton && jsx(IconButton, {
|
|
280
|
+
iconName: "close",
|
|
281
|
+
size: "small",
|
|
282
|
+
variant: "naked",
|
|
283
|
+
onClick: handleClear,
|
|
284
|
+
"aria-label": "Clear search",
|
|
285
|
+
tabIndex: -1
|
|
286
|
+
})]
|
|
287
|
+
}), showSuggestions && hasItems && jsxs(StyledSuggestionsList, {
|
|
288
|
+
ref: listRef,
|
|
289
|
+
id: "search-suggestions",
|
|
290
|
+
role: "listbox",
|
|
291
|
+
children: [!value.trim() && showRecentSearches && recentSearches.length > 0 && jsx(StyledSectionHeader, {
|
|
292
|
+
children: "Recent Searches"
|
|
293
|
+
}), displayItems.map(function (item, index) {
|
|
294
|
+
if (item.type === 'clear') {
|
|
295
|
+
return jsx(ListItem, {
|
|
296
|
+
role: "option",
|
|
297
|
+
primary: "Clear recent searches",
|
|
298
|
+
interactive: true,
|
|
299
|
+
spacing: "compact",
|
|
300
|
+
onClick: function onClick() {
|
|
301
|
+
return handleSuggestionClick(item);
|
|
302
|
+
},
|
|
303
|
+
onKeyDown: function onKeyDown(e) {
|
|
304
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
305
|
+
e.preventDefault();
|
|
306
|
+
handleSuggestionClick(item);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}, "clear");
|
|
310
|
+
}
|
|
311
|
+
var suggestion = item.data;
|
|
312
|
+
var isString = typeof suggestion === 'string';
|
|
313
|
+
var label = isString ? suggestion : suggestion.label;
|
|
314
|
+
var description = !isString ? suggestion.description : undefined;
|
|
315
|
+
return jsx(ListItem, {
|
|
316
|
+
id: "suggestion-".concat(index),
|
|
317
|
+
role: "option",
|
|
318
|
+
"aria-selected": index === highlightedIndex,
|
|
319
|
+
primary: label,
|
|
320
|
+
secondary: description,
|
|
321
|
+
icon: item.type === 'recent' ? jsx(Icon, {
|
|
322
|
+
name: "refresh",
|
|
323
|
+
size: "xs"
|
|
324
|
+
}) : undefined,
|
|
325
|
+
interactive: true,
|
|
326
|
+
"data-highlighted": index === highlightedIndex || undefined,
|
|
327
|
+
spacing: "compact",
|
|
328
|
+
onClick: function onClick() {
|
|
329
|
+
return handleSuggestionClick(item);
|
|
330
|
+
}
|
|
331
|
+
}, isString ? suggestion : suggestion.id);
|
|
332
|
+
})]
|
|
333
|
+
})]
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
SearchField.displayName = 'SearchField';
|
|
337
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
338
|
+
|
|
339
|
+
export { SearchField };
|
|
340
|
+
//# sourceMappingURL=SearchField.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchField.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Sheet component
|
|
4
|
+
*/
|
|
5
|
+
export interface SheetProps {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the sheet is open
|
|
8
|
+
*/
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Callback fired when the sheet should close
|
|
12
|
+
*/
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Position of the sheet
|
|
16
|
+
* @default 'right'
|
|
17
|
+
*/
|
|
18
|
+
position?: 'top' | 'right' | 'bottom' | 'left';
|
|
19
|
+
/**
|
|
20
|
+
* Variant of the sheet
|
|
21
|
+
* - 'sheet': Full height/width edge-to-edge
|
|
22
|
+
* - 'drawer': Floating with rounded corners and margin
|
|
23
|
+
* @default 'sheet'
|
|
24
|
+
*/
|
|
25
|
+
variant?: 'sheet' | 'drawer';
|
|
26
|
+
/**
|
|
27
|
+
* Width of the sheet (for left/right positions)
|
|
28
|
+
* @default semantic.size.overlay.sm (25rem, 400px)
|
|
29
|
+
*/
|
|
30
|
+
width?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Height of the sheet (for top/bottom positions)
|
|
33
|
+
* @default semantic.size.overlay.sm (25rem, 400px)
|
|
34
|
+
*/
|
|
35
|
+
height?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Content to display in the sheet
|
|
38
|
+
*/
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Whether clicking the overlay should close the sheet
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
closeOnOverlayClick?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether pressing Escape should close the sheet
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
closeOnEscape?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Optional title for the sheet (improves accessibility)
|
|
52
|
+
*/
|
|
53
|
+
title?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Test identifier for automated testing
|
|
56
|
+
*/
|
|
57
|
+
'data-testid'?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Accessible label for the sheet
|
|
60
|
+
*/
|
|
61
|
+
'aria-label'?: string;
|
|
62
|
+
/**
|
|
63
|
+
* ID of element describing the sheet
|
|
64
|
+
*/
|
|
65
|
+
'aria-describedby'?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sheet component for side panels and drawers
|
|
69
|
+
*
|
|
70
|
+
* Provides a sliding panel that appears from any edge of the screen.
|
|
71
|
+
* Can be used for navigation menus, filters, forms, or additional content.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* // Right-positioned sheet (default)
|
|
76
|
+
* <Sheet isOpen={isOpen} onClose={() => setIsOpen(false)}>
|
|
77
|
+
* <h2>Sheet Content</h2>
|
|
78
|
+
* <p>Your content here</p>
|
|
79
|
+
* </Sheet>
|
|
80
|
+
*
|
|
81
|
+
* // Drawer variant from bottom
|
|
82
|
+
* <Sheet
|
|
83
|
+
* isOpen={isOpen}
|
|
84
|
+
* onClose={() => setIsOpen(false)}
|
|
85
|
+
* position="bottom"
|
|
86
|
+
* variant="drawer"
|
|
87
|
+
* height="60vh"
|
|
88
|
+
* >
|
|
89
|
+
* <h2>Mobile Menu</h2>
|
|
90
|
+
* </Sheet>
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare const Sheet: {
|
|
94
|
+
({ isOpen, onClose, position, variant, width, height, children, closeOnOverlayClick, closeOnEscape, title, "data-testid": dataTestId, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: SheetProps): import("react/jsx-runtime").JSX.Element | null;
|
|
95
|
+
displayName: string;
|
|
96
|
+
};
|