@flipdish/ui-library 0.9.2 → 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/Pagination/index.cjs +1 -1
- package/dist/components/molecules/Pagination/index.cjs.map +1 -1
- package/dist/components/molecules/Pagination/index.js +1 -1
- package/dist/components/molecules/Pagination/index.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 +39 -4
- package/dist/components/molecules/Select/components/multi-select.cjs.map +1 -1
- package/dist/components/molecules/Select/components/multi-select.d.ts +3 -1
- package/dist/components/molecules/Select/components/multi-select.d.ts.map +1 -1
- package/dist/components/molecules/Select/components/multi-select.js +40 -5
- 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 +8 -4
- package/dist/components/molecules/Select/index.cjs.map +1 -1
- package/dist/components/molecules/Select/index.d.ts +9 -1
- package/dist/components/molecules/Select/index.d.ts.map +1 -1
- package/dist/components/molecules/Select/index.js +7 -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/DatePicker/components/date-range-picker.d.ts +1 -2
- package/dist/components/organisms/DatePicker/components/date-range-picker.d.ts.map +1 -1
- package/dist/components/organisms/DatePicker/components/range-calendar.d.ts +1 -1
- package/dist/components/organisms/DatePicker/components/range-calendar.d.ts.map +1 -1
- package/dist/components/organisms/DatePicker/index.d.ts +2 -2
- package/dist/components/organisms/DatePicker/index.d.ts.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
- package/dist/components/molecules/MultiSelect/index.cjs +0 -8
- package/dist/components/molecules/MultiSelect/index.cjs.map +0 -1
- package/dist/components/molecules/MultiSelect/index.d.ts +0 -8
- package/dist/components/molecules/MultiSelect/index.d.ts.map +0 -1
- package/dist/components/molecules/MultiSelect/index.js +0 -2
- package/dist/components/molecules/MultiSelect/index.js.map +0 -1
|
@@ -2,10 +2,12 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Avatar } from '@flipdish/ui-library/components/atoms/Avatar';
|
|
3
3
|
import { CheckboxBase } from '@flipdish/ui-library/components/atoms/Checkbox';
|
|
4
4
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
|
+
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
6
|
import { RadioGroup, Radio, Label, Text } from 'react-aria-components';
|
|
6
7
|
|
|
7
|
-
const RadioGroupAvatar = ({ items, size = 'sm', className, ...props }) => {
|
|
8
|
-
|
|
8
|
+
const RadioGroupAvatar = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
9
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
10
|
+
return (jsx(RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((person) => (jsx(Radio, { isDisabled: person.disabled, value: person.id, "data-testid": joinTestId(rootTestId, `option-${person.id}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxs(Fragment, { children: [jsxs("div", { className: cx('flex flex-1', size === 'md' ? 'gap-3 md:gap-4' : 'gap-3'), children: [jsx(Avatar, { alt: person.name, src: person.avatarUrl, size: size === 'md' ? 'md' : 'sm' }), jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxs(Label, { className: cx('pointer-events-none flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsx("span", { className: cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: person.name }), jsx("span", { className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: person.username })] }), jsx(Text, { slot: "description", className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: person.title })] })] }), jsx(CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }, person.id))) }));
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export { RadioGroupAvatar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-avatar.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-avatar.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","AvatarComponent","AriaLabel","AriaText"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-avatar.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-avatar.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","_Fragment","AvatarComponent","AriaLabel","AriaText"],"mappings":";;;;;;;MAyBa,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAyB,KAAI;AAChI,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,QACEA,GAAA,CAACC,UAAc,EAAA,EAAA,GACT,KAAK,iBACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,MAChBD,GAAA,CAACE,KAAS,EAAA,EACR,U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SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAAG,MAAM,CAAC,QAAQ,EAAA,CAAQ,CAAA,EAAA,CAC3F,EACZA,GAAA,CAACO,IAAQ,EAAA,EAAC,IAAI,EAAC,aAAa,EAAC,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAC/F,MAAM,CAAC,KAAK,GACJ,CAAA,EAAA,CACP,CAAA,EAAA,CACF,EACNP,GAAA,CAAC,YAAY,EAAA,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,GAAI,CAAA,EAAA,CAClI,CACJ,EAAA,EA7BI,MAAM,CAAC,EAAE,CA8BJ,CACb,CAAC,EAAA,CACa;AAErB;;;;"}
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var Checkbox = require('@flipdish/ui-library/components/atoms/Checkbox');
|
|
5
5
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
6
7
|
var reactAriaComponents = require('react-aria-components');
|
|
7
8
|
|
|
8
|
-
const RadioGroupCheckbox = ({ items, size = 'sm', className, ...props }) => {
|
|
9
|
-
|
|
9
|
+
const RadioGroupCheckbox = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
10
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
11
|
+
return (jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan) => (jsxRuntime.jsx(reactAriaComponents.Radio, { isDisabled: plan.disabled, value: plan.value, "data-testid": testIdUtils.joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isFocusVisible, isSelected }) => cx.cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', size === 'md' ? 'gap-3' : 'gap-2', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Checkbox.CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible, className: "mt-0.5" }), jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxRuntime.jsxs(reactAriaComponents.Label, { className: cx.cx('pointer-events-none flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsxRuntime.jsx("span", { className: cx.cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: plan.title }), jsxRuntime.jsx("span", { className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsxRuntime.jsx(reactAriaComponents.Text, { slot: "description", className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] })] })) }, plan.value))) }));
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
exports.RadioGroupCheckbox = RadioGroupCheckbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-checkbox.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-checkbox.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","cx","AriaRadio","_jsxs","_Fragment","CheckboxBase","AriaLabel","AriaText"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-checkbox.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-checkbox.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","_jsx","AriaRadioGroup","cx","AriaRadio","joinTestId","_jsxs","_Fragment","CheckboxBase","AriaLabel","AriaText"],"mappings":";;;;;;;;MAea,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAA2B,KAAI;AACpI,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,QACEC,cAAA,CAACC,8BAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAKC,KAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MACdF,cAAA,CAACG,yBAAS,EAAA,EACR,UAAU,EAAE,IAAI,CAAC,QAAQ,EAEzB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,aAAA,EACJC,sBAAU,CAAC,UAAU,EAAE,CAAA,OAAA,EAAU,IAAI,CAAC,KAAK,CAAA,CAAE,CAAC,EAC3D,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,KACpDF,KAAE,CACA,wGAAwG,EACxG,IAAI,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO,EACjC,UAAU,GAAG,mBAAmB,GAAG,uBAAuB,EAC1D,UAAU,IAAI,4DAA4D,EAC1E,cAAc,IAAI,4BAA4B,CAC/C,EAAA,QAAA,EAGF,C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Type } from '../radioGroup.types';
|
|
|
3
3
|
interface RadioGroupCheckboxProps extends RadioGroupProps {
|
|
4
4
|
size?: 'sm' | 'md';
|
|
5
5
|
items: RadioGroupItemType[];
|
|
6
|
+
/** Overrides the root `data-testid`. Options derive from it (e.g. `<root>--option-<value>`). */
|
|
7
|
+
'data-testid'?: string;
|
|
6
8
|
}
|
|
7
|
-
export declare const RadioGroupCheckbox: ({ items, size, className, ...props }: RadioGroupCheckboxProps) => import("react").JSX.Element;
|
|
9
|
+
export declare const RadioGroupCheckbox: ({ items, size, className, "data-testid": dataTestId, ...props }: RadioGroupCheckboxProps) => import("react").JSX.Element;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=radio-group-checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-checkbox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-checkbox.tsx"],"names":[],"mappings":"AAKA,OAAO,EAA0F,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACrJ,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,UAAU,uBAAwB,SAAQ,eAAe;IACvD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,GAAI,iEAAwE,uBAAuB,gCAkDjI,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { CheckboxBase } from '@flipdish/ui-library/components/atoms/Checkbox';
|
|
3
3
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
4
|
+
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
4
5
|
import { RadioGroup, Radio, Label, Text } from 'react-aria-components';
|
|
5
6
|
|
|
6
|
-
const RadioGroupCheckbox = ({ items, size = 'sm', className, ...props }) => {
|
|
7
|
-
|
|
7
|
+
const RadioGroupCheckbox = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
8
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
9
|
+
return (jsx(RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan) => (jsx(Radio, { isDisabled: plan.disabled, value: plan.value, "data-testid": joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isFocusVisible, isSelected }) => cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', size === 'md' ? 'gap-3' : 'gap-2', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxs(Fragment, { children: [jsx(CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible, className: "mt-0.5" }), jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxs(Label, { className: cx('pointer-events-none flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsx("span", { className: cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: plan.title }), jsx("span", { className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsx(Text, { slot: "description", className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] })] })) }, plan.value))) }));
|
|
8
10
|
};
|
|
9
11
|
|
|
10
12
|
export { RadioGroupCheckbox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-checkbox.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-checkbox.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","_Fragment","AriaLabel","AriaText"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-checkbox.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-checkbox.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","_Fragment","AriaLabel","AriaText"],"mappings":";;;;;;MAea,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAA2B,KAAI;AACpI,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,QACEA,GAAA,CAACC,UAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MACdD,GAAA,CAACE,KAAS,EAAA,EACR,UAAU,EAAE,IAAI,CAAC,QAAQ,EAEzB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,aAAA,EACJ,UAAU,CAAC,UAAU,EAAE,CAAA,OAAA,EAAU,IAAI,CAAC,KAAK,CAAA,CAAE,CAAC,EAC3D,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,U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AS,CAAC,EAAA,QAAA,EAC/F,IAAI,CAAC,WAAW,EAAA,CACR,CAAA,EAAA,CACP,IACL,CACJ,EAAA,EAjCI,IAAI,CAAC,KAAK,CAkCL,CACb,CAAC,EAAA,CACa;AAErB;;;;"}
|
|
@@ -5,10 +5,12 @@ var Badge = require('@flipdish/ui-library/components/atoms/Badge');
|
|
|
5
5
|
var Checkbox = require('@flipdish/ui-library/components/atoms/Checkbox');
|
|
6
6
|
var FeaturedIcon = require('@flipdish/ui-library/components/atoms/FeaturedIcon');
|
|
7
7
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
8
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
8
9
|
var reactAriaComponents = require('react-aria-components');
|
|
9
10
|
|
|
10
|
-
const RadioGroupIconCard = ({ items, size = 'sm', className, ...props }) => {
|
|
11
|
-
|
|
11
|
+
const RadioGroupIconCard = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
12
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
13
|
+
return (jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan) => (jsxRuntime.jsx(reactAriaComponents.Radio, { isDisabled: plan.disabled, value: plan.value, "data-testid": testIdUtils.joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx.cx('relative block cursor-pointer rounded-xl bg-primary outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled', isSelected && isDisabled && 'ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: cx.cx('flex items-center gap-3 rounded-t-xl p-3 pr-5 ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'ring-disabled', isSelected && isDisabled && 'ring-disabled_subtle', isFocusVisible && 'outline-hidden'), children: [jsxRuntime.jsx(FeaturedIcon.FeaturedIcon, { size: size === 'md' ? 'md' : 'sm', icon: plan.icon, color: "gray", theme: "modern", className: cx.cx(isDisabled && 'bg-disabled text-fg-disabled') }), jsxRuntime.jsx("span", { className: cx.cx('mr-1 text-secondary', size === 'md' ? 'text-lg font-semibold' : 'text-md font-semibold'), children: plan.title }), jsxRuntime.jsx(Checkbox.CheckboxBase, { size: size === 'md' ? 'md' : 'sm', className: "ml-auto", isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] }), jsxRuntime.jsxs("div", { className: "flex flex-col-reverse items-start justify-between gap-4 rounded-b-lg p-4 sm:flex-row sm:gap-1", children: [jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col', size === 'md' ? 'gap-2' : 'gap-1'), children: [jsxRuntime.jsxs("p", { className: "flex items-baseline gap-1", children: [jsxRuntime.jsx("span", { className: cx.cx('text-secondary', size === 'md' ? 'text-display-md font-semibold' : 'text-display-sm font-semibold'), children: plan.price }), jsxRuntime.jsx("span", { className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsxRuntime.jsx("p", { className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] }), plan.badge && (jsxRuntime.jsx(Badge.BadgeWithDot, { size: "sm", type: "modern", color: "success", children: plan.badge }))] })] })) }, plan.value))) }));
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
exports.RadioGroupIconCard = RadioGroupIconCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-icon-card.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-card.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","cx","AriaRadio","_jsxs","_Fragment","FeaturedIcon","CheckboxBase","BadgeWithDot"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-icon-card.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-card.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","_jsx","AriaRadioGroup","cx","AriaRadio","joinTestId","_jsxs","_Fragment","FeaturedIcon","CheckboxBase","BadgeWithDot"],"mappings":";;;;;;;;;;MA6Ba,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAA2B,KAAI;AACpI,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;IAE7G,QACEC,eAACC,8BAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAKC,KAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MACdF,cAAA,CAACG,yBAAS,EAAA,EACR,UAAU,EAAE,IAAI,CAAC,QAAQ,EAEzB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,aAAA,EACJC,sBAAU,CAAC,UAAU,EAAE,CAAA,OAAA,EAAU,IAAI,CAAC,KAAK,CAAA,CAAE,CAAC,EAC3D,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,KACpDF,KAAE,CACA,mFAAmF,EACnF,UAAU,GAAG,mBAAmB,GAAG,uBAAuB,EAC1D,UAAU,IAAI,qDAAqD,EACnE,UAAU,IAAI,UAAU,IAAI,sBAAsB,EAClD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C,2BAA2B,EAAA,QAAA,EAAA,CACtCL,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEE,KAAE,CAAC,gBAAgB,EAAE,IAAI,KAAK,IAAI,GAAG,+BAA+B,GAAG,+BAA+B,CAAC,EAAA,QAAA,EACrH,IAAI,CAAC,KAAK,GACN,EACPF,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAAG,IAAI,CAAC,cAAc,EAAA,CAAQ,CAAA,EAAA,CACvG,EACJF,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAAG,IAAI,CAAC,WAAW,GAAK,CAAA,EAAA,CAC5F,EACL,IAAI,CAAC,KAAK,KACTF,cAAA,CAACS,kBAAY,EAAA,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,SAAS,YAClD,IAAI,CAAC,KAAK,EAAA,CACE,CAChB,CAAA,EAAA,CACG,IACL,CACJ,EAAA,EA5DI,IAAI,CAAC,KAAK,CA6DL,CACb,CAAC,EAAA,CACa;AAErB;;;;"}
|
|
@@ -15,7 +15,9 @@ type IconCardItemType = {
|
|
|
15
15
|
interface RadioGroupIconCardProps extends RadioGroupProps {
|
|
16
16
|
size?: 'sm' | 'md';
|
|
17
17
|
items: IconCardItemType[];
|
|
18
|
+
/** Overrides the root `data-testid`. Options derive from it (e.g. `<root>--option-<value>`). */
|
|
19
|
+
'data-testid'?: string;
|
|
18
20
|
}
|
|
19
|
-
export declare const RadioGroupIconCard: ({ items, size, className, ...props }: RadioGroupIconCardProps) => import("react").JSX.Element;
|
|
21
|
+
export declare const RadioGroupIconCard: ({ items, size, className, "data-testid": dataTestId, ...props }: RadioGroupIconCardProps) => import("react").JSX.Element;
|
|
20
22
|
export {};
|
|
21
23
|
//# sourceMappingURL=radio-group-icon-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-icon-card.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-card.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-icon-card.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-card.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClC,CAAC;AAEF,UAAU,uBAAwB,SAAQ,eAAe;IACvD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,GAAI,iEAAwE,uBAAuB,gCA6EjI,CAAC"}
|
|
@@ -3,10 +3,12 @@ import { BadgeWithDot } from '@flipdish/ui-library/components/atoms/Badge';
|
|
|
3
3
|
import { CheckboxBase } from '@flipdish/ui-library/components/atoms/Checkbox';
|
|
4
4
|
import { FeaturedIcon } from '@flipdish/ui-library/components/atoms/FeaturedIcon';
|
|
5
5
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
6
|
+
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
6
7
|
import { RadioGroup, Radio } from 'react-aria-components';
|
|
7
8
|
|
|
8
|
-
const RadioGroupIconCard = ({ items, size = 'sm', className, ...props }) => {
|
|
9
|
-
|
|
9
|
+
const RadioGroupIconCard = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
10
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
11
|
+
return (jsx(RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan) => (jsx(Radio, { isDisabled: plan.disabled, value: plan.value, "data-testid": joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx('relative block cursor-pointer rounded-xl bg-primary outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled', isSelected && isDisabled && 'ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxs(Fragment, { children: [jsxs("div", { className: cx('flex items-center gap-3 rounded-t-xl p-3 pr-5 ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'ring-disabled', isSelected && isDisabled && 'ring-disabled_subtle', isFocusVisible && 'outline-hidden'), children: [jsx(FeaturedIcon, { size: size === 'md' ? 'md' : 'sm', icon: plan.icon, color: "gray", theme: "modern", className: cx(isDisabled && 'bg-disabled text-fg-disabled') }), jsx("span", { className: cx('mr-1 text-secondary', size === 'md' ? 'text-lg font-semibold' : 'text-md font-semibold'), children: plan.title }), jsx(CheckboxBase, { size: size === 'md' ? 'md' : 'sm', className: "ml-auto", isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] }), jsxs("div", { className: "flex flex-col-reverse items-start justify-between gap-4 rounded-b-lg p-4 sm:flex-row sm:gap-1", children: [jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-2' : 'gap-1'), children: [jsxs("p", { className: "flex items-baseline gap-1", children: [jsx("span", { className: cx('text-secondary', size === 'md' ? 'text-display-md font-semibold' : 'text-display-sm font-semibold'), children: plan.price }), jsx("span", { className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsx("p", { className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] }), plan.badge && (jsx(BadgeWithDot, { size: "sm", type: "modern", color: "success", children: plan.badge }))] })] })) }, plan.value))) }));
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
export { RadioGroupIconCard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-icon-card.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-card.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","_Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-icon-card.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-card.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","_Fragment"],"mappings":";;;;;;;;MA6Ba,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAA2B,KAAI;AACpI,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;IAE7G,QACEA,IAACC,UAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CA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,EAAC,KAAK,EAAC,SAAS,YAClD,IAAI,CAAC,KAAK,EAAA,CACE,CAChB,CAAA,EAAA,CACG,IACL,CACJ,EAAA,EA5DI,IAAI,CAAC,KAAK,CA6DL,CACb,CAAC,EAAA,CACa;AAErB;;;;"}
|
|
@@ -4,10 +4,12 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var Checkbox = require('@flipdish/ui-library/components/atoms/Checkbox');
|
|
5
5
|
var FeaturedIcon = require('@flipdish/ui-library/components/atoms/FeaturedIcon');
|
|
6
6
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
8
|
var reactAriaComponents = require('react-aria-components');
|
|
8
9
|
|
|
9
|
-
const RadioGroupIconSimple = ({ items, size = 'sm', className, ...props }) => {
|
|
10
|
-
|
|
10
|
+
const RadioGroupIconSimple = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
11
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
12
|
+
return (jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan) => (jsxRuntime.jsx(reactAriaComponents.Radio, { isDisabled: plan.disabled, value: plan.value, "data-testid": testIdUtils.joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx.cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "flex flex-1 gap-3", children: [jsxRuntime.jsx(FeaturedIcon.FeaturedIcon, { icon: plan.icon, size: size === 'md' ? 'md' : 'sm', color: "gray", theme: "modern", className: cx.cx(isDisabled && 'bg-disabled text-fg-disabled') }), jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxRuntime.jsxs(reactAriaComponents.Label, { className: cx.cx('pointer-events-none flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsxRuntime.jsx("span", { className: cx.cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: plan.title }), jsxRuntime.jsx("span", { className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsxRuntime.jsx(reactAriaComponents.Text, { slot: "description", className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] })] }), jsxRuntime.jsx(Checkbox.CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }, plan.value))) }));
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
exports.RadioGroupIconSimple = RadioGroupIconSimple;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-icon-simple.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-simple.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","cx","AriaRadio","_jsxs","_Fragment","FeaturedIcon","AriaLabel","AriaText","CheckboxBase"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-icon-simple.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-simple.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","_jsx","AriaRadioGroup","cx","AriaRadio","joinTestId","_jsxs","_Fragment","FeaturedIcon","AriaLabel","AriaText","CheckboxBase"],"mappings":";;;;;;;;;MAiBa,oBAAoB,GAAG,CAAC,EAAE,KAAK,EAAE,I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.types';
|
|
|
3
3
|
interface RadioGroupIconSimpleProps extends RadioGroupProps {
|
|
4
4
|
size?: 'sm' | 'md';
|
|
5
5
|
items: RadioGroupItemType[];
|
|
6
|
+
/** Overrides the root `data-testid`. Options derive from it (e.g. `<root>--option-<value>`). */
|
|
7
|
+
'data-testid'?: string;
|
|
6
8
|
}
|
|
7
|
-
export declare const RadioGroupIconSimple: ({ items, size, className, ...props }: RadioGroupIconSimpleProps) => import("react").JSX.Element;
|
|
9
|
+
export declare const RadioGroupIconSimple: ({ items, size, className, "data-testid": dataTestId, ...props }: RadioGroupIconSimpleProps) => import("react").JSX.Element;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=radio-group-icon-simple.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-icon-simple.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-simple.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-icon-simple.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-simple.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,UAAU,yBAA0B,SAAQ,eAAe;IACzD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,oBAAoB,GAAI,iEAAwE,yBAAyB,gCAqDrI,CAAC"}
|
|
@@ -2,10 +2,12 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { CheckboxBase } from '@flipdish/ui-library/components/atoms/Checkbox';
|
|
3
3
|
import { FeaturedIcon } from '@flipdish/ui-library/components/atoms/FeaturedIcon';
|
|
4
4
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
|
+
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
6
|
import { RadioGroup, Radio, Label, Text } from 'react-aria-components';
|
|
6
7
|
|
|
7
|
-
const RadioGroupIconSimple = ({ items, size = 'sm', className, ...props }) => {
|
|
8
|
-
|
|
8
|
+
const RadioGroupIconSimple = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
9
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
10
|
+
return (jsx(RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan) => (jsx(Radio, { isDisabled: plan.disabled, value: plan.value, "data-testid": joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxs(Fragment, { children: [jsxs("div", { className: "flex flex-1 gap-3", children: [jsx(FeaturedIcon, { icon: plan.icon, size: size === 'md' ? 'md' : 'sm', color: "gray", theme: "modern", className: cx(isDisabled && 'bg-disabled text-fg-disabled') }), jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxs(Label, { className: cx('pointer-events-none flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsx("span", { className: cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: plan.title }), jsx("span", { className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsx(Text, { slot: "description", className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] })] }), jsx(CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }, plan.value))) }));
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export { RadioGroupIconSimple };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-icon-simple.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-simple.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","_Fragment","AriaLabel","AriaText"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-icon-simple.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-icon-simple.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","_Fragment","AriaLabel","AriaText"],"mappings":";;;;;;;MAiBa,oBAAoB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAA6B,KAAI;AACxI,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,QACEA,GAAA,CAACC,UAAc,EAAA,EAAA,GACT,KAAK,iBACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MACdD,GAAA,CAACE,KAAS,EAAA,EACR,UAAU,EAAE,IAAI,CAAC,QAAQ,EAEzB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,aAAA,EACJ,U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,GAAG,SAAS,CAAC,EAAA,QAAA,EAAG,IAAI,CAAC,cAAc,GAAQ,CAAA,EAAA,CAC/F,EACZA,GAAA,CAACM,IAAQ,IAAC,IAAI,EAAC,aAAa,EAAC,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAC/F,IAAI,CAAC,WAAW,GACR,CAAA,EAAA,CACP,CAAA,EAAA,CACF,EAENN,GAAA,CAAC,YAAY,EAAA,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,GAAI,CAAA,EAAA,CAClI,CACJ,EAAA,EApCI,IAAI,CAAC,KAAK,CAqCL,CACb,CAAC,EAAA,CACa;AAErB;;;;"}
|
|
@@ -4,10 +4,12 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var Button = require('@flipdish/ui-library/components/atoms/Button');
|
|
5
5
|
var Checkbox = require('@flipdish/ui-library/components/atoms/Checkbox');
|
|
6
6
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
8
|
var reactAriaComponents = require('react-aria-components');
|
|
8
9
|
|
|
9
|
-
const RadioGroupPaymentIcon = ({ items, size = 'sm', className, ...props }) => {
|
|
10
|
-
|
|
10
|
+
const RadioGroupPaymentIcon = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
11
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
12
|
+
return (jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((card) => (jsxRuntime.jsx(reactAriaComponents.Radio, { isDisabled: card.disabled, value: card.value, "data-testid": testIdUtils.joinTestId(rootTestId, `option-${card.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx.cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'bg-disabled_subtle ring-disabled_subtle cursor-not-allowed', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: cx.cx('flex flex-1', size === 'md' ? 'gap-3 md:gap-4' : 'gap-3'), children: [jsxRuntime.jsx("span", { className: "shrink-0", children: card.logo }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxRuntime.jsx(reactAriaComponents.Label, { className: cx.cx('pointer-events-none text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: card.title }), jsxRuntime.jsx(reactAriaComponents.Text, { slot: "description", className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: card.description })] }), jsxRuntime.jsxs("div", { className: cx.cx('flex gap-3', size === 'md' ? 'mt-3' : 'mt-2'), children: [jsxRuntime.jsx(Button.Button, { color: "link-gray", size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, children: "Set as default" }), jsxRuntime.jsx(Button.Button, { color: "link-color", size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, children: "Edit" })] })] })] }), jsxRuntime.jsx(Checkbox.CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }, card.value))) }));
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
exports.RadioGroupPaymentIcon = RadioGroupPaymentIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-payment-icon.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-payment-icon.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","cx","AriaRadio","
|
|
1
|
+
{"version":3,"file":"radio-group-payment-icon.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-payment-icon.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","_jsx","AriaRadioGroup","cx","AriaRadio","joinTestId","_jsxs","AriaLabel","AriaText","Button","CheckboxBase"],"mappings":";;;;;;;;;MAyBa,qBAAqB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAA8B,KAAI;AAC1I,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,QACEC,cAAA,CAACC,8BAAc,EAAA,EAAA,GACT,KAAK,iBACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAKC,KAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,YAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MACdF,eAACG,yBAAS,EAAA,EACR,UAAU,EAAE,IAAI,CAAC,QAAQ,EAEzB,KAAK,EAAE,IAAI,CAAC,KAAK,iBACJC,sBAAU,CAAC,UAAU,EAAE,UAAU,IAAI,CAAC,KAAK,CAAA,CAAE,CAAC,EAC3D,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,KACpDF,KAAE,CACA,wGAAwG,EACxG,UAAU,GAAG,mBAAmB,GAAG,uBAAuB,EAC1D,UAAU,IAAI,4DAA4D,EAC1E,cAAc,IAAI,4BAA4B,CAC/C,EAAA,QAAA,EAGF,C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,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,qBAE3E,CAAA,EAAA,CACL,CAAA,EAAA,CACF,CAAA,EAAA,CACF,EAENR,eAACS,qBAAY,EAAA,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,GAAI,CAAA,EAAA,CAClI,CACJ,EAAA,EAtCI,IAAI,CAAC,KAAK,CAuCL,CACb,CAAC,EAAA,CACa;AAErB;;;;"}
|
|
@@ -10,7 +10,9 @@ interface PaymentCardItemType {
|
|
|
10
10
|
interface RadioGroupPaymentIconProps extends RadioGroupProps {
|
|
11
11
|
size?: 'sm' | 'md';
|
|
12
12
|
items: PaymentCardItemType[];
|
|
13
|
+
/** Overrides the root `data-testid`. Options derive from it (e.g. `<root>--option-<value>`). */
|
|
14
|
+
'data-testid'?: string;
|
|
13
15
|
}
|
|
14
|
-
export declare const RadioGroupPaymentIcon: ({ items, size, className, ...props }: RadioGroupPaymentIconProps) => import("react").JSX.Element;
|
|
16
|
+
export declare const RadioGroupPaymentIcon: ({ items, size, className, "data-testid": dataTestId, ...props }: RadioGroupPaymentIconProps) => import("react").JSX.Element;
|
|
15
17
|
export {};
|
|
16
18
|
//# sourceMappingURL=radio-group-payment-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-payment-icon.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-payment-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-payment-icon.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-payment-icon.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,0BAA2B,SAAQ,eAAe;IAC1D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,qBAAqB,GAAI,iEAAwE,0BAA0B,gCAuDvI,CAAC"}
|
|
@@ -2,10 +2,12 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Button } from '@flipdish/ui-library/components/atoms/Button';
|
|
3
3
|
import { CheckboxBase } from '@flipdish/ui-library/components/atoms/Checkbox';
|
|
4
4
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
|
+
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
6
|
import { RadioGroup, Radio, Label, Text } from 'react-aria-components';
|
|
6
7
|
|
|
7
|
-
const RadioGroupPaymentIcon = ({ items, size = 'sm', className, ...props }) => {
|
|
8
|
-
|
|
8
|
+
const RadioGroupPaymentIcon = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
9
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
10
|
+
return (jsx(RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((card) => (jsx(Radio, { isDisabled: card.disabled, value: card.value, "data-testid": joinTestId(rootTestId, `option-${card.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'bg-disabled_subtle ring-disabled_subtle cursor-not-allowed', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxs(Fragment, { children: [jsxs("div", { className: cx('flex flex-1', size === 'md' ? 'gap-3 md:gap-4' : 'gap-3'), children: [jsx("span", { className: "shrink-0", children: card.logo }), jsxs("div", { children: [jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsx(Label, { className: cx('pointer-events-none text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: card.title }), jsx(Text, { slot: "description", className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: card.description })] }), jsxs("div", { className: cx('flex gap-3', size === 'md' ? 'mt-3' : 'mt-2'), children: [jsx(Button, { color: "link-gray", size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, children: "Set as default" }), jsx(Button, { color: "link-color", size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, children: "Edit" })] })] })] }), jsx(CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }, card.value))) }));
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export { RadioGroupPaymentIcon };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-payment-icon.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-payment-icon.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","
|
|
1
|
+
{"version":3,"file":"radio-group-payment-icon.js","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-payment-icon.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadio","_jsxs","AriaLabel","AriaText"],"mappings":";;;;;;;MAyBa,qBAAqB,GAAG,CAAC,EAAE,KAAK,EAAE,IAA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 +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
|
/**
|
|
@@ -10,8 +11,9 @@ var reactAriaComponents = require('react-aria-components');
|
|
|
10
11
|
*
|
|
11
12
|
* @summary radio-button card group for plan or tier selection
|
|
12
13
|
*/
|
|
13
|
-
const RadioGroupRadioButton = ({ items, size = 'sm', className, ...props }) => {
|
|
14
|
-
|
|
14
|
+
const RadioGroupRadioButton = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
15
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
16
|
+
return (jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan) => (jsxRuntime.jsx(reactAriaComponents.Radio, { isDisabled: plan.disabled, value: plan.value, "data-testid": testIdUtils.joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx.cx('relative flex cursor-pointer rounded-xl bg-primary p-4 outline-focus-ring ring-inset', size === 'md' ? 'gap-3' : 'gap-2', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: cx.cx('relative mt-0.5 inline-flex shrink-0 items-center justify-center rounded-full ring-inset', size === 'md' ? 'size-5' : 'size-4', isSelected ? 'bg-brand-solid' : 'ring-1 ring-primary', isDisabled && 'bg-disabled_subtle ring-1 ring-disabled', isFocusVisible && 'outline-2 outline-offset-2 outline-focus-ring'), children: jsxRuntime.jsx("div", { className: cx.cx('absolute rounded-full bg-fg-white opacity-0', size === 'md' ? 'size-2' : 'size-1.5', isSelected ? 'opacity-100' : 'opacity-0', isDisabled && 'bg-fg-disabled_subtle') }) }), jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxRuntime.jsxs(reactAriaComponents.Label, { className: cx.cx('pointer-events-none flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsxRuntime.jsx("span", { className: cx.cx('text-sm font-medium text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: plan.title }), jsxRuntime.jsx("span", { className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsxRuntime.jsx(reactAriaComponents.Text, { slot: "description", className: cx.cx('text-sm text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] })] })) }, plan.value))) }));
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
exports.RadioGroupRadioButton = RadioGroupRadioButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-radio-button.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-radio-button.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","cx","AriaRadio","_jsxs","AriaLabel","AriaText"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-radio-button.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-radio-button.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","_jsx","AriaRadioGroup","cx","AriaRadio","joinTestId","_jsxs","AriaLabel","AriaText"],"mappings":";;;;;;;AAeA;;;;;AAKG;MACU,qBAAqB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KA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KAAK,IAAI,GAAG,QAAQ,GAAG,UAAU,EACrC,UAAU,GAAG,aAAa,GAAG,WAAW,EACxC,UAAU,IAAI,uBAAuB,CACtC,EAAA,CACD,GACE,EAENG,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEH,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,EAAE,CAAC,aACjEG,eAAA,CAACC,yBAAS,IAAC,SAAS,EAAEJ,KAAE,CAAC,0BAA0B,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,aACvFF,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEE,KAAE,CAAC,oCAAoC,EAAE,IAAI,KAAK,IAAI,GAAG,qBAAqB,GAAG,qBAAqB,CAAC,EAAA,QAAA,EACrH,IAAI,CAAC,KAAK,GACN,EACPF,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAAG,IAAI,CAAC,cAAc,GAAQ,CAAA,EAAA,CAC/F,EACZF,cAAA,CAACO,wBAAQ,IAAC,IAAI,EAAC,aAAa,EAAC,SAAS,EAAEL,KAAE,CAAC,uBAAuB,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EACvG,IAAI,CAAC,WAAW,EAAA,CACR,IACP,CAAA,EAAA,CACL,CACJ,EAAA,EA9CI,IAAI,CAAC,KAAK,CA+CL,CACb,CAAC,EAAA,CACa;AAErB;;;;"}
|
|
@@ -3,6 +3,8 @@ import type { RadioGroupItemType } from '../radioGroup.types';
|
|
|
3
3
|
export interface RadioGroupRadioButtonProps extends RadioGroupProps {
|
|
4
4
|
size?: 'sm' | 'md';
|
|
5
5
|
items: RadioGroupItemType[];
|
|
6
|
+
/** Overrides the root `data-testid`. Options derive from it (e.g. `<root>--option-<value>`). */
|
|
7
|
+
'data-testid'?: string;
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
8
10
|
* Mutually exclusive option group rendered as stacked radio-button cards with a
|
|
@@ -10,5 +12,5 @@ export interface RadioGroupRadioButtonProps extends RadioGroupProps {
|
|
|
10
12
|
*
|
|
11
13
|
* @summary radio-button card group for plan or tier selection
|
|
12
14
|
*/
|
|
13
|
-
export declare const RadioGroupRadioButton: ({ items, size, className, ...props }: RadioGroupRadioButtonProps) => import("react").JSX.Element;
|
|
15
|
+
export declare const RadioGroupRadioButton: ({ items, size, className, "data-testid": dataTestId, ...props }: RadioGroupRadioButtonProps) => import("react").JSX.Element;
|
|
14
16
|
//# sourceMappingURL=radio-group-radio-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-radio-button.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-radio-button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group-radio-button.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/radio-group-radio-button.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IACjE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,iEAAwE,0BAA0B,gCA+DvI,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, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
3
4
|
import { RadioGroup, Radio, Label, Text } from 'react-aria-components';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -8,8 +9,9 @@ import { RadioGroup, Radio, Label, Text } from 'react-aria-components';
|
|
|
8
9
|
*
|
|
9
10
|
* @summary radio-button card group for plan or tier selection
|
|
10
11
|
*/
|
|
11
|
-
const RadioGroupRadioButton = ({ items, size = 'sm', className, ...props }) => {
|
|
12
|
-
|
|
12
|
+
const RadioGroupRadioButton = ({ items, size = 'sm', className, 'data-testid': dataTestId, ...props }) => {
|
|
13
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
14
|
+
return (jsx(RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan) => (jsx(Radio, { isDisabled: plan.disabled, value: plan.value, "data-testid": joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx('relative flex cursor-pointer rounded-xl bg-primary p-4 outline-focus-ring ring-inset', size === 'md' ? 'gap-3' : 'gap-2', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxs(Fragment, { children: [jsx("div", { className: cx('relative mt-0.5 inline-flex shrink-0 items-center justify-center rounded-full ring-inset', size === 'md' ? 'size-5' : 'size-4', isSelected ? 'bg-brand-solid' : 'ring-1 ring-primary', isDisabled && 'bg-disabled_subtle ring-1 ring-disabled', isFocusVisible && 'outline-2 outline-offset-2 outline-focus-ring'), children: jsx("div", { className: cx('absolute rounded-full bg-fg-white opacity-0', size === 'md' ? 'size-2' : 'size-1.5', isSelected ? 'opacity-100' : 'opacity-0', isDisabled && 'bg-fg-disabled_subtle') }) }), jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxs(Label, { className: cx('pointer-events-none flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsx("span", { className: cx('text-sm font-medium text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: plan.title }), jsx("span", { className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsx(Text, { slot: "description", className: cx('text-sm text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] })] })) }, plan.value))) }));
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export { RadioGroupRadioButton };
|