@flipdish/ui-library 0.10.0 → 0.11.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/components/atoms/Button/index.cjs +4 -1
- package/dist/components/atoms/Button/index.cjs.map +1 -1
- package/dist/components/atoms/Button/index.d.ts +2 -0
- package/dist/components/atoms/Button/index.d.ts.map +1 -1
- package/dist/components/atoms/Button/index.js +4 -1
- package/dist/components/atoms/Button/index.js.map +1 -1
- package/dist/components/atoms/Checkbox/index.cjs +4 -2
- package/dist/components/atoms/Checkbox/index.cjs.map +1 -1
- package/dist/components/atoms/Checkbox/index.d.ts +3 -1
- package/dist/components/atoms/Checkbox/index.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/index.js +4 -2
- package/dist/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/components/atoms/Input/index.cjs +7 -4
- package/dist/components/atoms/Input/index.cjs.map +1 -1
- package/dist/components/atoms/Input/index.d.ts +6 -2
- package/dist/components/atoms/Input/index.d.ts.map +1 -1
- package/dist/components/atoms/Input/index.js +7 -4
- package/dist/components/atoms/Input/index.js.map +1 -1
- package/dist/components/atoms/RadioButton/index.cjs +8 -4
- package/dist/components/atoms/RadioButton/index.cjs.map +1 -1
- package/dist/components/atoms/RadioButton/index.d.ts +8 -3
- package/dist/components/atoms/RadioButton/index.d.ts.map +1 -1
- package/dist/components/atoms/RadioButton/index.js +8 -4
- package/dist/components/atoms/RadioButton/index.js.map +1 -1
- package/dist/components/atoms/Toggle/index.cjs +4 -2
- package/dist/components/atoms/Toggle/index.cjs.map +1 -1
- package/dist/components/atoms/Toggle/index.d.ts +3 -1
- package/dist/components/atoms/Toggle/index.d.ts.map +1 -1
- package/dist/components/atoms/Toggle/index.js +4 -2
- package/dist/components/atoms/Toggle/index.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.cjs +3 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.js +3 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-account-item.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.cjs +9 -5
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.d.ts +5 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.js +9 -5
- package/dist/components/molecules/Breadcrumbs/components/breadcrumb-item.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/index.cjs +4 -2
- package/dist/components/molecules/Breadcrumbs/index.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/index.d.ts +8 -2
- package/dist/components/molecules/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumbs/index.js +4 -2
- package/dist/components/molecules/Breadcrumbs/index.js.map +1 -1
- package/dist/components/molecules/Pagination/components/pagination-base.cjs +11 -4
- package/dist/components/molecules/Pagination/components/pagination-base.cjs.map +1 -1
- package/dist/components/molecules/Pagination/components/pagination-base.d.ts +8 -1
- package/dist/components/molecules/Pagination/components/pagination-base.d.ts.map +1 -1
- package/dist/components/molecules/Pagination/components/pagination-base.js +11 -4
- package/dist/components/molecules/Pagination/components/pagination-base.js.map +1 -1
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.cjs +16 -16
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.cjs.map +1 -1
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.d.ts +8 -8
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.d.ts.map +1 -1
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.js +16 -16
- package/dist/components/molecules/ProgressSteps/components/progress-step-base.js.map +1 -1
- package/dist/components/molecules/ProgressSteps/index.cjs +19 -12
- package/dist/components/molecules/ProgressSteps/index.cjs.map +1 -1
- package/dist/components/molecules/ProgressSteps/index.d.ts +3 -3
- package/dist/components/molecules/ProgressSteps/index.d.ts.map +1 -1
- package/dist/components/molecules/ProgressSteps/index.js +19 -12
- package/dist/components/molecules/ProgressSteps/index.js.map +1 -1
- package/dist/components/molecules/ProgressSteps/progressSteps.types.d.ts +10 -0
- package/dist/components/molecules/ProgressSteps/progressSteps.types.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-avatar.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-checkbox.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-card.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-icon-simple.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-payment-icon.js.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.cjs +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.d.ts +3 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.js +4 -2
- package/dist/components/molecules/RadioGroup/components/radio-group-radio-button.js.map +1 -1
- package/dist/components/molecules/Select/components/multi-select.cjs +4 -2
- package/dist/components/molecules/Select/components/multi-select.cjs.map +1 -1
- package/dist/components/molecules/Select/components/multi-select.d.ts +1 -1
- package/dist/components/molecules/Select/components/multi-select.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/multi-select.js +4 -2
- package/dist/components/molecules/Select/components/multi-select.js.map +1 -1
- package/dist/components/molecules/Select/components/select-item.cjs +6 -3
- package/dist/components/molecules/Select/components/select-item.cjs.map +1 -1
- package/dist/components/molecules/Select/components/select-item.d.ts +3 -1
- package/dist/components/molecules/Select/components/select-item.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/select-item.js +6 -3
- package/dist/components/molecules/Select/components/select-item.js.map +1 -1
- package/dist/components/molecules/Select/components/select-shared.cjs.map +1 -1
- package/dist/components/molecules/Select/components/select-shared.d.ts +6 -0
- package/dist/components/molecules/Select/components/select-shared.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/select-shared.js.map +1 -1
- package/dist/components/molecules/Select/index.cjs +6 -4
- package/dist/components/molecules/Select/index.cjs.map +1 -1
- package/dist/components/molecules/Select/index.d.ts +1 -1
- package/dist/components/molecules/Select/index.d.ts.map +1 -1
- package/dist/components/molecules/Select/index.js +6 -4
- package/dist/components/molecules/Select/index.js.map +1 -1
- package/dist/components/molecules/Tabs/index.cjs +24 -8
- package/dist/components/molecules/Tabs/index.cjs.map +1 -1
- package/dist/components/molecules/Tabs/index.d.ts +17 -7
- package/dist/components/molecules/Tabs/index.d.ts.map +1 -1
- package/dist/components/molecules/Tabs/index.js +24 -8
- package/dist/components/molecules/Tabs/index.js.map +1 -1
- package/dist/components/organisms/ActivityFeed/index.cjs +8 -2
- package/dist/components/organisms/ActivityFeed/index.cjs.map +1 -1
- package/dist/components/organisms/ActivityFeed/index.d.ts +3 -1
- package/dist/components/organisms/ActivityFeed/index.d.ts.map +1 -1
- package/dist/components/organisms/ActivityFeed/index.js +8 -2
- package/dist/components/organisms/ActivityFeed/index.js.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.cjs +5 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.d.ts +2 -0
- package/dist/components/organisms/CommandMenu/components/command-menu-item.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.js +5 -1
- package/dist/components/organisms/CommandMenu/components/command-menu-item.js.map +1 -1
- package/dist/components/organisms/CommandMenu/index.cjs +6 -4
- package/dist/components/organisms/CommandMenu/index.cjs.map +1 -1
- package/dist/components/organisms/CommandMenu/index.d.ts +8 -2
- package/dist/components/organisms/CommandMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/CommandMenu/index.js +6 -4
- package/dist/components/organisms/CommandMenu/index.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.cjs +3 -2
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.d.ts +6 -1
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.js +3 -2
- package/dist/components/organisms/HeaderNavigation/components/mobile-header.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.cjs +9 -6
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.d.ts +10 -2
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.js +9 -6
- package/dist/components/organisms/HeaderNavigation/components/nav-account-card.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-button.cjs +2 -2
- package/dist/components/organisms/HeaderNavigation/components/nav-button.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-button.d.ts +3 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-button.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-button.js +2 -2
- package/dist/components/organisms/HeaderNavigation/components/nav-button.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-item.cjs +4 -4
- package/dist/components/organisms/HeaderNavigation/components/nav-item.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-item.d.ts +3 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-item.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-item.js +4 -4
- package/dist/components/organisms/HeaderNavigation/components/nav-item.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-list.cjs +9 -3
- package/dist/components/organisms/HeaderNavigation/components/nav-list.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-list.d.ts +3 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-list.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/nav-list.js +9 -3
- package/dist/components/organisms/HeaderNavigation/components/nav-list.js.map +1 -1
- package/dist/components/organisms/HeaderNavigation/headerNavigation.types.d.ts +17 -8
- package/dist/components/organisms/HeaderNavigation/headerNavigation.types.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/index.cjs +9 -2
- package/dist/components/organisms/HeaderNavigation/index.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/index.d.ts +10 -1
- package/dist/components/organisms/HeaderNavigation/index.d.ts.map +1 -1
- package/dist/components/organisms/HeaderNavigation/index.js +10 -3
- package/dist/components/organisms/HeaderNavigation/index.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.cjs +2 -2
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.d.ts +8 -2
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.js +2 -2
- package/dist/components/organisms/SidebarNavigation/components/mobile-header.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.cjs +15 -5
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.d.ts +12 -2
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.js +15 -5
- package/dist/components/organisms/SidebarNavigation/components/nav-account-card.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-button.cjs +2 -2
- package/dist/components/organisms/SidebarNavigation/components/nav-button.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-button.d.ts +3 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-button.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-button.js +2 -2
- package/dist/components/organisms/SidebarNavigation/components/nav-button.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-item.cjs +4 -4
- package/dist/components/organisms/SidebarNavigation/components/nav-item.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-item.d.ts +3 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-item.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-item.js +4 -4
- package/dist/components/organisms/SidebarNavigation/components/nav-item.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-list.cjs +9 -3
- package/dist/components/organisms/SidebarNavigation/components/nav-list.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-list.d.ts +3 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-list.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/nav-list.js +9 -3
- package/dist/components/organisms/SidebarNavigation/components/nav-list.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.cjs +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.d.ts +3 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.js +1 -1
- package/dist/components/organisms/SidebarNavigation/components/sidebar-menu-button.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.cjs +10 -6
- package/dist/components/organisms/SidebarNavigation/index.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.d.ts +7 -1
- package/dist/components/organisms/SidebarNavigation/index.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.js +11 -7
- package/dist/components/organisms/SidebarNavigation/index.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/sidebarNavigation.types.d.ts +21 -8
- package/dist/components/organisms/SidebarNavigation/sidebarNavigation.types.d.ts.map +1 -1
- package/dist/components/organisms/Table/index.cjs +13 -8
- package/dist/components/organisms/Table/index.cjs.map +1 -1
- package/dist/components/organisms/Table/index.d.ts +17 -3
- package/dist/components/organisms/Table/index.d.ts.map +1 -1
- package/dist/components/organisms/Table/index.js +13 -8
- package/dist/components/organisms/Table/index.js.map +1 -1
- package/dist/utilities/testIdUtils/index.cjs +70 -0
- package/dist/utilities/testIdUtils/index.cjs.map +1 -0
- package/dist/utilities/testIdUtils/index.d.ts +57 -0
- package/dist/utilities/testIdUtils/index.d.ts.map +1 -0
- package/dist/utilities/testIdUtils/index.js +58 -0
- package/dist/utilities/testIdUtils/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
5
|
var isReactComponent = require('@flipdish/ui-library/utilities/isReactComponent');
|
|
6
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var reactAriaComponents = require('react-aria-components');
|
|
8
9
|
|
|
@@ -134,8 +135,9 @@ const styles = cx.sortCx({
|
|
|
134
135
|
*
|
|
135
136
|
* @summary action trigger or navigation control
|
|
136
137
|
*/
|
|
137
|
-
const Button = ({ size = 'sm', color = 'primary', children, className, noTextPadding, iconLeading: IconLeading, iconTrailing: IconTrailing, isDisabled: disabled, isLoading: loading, showTextWhileLoading, ...props }) => {
|
|
138
|
+
const Button = ({ size = 'sm', color = 'primary', children, className, noTextPadding, iconLeading: IconLeading, iconTrailing: IconTrailing, isDisabled: disabled, isLoading: loading, showTextWhileLoading, 'data-testid': dataTestId, ...props }) => {
|
|
138
139
|
const href = 'href' in props ? props.href : undefined;
|
|
140
|
+
const buttonTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'button', rootName: 'button' });
|
|
139
141
|
const hasChildren = children !== null && children !== undefined;
|
|
140
142
|
const isIcon = (IconLeading || IconTrailing) && !hasChildren;
|
|
141
143
|
const isLinkType = ['link-gray', 'link-color', 'link-destructive'].includes(color);
|
|
@@ -146,6 +148,7 @@ const Button = ({ size = 'sm', color = 'primary', children, className, noTextPad
|
|
|
146
148
|
const commonProps = {
|
|
147
149
|
'data-loading': loading ? true : undefined,
|
|
148
150
|
'data-icon-only': isIcon ? true : undefined,
|
|
151
|
+
'data-testid': buttonTestId,
|
|
149
152
|
...props,
|
|
150
153
|
isDisabled: disabled,
|
|
151
154
|
className: cx.cx(styles.common.root, styles.sizes[size].root, styles.colors[color].root, isLinkType && styles.sizes[size].linkRoot, (loading || (href && (disabled || loading))) && 'pointer-events-none',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":[null],"names":["sortCx","_jsxs","_Fragment","isValidElement","isReactComponent","_jsx","cx","AriaLink","AriaButton"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":[null],"names":["sortCx","useResolvedTestId","_jsxs","_Fragment","isValidElement","isReactComponent","_jsx","cx","AriaLink","AriaButton"],"mappings":";;;;;;;;;AAUO,MAAM,MAAM,GAAGA,SAAM,CAAC;AAC3B,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE;YACJ,wNAAwN;;YAExN,kYAAkY;;YAElY,4FAA4F;;YAE5F,4GAA4G;SAC7G,CAAC,IAAI,CAAC,GAAG,CAAC;AACX,QAAA,IAAI,EAAE,4DAA4D;AACnE,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE;gBACJ,8FA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,IAAA,OAAOF,eAACG,0BAAU,EAAA,EAAA,GAAK,WAAW,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,IAAI,QAAQ,EAAE,SAAS,EAAE,OAAO,GAAI;AAChG;;;;;"}
|
|
@@ -81,6 +81,8 @@ export interface CommonProps {
|
|
|
81
81
|
noTextPadding?: boolean;
|
|
82
82
|
/** When true, keeps the text visible during loading state */
|
|
83
83
|
showTextWhileLoading?: boolean;
|
|
84
|
+
/** Overrides the `data-testid`. Defaults to `fd-button` (or `<parent>--button` inside a test-id context). */
|
|
85
|
+
'data-testid'?: string;
|
|
84
86
|
children?: ReactNode;
|
|
85
87
|
className?: string;
|
|
86
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGxG,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHjB,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sDAAsD;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,KAAK,CAAC;IACjC,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,MAAM,CAAC;IACnC,wDAAwD;IACxD,WAAW,CAAC,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;IACrD,uDAAuD;IACvD,YAAY,CAAC,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;IACtD,uDAAuD;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6DAA6D;IAC7D,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,6GAA6G;IAC7G,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,WAAW,CAAC;CAAG;AACpG;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,WAAW,CAAC;IAC3F,IAAI,EAAE,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;CAC1C;AAED,0CAA0C;AAC1C,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE;IACnB,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;CA0FjD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { sortCx, cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
3
|
import { isReactComponent } from '@flipdish/ui-library/utilities/isReactComponent';
|
|
4
|
+
import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
4
5
|
import { isValidElement } from 'react';
|
|
5
6
|
import { Link, Button as Button$1 } from 'react-aria-components';
|
|
6
7
|
|
|
@@ -132,8 +133,9 @@ const styles = sortCx({
|
|
|
132
133
|
*
|
|
133
134
|
* @summary action trigger or navigation control
|
|
134
135
|
*/
|
|
135
|
-
const Button = ({ size = 'sm', color = 'primary', children, className, noTextPadding, iconLeading: IconLeading, iconTrailing: IconTrailing, isDisabled: disabled, isLoading: loading, showTextWhileLoading, ...props }) => {
|
|
136
|
+
const Button = ({ size = 'sm', color = 'primary', children, className, noTextPadding, iconLeading: IconLeading, iconTrailing: IconTrailing, isDisabled: disabled, isLoading: loading, showTextWhileLoading, 'data-testid': dataTestId, ...props }) => {
|
|
136
137
|
const href = 'href' in props ? props.href : undefined;
|
|
138
|
+
const buttonTestId = useResolvedTestId({ testId: dataTestId, segment: 'button', rootName: 'button' });
|
|
137
139
|
const hasChildren = children !== null && children !== undefined;
|
|
138
140
|
const isIcon = (IconLeading || IconTrailing) && !hasChildren;
|
|
139
141
|
const isLinkType = ['link-gray', 'link-color', 'link-destructive'].includes(color);
|
|
@@ -144,6 +146,7 @@ const Button = ({ size = 'sm', color = 'primary', children, className, noTextPad
|
|
|
144
146
|
const commonProps = {
|
|
145
147
|
'data-loading': loading ? true : undefined,
|
|
146
148
|
'data-icon-only': isIcon ? true : undefined,
|
|
149
|
+
'data-testid': buttonTestId,
|
|
147
150
|
...props,
|
|
148
151
|
isDisabled: disabled,
|
|
149
152
|
className: cx(styles.common.root, styles.sizes[size].root, styles.colors[color].root, isLinkType && styles.sizes[size].linkRoot, (loading || (href && (disabled || loading))) && 'pointer-events-none',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_Fragment","_jsx","AriaLink","AriaButton"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":[null],"names":["_jsx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KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,KAAK,qBAAqB;;AAErE,QAAA,OAAO,KAAK,oBAAoB,GAAG,wDAAwD,GAAG,0CAA0C,CAAC,EACzI,SAAS,CACV;AACD,QAAA,QAAQ,EAAE,cAAc;KACzB;AAED,IAAA,IAAI,MAAM,IAAI,WAAW,EAAE;AACzB,QAAA,OAAOA,IAACC,IAAQ,EAAA,EAAA,GAAK,WAAW,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAI;IACzE;AAEA,IAAA,OAAOD,IAACE,QAAU,EAAA,EAAA,GAAK,WAAW,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,IAAI,QAAQ,EAAE,SAAS,EAAE,OAAO,GAAI;AAChG;;;;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
5
6
|
var reactAriaComponents = require('react-aria-components');
|
|
6
7
|
|
|
7
8
|
const CheckboxBase = ({ className, isSelected, isDisabled, isIndeterminate, size = 'sm', isFocusVisible = false }) => {
|
|
@@ -14,7 +15,8 @@ CheckboxBase.displayName = 'CheckboxBase';
|
|
|
14
15
|
*
|
|
15
16
|
* @summary checkbox input for selecting one or more options in a form
|
|
16
17
|
*/
|
|
17
|
-
const Checkbox = ({ label, hint, size = 'sm', className, ...ariaCheckboxProps }) => {
|
|
18
|
+
const Checkbox = ({ label, hint, size = 'sm', className, 'data-testid': dataTestId, ...ariaCheckboxProps }) => {
|
|
19
|
+
const checkboxTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'checkbox', rootName: 'checkbox' });
|
|
18
20
|
const sizes = {
|
|
19
21
|
sm: {
|
|
20
22
|
root: 'gap-2',
|
|
@@ -29,7 +31,7 @@ const Checkbox = ({ label, hint, size = 'sm', className, ...ariaCheckboxProps })
|
|
|
29
31
|
hint: 'text-md',
|
|
30
32
|
},
|
|
31
33
|
};
|
|
32
|
-
return (jsxRuntime.jsx(reactAriaComponents.Checkbox, { ...ariaCheckboxProps, className: (state) => cx.cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', sizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isIndeterminate, isDisabled, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(CheckboxBase, { size: size, isSelected: isSelected, isIndeterminate: isIndeterminate, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxRuntime.jsxs("div", { className: cx.cx('inline-flex flex-col', sizes[size].textWrapper), children: [label && jsxRuntime.jsx("p", { className: cx.cx('text-secondary select-none', sizes[size].label), children: label }), hint && (
|
|
34
|
+
return (jsxRuntime.jsx(reactAriaComponents.Checkbox, { ...ariaCheckboxProps, "data-testid": checkboxTestId, className: (state) => cx.cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', sizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isIndeterminate, isDisabled, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(CheckboxBase, { size: size, isSelected: isSelected, isIndeterminate: isIndeterminate, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxRuntime.jsxs("div", { className: cx.cx('inline-flex flex-col', sizes[size].textWrapper), children: [label && jsxRuntime.jsx("p", { className: cx.cx('text-secondary select-none', sizes[size].label), children: label }), hint && (
|
|
33
35
|
// biome-ignore lint/a11y/noStaticElementInteractions: This is a hint that is not interactive
|
|
34
36
|
// biome-ignore lint/a11y/useKeyWithClickEvents: This is a hint that is not interactive
|
|
35
37
|
jsxRuntime.jsx("span", { className: cx.cx('text-tertiary', sizes[size].hint), onClick: (event) => event.stopPropagation(), children: hint }))] }))] })) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/Checkbox/index.tsx"],"sourcesContent":[null],"names":["_jsxs","cx","_jsx","AriaCheckbox","_Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/Checkbox/index.tsx"],"sourcesContent":[null],"names":["_jsxs","cx","_jsx","useResolvedTestId","AriaCheckbox","_Fragment"],"mappings":";;;;;;;MAgBa,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,GAAG,IAAI,EAAE,cAAc,GAAG,KAAK,EAAqB,KAAI;AAC7I,IAAA,QACEA,eAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEC,KAAE,CACX,4IAA4I,EAC5I,IAAI,KAAK,IAAI,IAAI,mBAAmB,EACpC,CAAC,UAAU,IAAI,eAAe,KAAK,iCAAiC,EACpE,UAAU,IAAI,+BAA+B,EAC7C,UAAU,IAAI,EAAE,UAAU,IAAI,eAAe,CAAC,IAAI,aAAa,EAC/D,cAAc,IAAI,+CAA+C,EACjE,SAAS,CACV,EAAA,QAAA,EAAA,CAEDC,cAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EACc,MAAM,EAClB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,SAAS,EAAED,KAAE,CACX,uFAAuF,EACvF,IAAI,KAAK,IAAI,IAAI,UAAU,EAC3B,eAAe,IAAI,aAAa,CACjC,EAAA,QAAA,EAEDC,yBAAM,CAAC,EAAC,oBAAoB,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAA,CAAG,EAAA,CAC9G,EAENA,cAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EACc,MAAM,EAClB,OAAO,EAAC,WAAW,EACnB,IAAI,EAA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Node;
|
|
20
|
+
/** Overrides the `data-testid` (defaults to `fd-checkbox`). */
|
|
21
|
+
'data-testid'?: string;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* Checkbox input for selecting one or more options in a form. Supports checked,
|
|
@@ -25,7 +27,7 @@ export interface CheckboxProps extends AriaCheckboxProps {
|
|
|
25
27
|
* @summary checkbox input for selecting one or more options in a form
|
|
26
28
|
*/
|
|
27
29
|
export declare const Checkbox: {
|
|
28
|
-
({ label, hint, size, className, ...ariaCheckboxProps }: CheckboxProps): import("react").JSX.Element;
|
|
30
|
+
({ label, hint, size, className, "data-testid": dataTestId, ...ariaCheckboxProps }: CheckboxProps): import("react").JSX.Element;
|
|
29
31
|
displayName: string;
|
|
30
32
|
};
|
|
31
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Checkbox/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Checkbox/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAA4B,KAAK,aAAa,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1G,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY;mFAAiG,iBAAiB;;CAwC1I,CAAC;AAGF,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;wFAA8F,aAAa;;CAyD/H,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
+
import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
3
4
|
import { Checkbox as Checkbox$1 } from 'react-aria-components';
|
|
4
5
|
|
|
5
6
|
const CheckboxBase = ({ className, isSelected, isDisabled, isIndeterminate, size = 'sm', isFocusVisible = false }) => {
|
|
@@ -12,7 +13,8 @@ CheckboxBase.displayName = 'CheckboxBase';
|
|
|
12
13
|
*
|
|
13
14
|
* @summary checkbox input for selecting one or more options in a form
|
|
14
15
|
*/
|
|
15
|
-
const Checkbox = ({ label, hint, size = 'sm', className, ...ariaCheckboxProps }) => {
|
|
16
|
+
const Checkbox = ({ label, hint, size = 'sm', className, 'data-testid': dataTestId, ...ariaCheckboxProps }) => {
|
|
17
|
+
const checkboxTestId = useResolvedTestId({ testId: dataTestId, segment: 'checkbox', rootName: 'checkbox' });
|
|
16
18
|
const sizes = {
|
|
17
19
|
sm: {
|
|
18
20
|
root: 'gap-2',
|
|
@@ -27,7 +29,7 @@ const Checkbox = ({ label, hint, size = 'sm', className, ...ariaCheckboxProps })
|
|
|
27
29
|
hint: 'text-md',
|
|
28
30
|
},
|
|
29
31
|
};
|
|
30
|
-
return (jsx(Checkbox$1, { ...ariaCheckboxProps, className: (state) => cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', sizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isIndeterminate, isDisabled, isFocusVisible }) => (jsxs(Fragment, { children: [jsx(CheckboxBase, { size: size, isSelected: isSelected, isIndeterminate: isIndeterminate, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxs("div", { className: cx('inline-flex flex-col', sizes[size].textWrapper), children: [label && jsx("p", { className: cx('text-secondary select-none', sizes[size].label), children: label }), hint && (
|
|
32
|
+
return (jsx(Checkbox$1, { ...ariaCheckboxProps, "data-testid": checkboxTestId, className: (state) => cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', sizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isIndeterminate, isDisabled, isFocusVisible }) => (jsxs(Fragment, { children: [jsx(CheckboxBase, { size: size, isSelected: isSelected, isIndeterminate: isIndeterminate, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxs("div", { className: cx('inline-flex flex-col', sizes[size].textWrapper), children: [label && jsx("p", { className: cx('text-secondary select-none', sizes[size].label), children: label }), hint && (
|
|
31
33
|
// biome-ignore lint/a11y/noStaticElementInteractions: This is a hint that is not interactive
|
|
32
34
|
// biome-ignore lint/a11y/useKeyWithClickEvents: This is a hint that is not interactive
|
|
33
35
|
jsx("span", { className: cx('text-tertiary', sizes[size].hint), onClick: (event) => event.stopPropagation(), children: hint }))] }))] })) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Checkbox/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","AriaCheckbox","_Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Checkbox/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","AriaCheckbox","_Fragment"],"mappings":";;;;;MAgBa,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,eA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IAAI,IAAI,GAAG,QAAQ,GAAG,EAAE,EAAA,CACxC,EACD,CAAC,KAAK,IAAI,IAAI,MACbD,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,EAAA,QAAA,EAAA,CAChE,KAAK,IAAIC,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAA,QAAA,EAAG,KAAK,EAAA,CAAK,EACvF,IAAI;;;AAGH,wBAAAA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EAAA,QAAA,EAChG,IAAI,EAAA,CACA,CACR,IACG,CACP,CAAA,EAAA,CACA,CACJ,EAAA,CACY;AAEnB;AACA,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
|
|
@@ -4,13 +4,15 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var uiIcons = require('@flipdish/ui-icons');
|
|
5
5
|
var Tooltip = require('@flipdish/ui-library/components/atoms/Tooltip');
|
|
6
6
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
8
|
var React = require('react');
|
|
8
9
|
var reactAriaComponents = require('react-aria-components');
|
|
9
10
|
var hintText = require('./components/hint-text.cjs');
|
|
10
11
|
var label = require('./components/label.cjs');
|
|
11
12
|
|
|
12
|
-
const InputBase = ({ ref, tooltip, shortcut, groupRef, size = 'md', isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type = 'text', ...inputProps }) => {
|
|
13
|
+
const InputBase = ({ ref, tooltip, shortcut, groupRef, size = 'md', isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type = 'text', 'data-testid': dataTestId, ...inputProps }) => {
|
|
13
14
|
const [isPasswordVisible, setIsPasswordVisible] = React.useState(false);
|
|
15
|
+
const inputTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'input', rootName: 'input' });
|
|
14
16
|
// Check if the input has a leading icon or a trailing adornment (tooltip, invalid
|
|
15
17
|
// indicator, or the password visibility toggle) so we can reserve right-side padding.
|
|
16
18
|
const hasTrailingIcon = Boolean(tooltip) || Boolean(isInvalid) || type === 'password';
|
|
@@ -44,7 +46,7 @@ const InputBase = ({ ref, tooltip, shortcut, groupRef, size = 'md', isInvalid, i
|
|
|
44
46
|
// Invalid state styles
|
|
45
47
|
isInvalid && 'ring-error_subtle', 'group-invalid:ring-error_subtle',
|
|
46
48
|
// Invalid state with focus-within styles
|
|
47
|
-
isInvalid && isFocusWithin && 'ring-2 ring-error', isFocusWithin && 'group-invalid:ring-2 group-invalid:ring-error', context?.wrapperClassName, wrapperClassName), children: [Icon && (jsxRuntime.jsx(Icon, { className: cx.cx('pointer-events-none absolute text-fg-quaternary', sizes[inputSize].iconLeading, context?.iconClassName, iconClassName) })), jsxRuntime.jsx(reactAriaComponents.Input, { ...inputProps, ref: ref, required: isRequired, type: type === 'password' && isPasswordVisible ? 'text' : type, placeholder: placeholder, className: cx.cx('m-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder autofill:rounded-lg autofill:text-primary disabled:cursor-not-allowed', sizes[inputSize].root, context?.inputClassName, inputClassName) }), tooltip && type !== 'password' && (jsxRuntime.jsx(Tooltip.Tooltip, { title: tooltip, placement: "top", children: jsxRuntime.jsx(Tooltip.TooltipTrigger, { className: cx.cx('absolute cursor-pointer text-fg-quaternary transition duration-100 ease-linear group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName), children: jsxRuntime.jsx(uiIcons.HelpCircle, { className: "size-4 stroke-[2.25px]" }) }) })), type !== 'password' && (jsxRuntime.jsx(uiIcons.InfoCircle, { className: cx.cx('pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName) })), type === 'password' && (jsxRuntime.jsx(reactAriaComponents.Button, { "aria-label": "Toggle password visibility", onClick: () => setIsPasswordVisible(!isPasswordVisible), className: cx.cx('absolute flex cursor-pointer items-center justify-center text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover focus:outline-hidden', sizes[inputSize].iconTrailing), children: isPasswordVisible ? jsxRuntime.jsx(uiIcons.EyeOff, { className: "size-4 stroke-[2.25px]" }) : jsxRuntime.jsx(uiIcons.Eye, { className: "size-4 stroke-[2.25px]" }) })), shortcut && (jsxRuntime.jsx("div", { className: cx.cx('pointer-events-none absolute inset-y-0.5 right-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 md:flex', sizes[inputSize].shortcut), children: jsxRuntime.jsx("span", { "aria-hidden": "true", className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: typeof shortcut === 'string' ? shortcut : '⌘K' }) }))] }));
|
|
49
|
+
isInvalid && isFocusWithin && 'ring-2 ring-error', isFocusWithin && 'group-invalid:ring-2 group-invalid:ring-error', context?.wrapperClassName, wrapperClassName), children: [Icon && (jsxRuntime.jsx(Icon, { className: cx.cx('pointer-events-none absolute text-fg-quaternary', sizes[inputSize].iconLeading, context?.iconClassName, iconClassName) })), jsxRuntime.jsx(reactAriaComponents.Input, { ...inputProps, ref: ref, "data-testid": inputTestId, required: isRequired, type: type === 'password' && isPasswordVisible ? 'text' : type, placeholder: placeholder, className: cx.cx('m-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder autofill:rounded-lg autofill:text-primary disabled:cursor-not-allowed', sizes[inputSize].root, context?.inputClassName, inputClassName) }), tooltip && type !== 'password' && (jsxRuntime.jsx(Tooltip.Tooltip, { title: tooltip, placement: "top", children: jsxRuntime.jsx(Tooltip.TooltipTrigger, { className: cx.cx('absolute cursor-pointer text-fg-quaternary transition duration-100 ease-linear group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName), children: jsxRuntime.jsx(uiIcons.HelpCircle, { className: "size-4 stroke-[2.25px]" }) }) })), type !== 'password' && (jsxRuntime.jsx(uiIcons.InfoCircle, { className: cx.cx('pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName) })), type === 'password' && (jsxRuntime.jsx(reactAriaComponents.Button, { "aria-label": "Toggle password visibility", onClick: () => setIsPasswordVisible(!isPasswordVisible), className: cx.cx('absolute flex cursor-pointer items-center justify-center text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover focus:outline-hidden', sizes[inputSize].iconTrailing), children: isPasswordVisible ? jsxRuntime.jsx(uiIcons.EyeOff, { className: "size-4 stroke-[2.25px]" }) : jsxRuntime.jsx(uiIcons.Eye, { className: "size-4 stroke-[2.25px]" }) })), shortcut && (jsxRuntime.jsx("div", { className: cx.cx('pointer-events-none absolute inset-y-0.5 right-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 md:flex', sizes[inputSize].shortcut), children: jsxRuntime.jsx("span", { "aria-hidden": "true", className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: typeof shortcut === 'string' ? shortcut : '⌘K' }) }))] }));
|
|
48
50
|
};
|
|
49
51
|
InputBase.displayName = 'InputBase';
|
|
50
52
|
const TextFieldContext = React.createContext({});
|
|
@@ -60,7 +62,7 @@ TextField.displayName = 'TextField';
|
|
|
60
62
|
*
|
|
61
63
|
* @summary text field for collecting a single line of user input
|
|
62
64
|
*/
|
|
63
|
-
const Input = ({ size = 'md', placeholder, icon: Icon, label: label$1, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type = 'text', ...props }) => {
|
|
65
|
+
const Input = ({ size = 'md', placeholder, icon: Icon, label: label$1, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type = 'text', 'data-testid': dataTestId, ...props }) => {
|
|
64
66
|
return (jsxRuntime.jsx(TextField, { "aria-label": !label$1 ? placeholder : undefined, ...props, size: size, className: className, children: ({ isRequired, isInvalid }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label$1 && (jsxRuntime.jsx(label.Label, { isRequired: hideRequiredIndicator ? !hideRequiredIndicator : isRequired, isInvalid: isInvalid, children: label$1 })), jsxRuntime.jsx(InputBase, { ref,
|
|
65
67
|
groupRef,
|
|
66
68
|
size,
|
|
@@ -74,7 +76,8 @@ const Input = ({ size = 'md', placeholder, icon: Icon, label: label$1, hint, sho
|
|
|
74
76
|
wrapperClassName,
|
|
75
77
|
tooltipClassName,
|
|
76
78
|
tooltip,
|
|
77
|
-
type
|
|
79
|
+
type,
|
|
80
|
+
'data-testid': dataTestId }), hint && jsxRuntime.jsx(hintText.HintText, { isInvalid: isInvalid, children: hint })] })) }));
|
|
78
81
|
};
|
|
79
82
|
Input.displayName = 'Input';
|
|
80
83
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/Input/index.tsx"],"sourcesContent":[null],"names":["useState","useContext","sortCx","cx","_jsxs","AriaGroup","_jsx","AriaInput","Tooltip","TooltipTrigger","HelpCircle","InfoCircle","AriaButton","EyeOff","Eye","createContext","AriaTextField","label","_Fragment","Label","HintText"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/Input/index.tsx"],"sourcesContent":[null],"names":["useState","useResolvedTestId","useContext","sortCx","cx","_jsxs","AriaGroup","_jsx","AriaInput","Tooltip","TooltipTrigger","HelpCircle","InfoCircle","AriaButton","EyeOff","Eye","createContext","AriaTextField","label","_Fragment","Label","HintText"],"mappings":";;;;;;;;;;;;MAiDa,SAAS,GAAG,CAAC,EACxB,GAAG,EACH,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EAAE,IAAI,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,IAAI,GAAG,MAAM,EACb,aAAa,EAAE,UAAU,EACzB,GAAG,UAAU,EACE,KAAI;IACnB,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;AACjE,IAAA,MAAM,WAAW,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;;;AAIlG,IAAA,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,IAAI,KAAK,UAAU;IACrF,MAAM,cAAc,GAAG,IAAI;;AAG3B,IAAA,MAAM,OAAO,GAAGC,gBAAU,CAAC,gBAAgB,CAAC;AAE5C,IAAA,MAAM,SAAS,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;IAEvC,MAAM,KAAK,GAAGC,SAAM,CAAC;AACnB,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAEC,KAAE,CAAC,mBAAmB,EAAE,cAAc,IAAI,MAAM,EAAE,eAAe,IAAI,MAAM,CAAC;AAClF,YAAA,WA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AI,SACVc,OAAK,EACL,IAAI,EACJ,QAAQ,EACR,qBAAqB,EACrB,SAAS,EACT,GAAG,EACH,QAAQ,EACR,OAAO,EACP,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,IAAI,GAAG,MAAM,EACb,aAAa,EAAE,UAAU,EACzB,GAAG,KAAK,EACG,KAAI;AACf,IAAA,QACEX,cAAA,CAAC,SAAS,EAAA,EAAA,YAAA,EAAa,CAACW,OAAK,GAAG,WAAW,GAAG,SAAS,EAAA,GAAM,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAA,QAAA,EACjG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,MACzBb,eAAA,CAAAc,mBAAA,EAAA,EAAA,QAAA,EAAA,CACGD,OAAK,KACJX,cAAA,CAACa,WAAK,EAAA,EAAC,UAAU,EAAE,qBAAqB,GAAG,CAAC,qBAAqB,GAAG,UAAU,EAAE,SAAS,EAAE,SAAS,EAAA,QAAA,EACjGF,OAAK,EAAA,CACA,CACT,EAEDX,cAAA,CAAC,SAAS,IAEN,GAAG;oBACH,QAAQ;oBACR,IAAI;oBACJ,WAAW;AACX,oBAAA,IAAI,EAAE,IAAI;oBACV,QAAQ;oBACR,SAAS;oBACT,UAAU;oBACV,aAAa;oBACb,cAAc;oBACd,gBAAgB;oBAChB,gBAAgB;oBAChB,OAAO;oBACP,IAAI;AACJ,oBAAA,aAAa,EAAE,UAAU,EAAA,CAE3B,EAED,IAAI,IAAIA,eAACc,iBAAQ,EAAA,EAAC,SAAS,EAAE,SAAS,YAAG,IAAI,EAAA,CAAY,IACzD,CACJ,EAAA,CACS;AAEhB;AAEA,KAAK,CAAC,WAAW,GAAG,OAAO;;;;;;;;"}
|
|
@@ -32,9 +32,11 @@ export interface InputBaseProps extends Omit<AriaInputProps, 'size'> {
|
|
|
32
32
|
groupRef?: Ref<HTMLDivElement>;
|
|
33
33
|
/** Icon component to display on the left side of the input. */
|
|
34
34
|
icon?: ComponentType<HTMLAttributes<HTMLOrSVGElement>>;
|
|
35
|
+
/** Overrides the `data-testid` applied to the underlying `<input>` (defaults to `fd-input`). */
|
|
36
|
+
'data-testid'?: string;
|
|
35
37
|
}
|
|
36
38
|
export declare const InputBase: {
|
|
37
|
-
({ ref, tooltip, shortcut, groupRef, size, isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type, ...inputProps }: InputBaseProps): import("react").JSX.Element;
|
|
39
|
+
({ ref, tooltip, shortcut, groupRef, size, isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type, "data-testid": dataTestId, ...inputProps }: InputBaseProps): import("react").JSX.Element;
|
|
38
40
|
displayName: string;
|
|
39
41
|
};
|
|
40
42
|
interface TextFieldContextProps extends Partial<Pick<InputBaseProps, 'size' | 'wrapperClassName' | 'inputClassName' | 'iconClassName' | 'tooltipClassName'>> {
|
|
@@ -52,6 +54,8 @@ export interface InputProps extends AriaTextFieldProps, Pick<InputBaseProps, 're
|
|
|
52
54
|
hint?: ReactNode;
|
|
53
55
|
/** Whether to hide required indicator from label */
|
|
54
56
|
hideRequiredIndicator?: boolean;
|
|
57
|
+
/** Applied to the underlying `<input>` (not the wrapper). Defaults to `fd-input`. */
|
|
58
|
+
'data-testid'?: string;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
61
|
* A single-line text field for collecting user input. Composes a label,
|
|
@@ -62,7 +66,7 @@ export interface InputProps extends AriaTextFieldProps, Pick<InputBaseProps, 're
|
|
|
62
66
|
* @summary text field for collecting a single line of user input
|
|
63
67
|
*/
|
|
64
68
|
export declare const Input: {
|
|
65
|
-
({ size, placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type, ...props }: InputProps): import("react").JSX.Element;
|
|
69
|
+
({ size, placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type, "data-testid": dataTestId, ...props }: InputProps): import("react").JSX.Element;
|
|
66
70
|
displayName: string;
|
|
67
71
|
};
|
|
68
72
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAiB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAwB,MAAM,OAAO,CAAC;AAC/H,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAKhH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;IAClE,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,M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jsx-runtime';
|
|
|
2
2
|
import { HelpCircle, InfoCircle, EyeOff, Eye } from '@flipdish/ui-icons';
|
|
3
3
|
import { Tooltip, TooltipTrigger } from '@flipdish/ui-library/components/atoms/Tooltip';
|
|
4
4
|
import { sortCx, cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
|
+
import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
6
|
import { createContext, useState, useContext } from 'react';
|
|
6
7
|
import { Group, Input as Input$1, Button, TextField as TextField$1 } from 'react-aria-components';
|
|
7
8
|
import { HintText } from './components/hint-text.js';
|
|
8
9
|
import { Label } from './components/label.js';
|
|
9
10
|
|
|
10
|
-
const InputBase = ({ ref, tooltip, shortcut, groupRef, size = 'md', isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type = 'text', ...inputProps }) => {
|
|
11
|
+
const InputBase = ({ ref, tooltip, shortcut, groupRef, size = 'md', isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type = 'text', 'data-testid': dataTestId, ...inputProps }) => {
|
|
11
12
|
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
|
13
|
+
const inputTestId = useResolvedTestId({ testId: dataTestId, segment: 'input', rootName: 'input' });
|
|
12
14
|
// Check if the input has a leading icon or a trailing adornment (tooltip, invalid
|
|
13
15
|
// indicator, or the password visibility toggle) so we can reserve right-side padding.
|
|
14
16
|
const hasTrailingIcon = Boolean(tooltip) || Boolean(isInvalid) || type === 'password';
|
|
@@ -42,7 +44,7 @@ const InputBase = ({ ref, tooltip, shortcut, groupRef, size = 'md', isInvalid, i
|
|
|
42
44
|
// Invalid state styles
|
|
43
45
|
isInvalid && 'ring-error_subtle', 'group-invalid:ring-error_subtle',
|
|
44
46
|
// Invalid state with focus-within styles
|
|
45
|
-
isInvalid && isFocusWithin && 'ring-2 ring-error', isFocusWithin && 'group-invalid:ring-2 group-invalid:ring-error', context?.wrapperClassName, wrapperClassName), children: [Icon && (jsx(Icon, { className: cx('pointer-events-none absolute text-fg-quaternary', sizes[inputSize].iconLeading, context?.iconClassName, iconClassName) })), jsx(Input$1, { ...inputProps, ref: ref, required: isRequired, type: type === 'password' && isPasswordVisible ? 'text' : type, placeholder: placeholder, className: cx('m-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder autofill:rounded-lg autofill:text-primary disabled:cursor-not-allowed', sizes[inputSize].root, context?.inputClassName, inputClassName) }), tooltip && type !== 'password' && (jsx(Tooltip, { title: tooltip, placement: "top", children: jsx(TooltipTrigger, { className: cx('absolute cursor-pointer text-fg-quaternary transition duration-100 ease-linear group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName), children: jsx(HelpCircle, { className: "size-4 stroke-[2.25px]" }) }) })), type !== 'password' && (jsx(InfoCircle, { className: cx('pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName) })), type === 'password' && (jsx(Button, { "aria-label": "Toggle password visibility", onClick: () => setIsPasswordVisible(!isPasswordVisible), className: cx('absolute flex cursor-pointer items-center justify-center text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover focus:outline-hidden', sizes[inputSize].iconTrailing), children: isPasswordVisible ? jsx(EyeOff, { className: "size-4 stroke-[2.25px]" }) : jsx(Eye, { className: "size-4 stroke-[2.25px]" }) })), shortcut && (jsx("div", { className: cx('pointer-events-none absolute inset-y-0.5 right-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 md:flex', sizes[inputSize].shortcut), children: jsx("span", { "aria-hidden": "true", className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: typeof shortcut === 'string' ? shortcut : '⌘K' }) }))] }));
|
|
47
|
+
isInvalid && isFocusWithin && 'ring-2 ring-error', isFocusWithin && 'group-invalid:ring-2 group-invalid:ring-error', context?.wrapperClassName, wrapperClassName), children: [Icon && (jsx(Icon, { className: cx('pointer-events-none absolute text-fg-quaternary', sizes[inputSize].iconLeading, context?.iconClassName, iconClassName) })), jsx(Input$1, { ...inputProps, ref: ref, "data-testid": inputTestId, required: isRequired, type: type === 'password' && isPasswordVisible ? 'text' : type, placeholder: placeholder, className: cx('m-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder autofill:rounded-lg autofill:text-primary disabled:cursor-not-allowed', sizes[inputSize].root, context?.inputClassName, inputClassName) }), tooltip && type !== 'password' && (jsx(Tooltip, { title: tooltip, placement: "top", children: jsx(TooltipTrigger, { className: cx('absolute cursor-pointer text-fg-quaternary transition duration-100 ease-linear group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName), children: jsx(HelpCircle, { className: "size-4 stroke-[2.25px]" }) }) })), type !== 'password' && (jsx(InfoCircle, { className: cx('pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName) })), type === 'password' && (jsx(Button, { "aria-label": "Toggle password visibility", onClick: () => setIsPasswordVisible(!isPasswordVisible), className: cx('absolute flex cursor-pointer items-center justify-center text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover focus:outline-hidden', sizes[inputSize].iconTrailing), children: isPasswordVisible ? jsx(EyeOff, { className: "size-4 stroke-[2.25px]" }) : jsx(Eye, { className: "size-4 stroke-[2.25px]" }) })), shortcut && (jsx("div", { className: cx('pointer-events-none absolute inset-y-0.5 right-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 md:flex', sizes[inputSize].shortcut), children: jsx("span", { "aria-hidden": "true", className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: typeof shortcut === 'string' ? shortcut : '⌘K' }) }))] }));
|
|
46
48
|
};
|
|
47
49
|
InputBase.displayName = 'InputBase';
|
|
48
50
|
const TextFieldContext = createContext({});
|
|
@@ -58,7 +60,7 @@ TextField.displayName = 'TextField';
|
|
|
58
60
|
*
|
|
59
61
|
* @summary text field for collecting a single line of user input
|
|
60
62
|
*/
|
|
61
|
-
const Input = ({ size = 'md', placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type = 'text', ...props }) => {
|
|
63
|
+
const Input = ({ size = 'md', placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type = 'text', 'data-testid': dataTestId, ...props }) => {
|
|
62
64
|
return (jsx(TextField, { "aria-label": !label ? placeholder : undefined, ...props, size: size, className: className, children: ({ isRequired, isInvalid }) => (jsxs(Fragment, { children: [label && (jsx(Label, { isRequired: hideRequiredIndicator ? !hideRequiredIndicator : isRequired, isInvalid: isInvalid, children: label })), jsx(InputBase, { ref,
|
|
63
65
|
groupRef,
|
|
64
66
|
size,
|
|
@@ -72,7 +74,8 @@ const Input = ({ size = 'md', placeholder, icon: Icon, label, hint, shortcut, hi
|
|
|
72
74
|
wrapperClassName,
|
|
73
75
|
tooltipClassName,
|
|
74
76
|
tooltip,
|
|
75
|
-
type
|
|
77
|
+
type,
|
|
78
|
+
'data-testid': dataTestId }), hint && jsx(HintText, { isInvalid: isInvalid, children: hint })] })) }));
|
|
76
79
|
};
|
|
77
80
|
Input.displayName = 'Input';
|
|
78
81
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Input/index.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaGroup","_jsx","AriaInput","AriaButton","AriaTextField","_Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Input/index.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaGroup","_jsx","AriaInput","AriaButton","AriaTextField","_Fragment"],"mappings":";;;;;;;;;;MAiDa,SAAS,GAAG,CAAC,EACxB,GAAG,EACH,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EAAE,IAAI,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,IAAI,GAAG,MAAM,EACb,aAAa,EAAE,UAAU,EACzB,GAAG,UAAU,EACE,KAAI;IACnB,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AACjE,IAAA,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;;;AAIlG,IAAA,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,IAAI,KAAK,UAAU;IACrF,MAAM,cAAc,GAAG,IAAI;;AAG3B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC;AAE5C,IAAA,MAAM,SAAS,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;IAEvC,MAAM,KAAK,GAAG,MAAM,CAAC;AACnB,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE,EAAE,CAAC,mBAAmB,EAAE,cAAc,IAAI,MAAM,EAAE,eAAe,IAAI,MAAM,CAAC;AAClF,YAAA,WAAW,EAAE,+BAA+B;AAC5C,YAAA,YAAY,EAAE,SAAS;AACvB,YAAA,QAAQ,EAAE,QAAQ;AACnB,SAAA;AACD,QAAA,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AgB,EAChB,gBAAgB,EAChB,IAAI,GAAG,MAAM,EACb,aAAa,EAAE,UAAU,EACzB,GAAG,KAAK,EACG,KAAI;AACf,IAAA,QACEH,GAAA,CAAC,SAAS,EAAA,EAAA,YAAA,EAAa,CAAC,KAAK,GAAG,WAAW,GAAG,SAAS,EAAA,GAAM,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAA,QAAA,EACjG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,MACzBF,IAAA,CAAAM,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,KAAK,KACJJ,GAAA,CAAC,KAAK,EAAA,EAAC,UAAU,EAAE,qBAAqB,GAAG,CAAC,qBAAqB,GAAG,UAAU,EAAE,SAAS,EAAE,SAAS,EAAA,QAAA,EACjG,KAAK,EAAA,CACA,CACT,EAEDA,GAAA,CAAC,SAAS,IAEN,GAAG;oBACH,QAAQ;oBACR,IAAI;oBACJ,WAAW;AACX,oBAAA,IAAI,EAAE,IAAI;oBACV,QAAQ;oBACR,SAAS;oBACT,UAAU;oBACV,aAAa;oBACb,cAAc;oBACd,gBAAgB;oBAChB,gBAAgB;oBAChB,OAAO;oBACP,IAAI;AACJ,oBAAA,aAAa,EAAE,UAAU,EAAA,CAE3B,EAED,IAAI,IAAIA,IAAC,QAAQ,EAAA,EAAC,SAAS,EAAE,SAAS,YAAG,IAAI,EAAA,CAAY,IACzD,CACJ,EAAA,CACS;AAEhB;AAEA,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var reactAriaComponents = require('react-aria-components');
|
|
7
8
|
|
|
@@ -16,9 +17,11 @@ RadioButtonBase.displayName = 'RadioButtonBase';
|
|
|
16
17
|
*
|
|
17
18
|
* @summary single-select option used within a mutually exclusive group
|
|
18
19
|
*/
|
|
19
|
-
const RadioButton = ({ label, hint, className, size = 'sm', ...ariaRadioProps }) => {
|
|
20
|
+
const RadioButton = ({ label, hint, className, size = 'sm', 'data-testid': dataTestId, ...ariaRadioProps }) => {
|
|
20
21
|
const context = React.useContext(RadioGroupContext);
|
|
21
22
|
size = context?.size ?? size;
|
|
23
|
+
const fallbackTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-button', rootName: 'radio-button' });
|
|
24
|
+
const radioTestId = !dataTestId && context?.testIdPrefix ? testIdUtils.joinTestId(context.testIdPrefix, `option-${testIdUtils.slugifyTestId(String(ariaRadioProps.value))}`) : fallbackTestId;
|
|
22
25
|
const sizes = {
|
|
23
26
|
sm: {
|
|
24
27
|
root: 'gap-2',
|
|
@@ -33,14 +36,15 @@ const RadioButton = ({ label, hint, className, size = 'sm', ...ariaRadioProps })
|
|
|
33
36
|
hint: 'text-md',
|
|
34
37
|
},
|
|
35
38
|
};
|
|
36
|
-
return (jsxRuntime.jsx(reactAriaComponents.Radio, { ...ariaRadioProps, className: (state) => cx.cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', sizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(RadioButtonBase, { size: size, isSelected: isSelected, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxRuntime.jsxs("div", { className: cx.cx('inline-flex flex-col', sizes[size].textWrapper), children: [label && jsxRuntime.jsx("p", { className: cx.cx('text-secondary select-none', sizes[size].label), children: label }), hint && (
|
|
39
|
+
return (jsxRuntime.jsx(reactAriaComponents.Radio, { ...ariaRadioProps, "data-testid": radioTestId, className: (state) => cx.cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', sizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(RadioButtonBase, { size: size, isSelected: isSelected, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxRuntime.jsxs("div", { className: cx.cx('inline-flex flex-col', sizes[size].textWrapper), children: [label && jsxRuntime.jsx("p", { className: cx.cx('text-secondary select-none', sizes[size].label), children: label }), hint && (
|
|
37
40
|
// biome-ignore lint/a11y/noStaticElementInteractions: This is a hint that is not interactive
|
|
38
41
|
// biome-ignore lint/a11y/useKeyWithClickEvents: This is a hint that is not interactive
|
|
39
42
|
jsxRuntime.jsx("span", { className: cx.cx('text-tertiary', sizes[size].hint), onClick: (event) => event.stopPropagation(), children: hint }))] }))] })) }));
|
|
40
43
|
};
|
|
41
44
|
RadioButton.displayName = 'RadioButton';
|
|
42
|
-
const RadioGroup = ({ children, className, size = 'sm', ...props }) => {
|
|
43
|
-
|
|
45
|
+
const RadioGroup = ({ children, className, size = 'sm', 'data-testid': dataTestId, ...props }) => {
|
|
46
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
47
|
+
return (jsxRuntime.jsx(RadioGroupContext.Provider, { value: { size, testIdPrefix: rootTestId }, children: jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: cx.cx('flex flex-col gap-4', className), children: children }) }));
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
exports.RadioButton = RadioButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"sourcesContent":[null],"names":["createContext","_jsx","cx","useContext","AriaRadio","_jsxs","_Fragment","AriaRadioGroup"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"sourcesContent":[null],"names":["createContext","_jsx","cx","useContext","useResolvedTestId","joinTestId","slugifyTestId","AriaRadio","_jsxs","_Fragment","AriaRadioGroup"],"mappings":";;;;;;;;AAiBA,MAAM,iBAAiB,GAAGA,mBAAa,CAA+B,IAAI,CAAC;AAUpE,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,GAAG,IAAI,EAAwB,KAAI;IAC1H,QACEC,cAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEC,KAAE,CACX,wIAAwI,EACxI,IAAI,KAAK,IAAI,IAAI,QAAQ,EACzB,UAAU,IAAI,iCAAiC,EAC/C,UAAU,IAAI,+BAA+B,EAC7C,UAAU,IAAI,CAAC,UAAU,IAAI,aAAa,EAC1C,cAAc,IAAI,+CAA+C,EACjE,SAAS,CACV,EAAA,QAAA,EAEDD,cAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEC,KAAE,CAAC,oEAAoE,EAAE,IAAI,KAAK,IAAI,IAAI,QAAQ,EAAE,UAAU,IAAI,aAAa,CAAC,EAAA,CAC3I,EAAA,CACE;AAEV;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;AAW/C;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,cAAc,EAAoB,KAAI;AACrI,IAAA,MAAM,OAAO,GAAGC,gBAAU,CAAC,iBAAiB,CAAC;AAE7C,IAAA,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;AAE5B,IAAA,MAAM,cAAc,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AACnH,IAAA,MAAM,WAAW,GACf,CAAC,UAAU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,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,EAAA,QAAA,EAAA,CAChE,KAAK,IAAID,sBAAG,SAAS,EAAEC,KAAE,CAAC,4BAA4B,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAA,QAAA,EAAG,KAAK,EAAA,CAAK,EACvF,IAAI;;;AAGH,wBAAAD,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEC,KAAE,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EAAA,QAAA,EAChG,IAAI,EAAA,CACA,CACR,IACG,CACP,CAAA,EAAA,CACA,CACJ,EAAA,CACS;AAEhB;AACA,WAAW,CAAC,WAAW,GAAG,aAAa;MAS1B,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAmB,KAAI;AACvH,IAAA,MAAM,UAAU,GAAGE,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,QACEH,cAAA,CAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,YACnEA,cAAA,CAACS,8BAAc,EAAA,EAAA,GAAK,KAAK,iBAAe,UAAU,EAAE,SAAS,EAAER,KAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAA,QAAA,EAChG,QAAQ,EAAA,CACM,EAAA,CACU;AAEjC;;;;;;"}
|
|
@@ -2,6 +2,7 @@ import { type ReactNode, type Ref } from 'react';
|
|
|
2
2
|
import { type RadioGroupProps as AriaRadioGroupProps, type RadioProps as AriaRadioProps } from 'react-aria-components';
|
|
3
3
|
export interface RadioGroupContextType {
|
|
4
4
|
size?: 'sm' | 'md';
|
|
5
|
+
testIdPrefix?: string;
|
|
5
6
|
}
|
|
6
7
|
export interface RadioButtonBaseProps {
|
|
7
8
|
size?: 'sm' | 'md';
|
|
@@ -19,6 +20,8 @@ export interface RadioButtonProps extends AriaRadioProps {
|
|
|
19
20
|
label?: ReactNode;
|
|
20
21
|
hint?: ReactNode;
|
|
21
22
|
ref?: Ref<HTMLLabelElement>;
|
|
23
|
+
/** Overrides the derived `data-testid` (defaults to `<group>--option-<value>` or `fd-radio-button`). */
|
|
24
|
+
'data-testid'?: string;
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
27
|
* Single-select option rendered inside a `RadioGroup`. Enforces mutual exclusivity
|
|
@@ -27,13 +30,15 @@ export interface RadioButtonProps extends AriaRadioProps {
|
|
|
27
30
|
* @summary single-select option used within a mutually exclusive group
|
|
28
31
|
*/
|
|
29
32
|
export declare const RadioButton: {
|
|
30
|
-
({ label, hint, className, size, ...ariaRadioProps }: RadioButtonProps): import("react").JSX.Element;
|
|
33
|
+
({ label, hint, className, size, "data-testid": dataTestId, ...ariaRadioProps }: RadioButtonProps): import("react").JSX.Element;
|
|
31
34
|
displayName: string;
|
|
32
35
|
};
|
|
33
|
-
interface RadioGroupProps extends RadioGroupContextType, AriaRadioGroupProps {
|
|
36
|
+
interface RadioGroupProps extends Pick<RadioGroupContextType, 'size'>, AriaRadioGroupProps {
|
|
34
37
|
children: ReactNode;
|
|
35
38
|
className?: string;
|
|
39
|
+
/** Overrides the `data-testid` (defaults to `fd-radio-group`). */
|
|
40
|
+
'data-testid'?: string;
|
|
36
41
|
}
|
|
37
|
-
export declare const RadioGroup: ({ children, className, size, ...props }: RadioGroupProps) => import("react").JSX.Element;
|
|
42
|
+
export declare const RadioGroup: ({ children, className, size, "data-testid": dataTestId, ...props }: RadioGroupProps) => import("react").JSX.Element;
|
|
38
43
|
export {};
|
|
39
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,GAAG,EAAc,MAAM,OAAO,CAAC;AAC5E,OAAO,EAGL,KAAK,eAAe,IAAI,mBAAmB,EAC3C,KAAK,UAAU,IAAI,cAAc,EAClC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,eAAe;kEAAwE,oBAAoB;;CAkBvH,CAAC;AAGF,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,wGAAwG;IACxG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW;qFAA2F,gBAAgB;;CA8DlI,CAAC;AAGF,UAAU,eAAgB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,EAAE,mBAAmB;IACxF,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,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