@transferwise/components 0.0.0-experimental-6e04f56 → 0.0.0-experimental-542ae69
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/build/Body/Body.js +1 -1
- package/build/Body/Body.js.map +1 -1
- package/build/Body/Body.mjs +1 -1
- package/build/Body/Body.mjs.map +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.js +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.js.map +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs.map +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js.map +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs.map +1 -1
- package/build/Calendar/TableLink/TableLink.js +1 -1
- package/build/Calendar/TableLink/TableLink.js.map +1 -1
- package/build/Calendar/TableLink/TableLink.mjs +1 -1
- package/build/Calendar/TableLink/TableLink.mjs.map +1 -1
- package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js +1 -1
- package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js.map +1 -1
- package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs +1 -1
- package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs.map +1 -1
- package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js +2 -2
- package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +1 -1
- package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs +2 -2
- package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +1 -1
- package/build/Inputs/SelectInput/Option/SelectInputOption.js +1 -1
- package/build/Inputs/SelectInput/Option/SelectInputOption.js.map +1 -1
- package/build/Inputs/SelectInput/Option/SelectInputOption.mjs +1 -1
- package/build/Inputs/SelectInput/Option/SelectInputOption.mjs.map +1 -1
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js +3 -3
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +1 -1
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +3 -3
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +1 -1
- package/build/Inputs/SelectInput/Popover/SelectInputPopover.js +2 -2
- package/build/Inputs/SelectInput/Popover/SelectInputPopover.js.map +1 -1
- package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs +2 -2
- package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs.map +1 -1
- package/build/Label/Label.js +1 -1
- package/build/Label/Label.js.map +1 -1
- package/build/Label/Label.mjs +1 -1
- package/build/Label/Label.mjs.map +1 -1
- package/build/Snackbar/Snackbar.js +101 -98
- package/build/Snackbar/Snackbar.js.map +1 -1
- package/build/Snackbar/Snackbar.mjs +102 -99
- package/build/Snackbar/Snackbar.mjs.map +1 -1
- package/build/Stepper/Stepper.js +1 -1
- package/build/Stepper/Stepper.js.map +1 -1
- package/build/Stepper/Stepper.mjs +1 -1
- package/build/Stepper/Stepper.mjs.map +1 -1
- package/build/Table/Header/TableHeader.js +1 -1
- package/build/Table/Header/TableHeader.js.map +1 -1
- package/build/Table/Header/TableHeader.mjs +1 -1
- package/build/Table/Header/TableHeader.mjs.map +1 -1
- package/build/Tabs/Tab/Tab.js +1 -1
- package/build/Tabs/Tab/Tab.js.map +1 -1
- package/build/Tabs/Tab/Tab.mjs +1 -1
- package/build/Tabs/Tab/Tab.mjs.map +1 -1
- package/build/Tag/Tag.js +1 -1
- package/build/Tag/Tag.js.map +1 -1
- package/build/Tag/Tag.mjs +1 -1
- package/build/Tag/Tag.mjs.map +1 -1
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.js +2 -2
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.js.map +1 -1
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs +2 -2
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs.map +1 -1
- package/build/Upload/Steps/UploadImageStep/UploadImageStep.js +2 -2
- package/build/Upload/Steps/UploadImageStep/UploadImageStep.js.map +1 -1
- package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs +2 -2
- package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs.map +1 -1
- package/build/_deprecated/ActionButton/ActionButton.js +1 -1
- package/build/_deprecated/ActionButton/ActionButton.js.map +1 -1
- package/build/_deprecated/ActionButton/ActionButton.mjs +1 -1
- package/build/_deprecated/ActionButton/ActionButton.mjs.map +1 -1
- package/build/_deprecated/Avatar/Avatar.js +1 -1
- package/build/_deprecated/Avatar/Avatar.js.map +1 -1
- package/build/_deprecated/Avatar/Avatar.mjs +1 -1
- package/build/_deprecated/Avatar/Avatar.mjs.map +1 -1
- package/build/_deprecated/Select/Select.js +2 -2
- package/build/_deprecated/Select/Select.js.map +1 -1
- package/build/_deprecated/Select/Select.mjs +2 -2
- package/build/_deprecated/Select/Select.mjs.map +1 -1
- package/build/common/PropsValues/typography.js +6 -0
- package/build/common/PropsValues/typography.js.map +1 -1
- package/build/common/PropsValues/typography.mjs +6 -0
- package/build/common/PropsValues/typography.mjs.map +1 -1
- package/build/main.css +2907 -1535
- package/build/styles/Accordion/Accordion.css +2 -1
- package/build/styles/Body/Body.css +1 -1
- package/build/styles/Chips/Chip/Chip.css +4 -2
- package/build/styles/Decision/Decision.css +2 -1
- package/build/styles/Inputs/Input/Input.css +62 -66
- package/build/styles/Inputs/TextArea/TextArea.css +62 -66
- package/build/styles/MoneyInput/MoneyInput.css +6 -3
- package/build/styles/Popover/Popover.css +3 -47
- package/build/styles/ProgressBar/ProgressBar.css +2 -1
- package/build/styles/Table/Table.css +15 -5
- package/build/styles/Tile/Tile.css +2 -1
- package/build/styles/Typeahead/Typeahead.css +4 -2
- package/build/styles/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
- package/build/styles/_deprecated/Select/Select.css +44 -11
- package/build/styles/css/accordion.css +23 -52
- package/build/styles/css/button-groups.css +29 -8
- package/build/styles/css/buttons.css +26 -2
- package/build/styles/css/decision.css +23 -52
- package/build/styles/css/dropdowns.css +39 -62
- package/build/styles/css/droppable.css +28 -8
- package/build/styles/css/footer.css +41 -14
- package/build/styles/css/input-groups.css +172 -165
- package/build/styles/css/list-group.css +0 -45
- package/build/styles/css/navbar.css +39 -62
- package/build/styles/css/neptune-addons.css +15 -0
- package/build/styles/css/neptune-core.css +250 -526
- package/build/styles/css/neptune.css +2759 -1422
- package/build/styles/css/popovers.css +35 -60
- package/build/styles/css/sequences.css +6 -1
- package/build/styles/css/tooltip.css +27 -7
- package/build/styles/less/neptune-tokens.less +0 -48
- package/build/styles/main.css +2907 -1535
- package/build/styles/props/neptune-tokens.css +793 -1
- package/build/styles/styles/less/accordion.css +23 -52
- package/build/styles/styles/less/button-groups.css +29 -8
- package/build/styles/styles/less/buttons.css +26 -2
- package/build/styles/styles/less/decision.css +23 -52
- package/build/styles/styles/less/dropdowns.css +39 -62
- package/build/styles/styles/less/droppable.css +28 -8
- package/build/styles/styles/less/footer.css +41 -14
- package/build/styles/styles/less/forms/bootstrap-forms.css +137 -91
- package/build/styles/styles/less/input-groups.css +172 -165
- package/build/styles/styles/less/list-group.css +0 -45
- package/build/styles/styles/less/navbar.css +39 -62
- package/build/styles/styles/less/neptune-addons.css +15 -0
- package/build/styles/styles/less/neptune-core.css +250 -526
- package/build/styles/styles/less/neptune.css +2759 -1422
- package/build/styles/styles/less/popovers.css +35 -60
- package/build/styles/styles/less/sequences.css +6 -1
- package/build/styles/styles/less/tooltip.css +27 -7
- package/build/types/Snackbar/Snackbar.d.ts +15 -1
- package/build/types/Snackbar/Snackbar.d.ts.map +1 -1
- package/build/types/common/PropsValues/typography.d.ts +13 -1
- package/build/types/common/PropsValues/typography.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Accordion/Accordion.css +2 -1
- package/src/Accordion/Accordion.less +2 -1
- package/src/Body/Body.css +1 -1
- package/src/Body/Body.less +1 -1
- package/src/Body/Body.test.tsx +4 -4
- package/src/Body/Body.tsx +2 -2
- package/src/Calendar/DayCalendar/Table/DayCalendarTable.tsx +2 -2
- package/src/Calendar/MonthCalendar/Table/MonthCalendarTable.tsx +1 -1
- package/src/Calendar/TableLink/TableLink.tsx +1 -1
- package/src/Chips/Chip/Chip.css +4 -2
- package/src/Chips/Chip/Chip.less +2 -1
- package/src/Decision/Decision.css +2 -1
- package/src/Decision/Decision.less +2 -1
- package/src/DefinitionList/_stories/DefinitionList.story.tsx +1 -1
- package/src/Display/_stories/Display.story.tsx +20 -6
- package/src/FlowNavigation/AnimatedLabel/AnimatedLabel.tsx +1 -1
- package/src/Inputs/Input/Input.css +62 -66
- package/src/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx +2 -2
- package/src/Inputs/SelectInput/Option/SelectInputOption.tsx +1 -1
- package/src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +3 -3
- package/src/Inputs/SelectInput/Popover/SelectInputPopover.tsx +2 -2
- package/src/Inputs/SelectInput/_stories/SelectInput.story.tsx +1 -1
- package/src/Inputs/TextArea/TextArea.css +62 -66
- package/src/Inputs/_common.less +5 -5
- package/src/Label/Label.tsx +1 -1
- package/src/MoneyInput/MoneyInput.css +6 -3
- package/src/MoneyInput/MoneyInput.less +7 -4
- package/src/PocketSurface/_stories/PocketSurface.story.tsx +2 -2
- package/src/Popover/Popover.css +3 -47
- package/src/Popover/Popover.less +1 -1
- package/src/ProgressBar/ProgressBar.css +2 -1
- package/src/ProgressBar/ProgressBar.less +12 -11
- package/src/SentimentSurface/_stories/SentimentSurface.story.tsx +1 -1
- package/src/Snackbar/Snackbar.tsx +88 -90
- package/src/Stepper/Stepper.tsx +1 -1
- package/src/Table/Header/TableHeader.tsx +1 -1
- package/src/Table/StatusText/TableStatusText.test.tsx +5 -5
- package/src/Table/Table.css +15 -5
- package/src/Table/Table.less +17 -6
- package/src/Tabs/Tab/Tab.tsx +1 -1
- package/src/Tag/Tag.tsx +1 -1
- package/src/Tag/_stories/Tag.story.tsx +1 -1
- package/src/Tile/Tile.css +2 -1
- package/src/Tile/Tile.less +2 -1
- package/src/Typeahead/Typeahead.css +4 -2
- package/src/Typeahead/Typeahead.less +2 -1
- package/src/Typeahead/TypeaheadOption/TypeaheadOption.tsx +2 -2
- package/src/Upload/Steps/UploadImageStep/UploadImageStep.tsx +2 -2
- package/src/_deprecated/ActionButton/ActionButton.tsx +1 -1
- package/src/_deprecated/Avatar/Avatar.tsx +1 -1
- package/src/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
- package/src/_deprecated/CriticalBanner/CriticalCommsBanner.less +2 -1
- package/src/_deprecated/NavigationOption/_stories/NavigationOption.story.tsx +6 -6
- package/src/_deprecated/Select/Select.css +44 -11
- package/src/_deprecated/Select/Select.less +10 -5
- package/src/_deprecated/Select/Select.tsx +2 -2
- package/src/common/PropsValues/typography.ts +20 -1
- package/src/main.css +2907 -1535
- package/src/styles/less/accordion.css +23 -52
- package/src/styles/less/addons/_background-utilities.less +5 -0
- package/src/styles/less/button-groups.css +29 -8
- package/src/styles/less/button-groups.less +3 -2
- package/src/styles/less/buttons.css +26 -2
- package/src/styles/less/buttons.less +1 -1
- package/src/styles/less/core/_typography.less +67 -221
- package/src/styles/less/decision.css +23 -52
- package/src/styles/less/decision.less +2 -2
- package/src/styles/less/dropdowns.css +39 -62
- package/src/styles/less/dropdowns.less +6 -5
- package/src/styles/less/droppable.css +28 -8
- package/src/styles/less/droppable.less +4 -4
- package/src/styles/less/footer.css +41 -14
- package/src/styles/less/footer.less +4 -3
- package/src/styles/less/forms/bootstrap-forms.css +137 -91
- package/src/styles/less/forms/bootstrap-forms.less +70 -57
- package/src/styles/less/input-groups.css +172 -165
- package/src/styles/less/input-groups.less +5 -5
- package/src/styles/less/list-group.css +0 -45
- package/src/styles/less/list-group.less +7 -4
- package/src/styles/less/mixins/_text-emphasis.less +7 -1
- package/src/styles/less/navbar.css +39 -62
- package/src/styles/less/neptune-addons.css +15 -0
- package/src/styles/less/neptune-core.css +250 -526
- package/src/styles/less/neptune.bundle.less +4 -0
- package/src/styles/less/neptune.css +2759 -1422
- package/src/styles/less/popovers.css +35 -60
- package/src/styles/less/popovers.less +3 -3
- package/src/styles/less/sequences.css +6 -1
- package/src/styles/less/sequences.less +7 -2
- package/src/styles/less/tooltip.css +27 -7
- package/src/styles/less/tooltip.less +1 -1
- package/src/Snackbar/Snackbar.test.tsx +0 -190
|
@@ -89,10 +89,10 @@ function SelectInputBottomSheet({
|
|
|
89
89
|
}), /*#__PURE__*/jsxs("div", {
|
|
90
90
|
className: clsx('np-bottom-sheet-v2-content-inner', title && 'np-bottom-sheet-v2-content-inner--has-title', padding === 'md' && 'np-bottom-sheet-v2-content-inner--padding-md'),
|
|
91
91
|
children: [title ? /*#__PURE__*/jsx("h2", {
|
|
92
|
-
className: "np-bottom-sheet-v2-title
|
|
92
|
+
className: "np-bottom-sheet-v2-title wds-text-title-body",
|
|
93
93
|
children: title
|
|
94
94
|
}) : null, /*#__PURE__*/jsx("div", {
|
|
95
|
-
className: "np-bottom-sheet-v2-body
|
|
95
|
+
className: "np-bottom-sheet-v2-body wds-text-body-default",
|
|
96
96
|
children: children
|
|
97
97
|
})]
|
|
98
98
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputBottomSheet.mjs","sources":["../../../../src/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx"],"sourcesContent":["import {\n FloatingFocusManager,\n FloatingPortal,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition, TransitionChild } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { Fragment, useState } from 'react';\n\nimport { CloseButton } from '../../../common/CloseButton';\nimport { useVirtualKeyboard } from '../../../common/hooks/useVirtualKeyboard';\nimport { PreventScroll } from '../../../common/PreventScroll/PreventScroll';\nimport { Size } from '../../../common/PropsValues/size';\n\nexport interface SelectInputBottomSheetProps {\n open: boolean;\n renderTrigger?: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n initialFocusRef?: React.MutableRefObject<HTMLElement | null>;\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nexport function SelectInputBottomSheet({\n open,\n renderTrigger,\n title,\n initialFocusRef,\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: SelectInputBottomSheetProps) {\n useVirtualKeyboard(open);\n\n const { refs, context } = useFloating<Element>({\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss, role]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {/* eslint-disable react-hooks/refs -- setReference is a callback ref from floating-ui, safe to pass during render */}\n {renderTrigger?.({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n {/* eslint-enable react-hooks/refs */}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n as=\"div\"\n show={open}\n className=\"np-bottom-sheet-v2-container\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <TransitionChild\n as=\"div\"\n className=\"np-bottom-sheet-v2-backdrop\"\n enterFrom=\"np-bottom-sheet-v2-backdrop--closed\"\n leaveTo=\"np-bottom-sheet-v2-backdrop--closed\"\n />\n\n <div className=\"np-bottom-sheet-v2\">\n <FocusScope>\n <FloatingFocusManager context={context} initialFocus={initialFocusRef}>\n <Fragment\n key={floatingKey} // Force inner state invalidation on open\n >\n {/* eslint-disable react-hooks/refs -- setFloating is a callback ref from floating-ui, safe to pass during render */}\n <TransitionChild\n ref={refs.setFloating}\n as=\"div\"\n className=\"np-bottom-sheet-v2-content\"\n enterFrom=\"np-bottom-sheet-v2-content--closed\"\n leaveTo=\"np-bottom-sheet-v2-content--closed\"\n {...getFloatingProps()}\n >\n {/* eslint-enable react-hooks/refs */}\n <div className=\"np-bottom-sheet-v2-header\">\n <CloseButton\n size={Size.SMALL}\n onClick={() => {\n onClose?.();\n }}\n />\n </div>\n <div\n className={clsx(\n 'np-bottom-sheet-v2-content-inner',\n title && 'np-bottom-sheet-v2-content-inner--has-title',\n padding === 'md' && 'np-bottom-sheet-v2-content-inner--padding-md',\n )}\n >\n {title ? (\n <h2 className=\"np-bottom-sheet-v2-title
|
|
1
|
+
{"version":3,"file":"SelectInputBottomSheet.mjs","sources":["../../../../src/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx"],"sourcesContent":["import {\n FloatingFocusManager,\n FloatingPortal,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition, TransitionChild } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { Fragment, useState } from 'react';\n\nimport { CloseButton } from '../../../common/CloseButton';\nimport { useVirtualKeyboard } from '../../../common/hooks/useVirtualKeyboard';\nimport { PreventScroll } from '../../../common/PreventScroll/PreventScroll';\nimport { Size } from '../../../common/PropsValues/size';\n\nexport interface SelectInputBottomSheetProps {\n open: boolean;\n renderTrigger?: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n initialFocusRef?: React.MutableRefObject<HTMLElement | null>;\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nexport function SelectInputBottomSheet({\n open,\n renderTrigger,\n title,\n initialFocusRef,\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: SelectInputBottomSheetProps) {\n useVirtualKeyboard(open);\n\n const { refs, context } = useFloating<Element>({\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss, role]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {/* eslint-disable react-hooks/refs -- setReference is a callback ref from floating-ui, safe to pass during render */}\n {renderTrigger?.({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n {/* eslint-enable react-hooks/refs */}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n as=\"div\"\n show={open}\n className=\"np-bottom-sheet-v2-container\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <TransitionChild\n as=\"div\"\n className=\"np-bottom-sheet-v2-backdrop\"\n enterFrom=\"np-bottom-sheet-v2-backdrop--closed\"\n leaveTo=\"np-bottom-sheet-v2-backdrop--closed\"\n />\n\n <div className=\"np-bottom-sheet-v2\">\n <FocusScope>\n <FloatingFocusManager context={context} initialFocus={initialFocusRef}>\n <Fragment\n key={floatingKey} // Force inner state invalidation on open\n >\n {/* eslint-disable react-hooks/refs -- setFloating is a callback ref from floating-ui, safe to pass during render */}\n <TransitionChild\n ref={refs.setFloating}\n as=\"div\"\n className=\"np-bottom-sheet-v2-content\"\n enterFrom=\"np-bottom-sheet-v2-content--closed\"\n leaveTo=\"np-bottom-sheet-v2-content--closed\"\n {...getFloatingProps()}\n >\n {/* eslint-enable react-hooks/refs */}\n <div className=\"np-bottom-sheet-v2-header\">\n <CloseButton\n size={Size.SMALL}\n onClick={() => {\n onClose?.();\n }}\n />\n </div>\n <div\n className={clsx(\n 'np-bottom-sheet-v2-content-inner',\n title && 'np-bottom-sheet-v2-content-inner--has-title',\n padding === 'md' && 'np-bottom-sheet-v2-content-inner--padding-md',\n )}\n >\n {title ? (\n <h2 className=\"np-bottom-sheet-v2-title wds-text-title-body\">{title}</h2>\n ) : null}\n <div className=\"np-bottom-sheet-v2-body wds-text-body-default\">\n {children}\n </div>\n </div>\n </TransitionChild>\n </Fragment>\n </FloatingFocusManager>\n </FocusScope>\n </div>\n </Transition>\n </ThemeProvider>\n </FloatingPortal>\n </>\n );\n}\n"],"names":["SelectInputBottomSheet","open","renderTrigger","title","initialFocusRef","padding","children","onClose","onCloseEnd","useVirtualKeyboard","refs","context","useFloating","onOpenChange","value","dismiss","useDismiss","role","useRole","getReferenceProps","getFloatingProps","useInteractions","floatingKey","setFloatingKey","useState","theme","screenMode","useTheme","_jsxs","_Fragment","_jsx","PreventScroll","ref","setReference","getInteractionProps","FloatingPortal","ThemeProvider","Transition","as","show","className","beforeEnter","prev","afterLeave","TransitionChild","enterFrom","leaveTo","FocusScope","FloatingFocusManager","initialFocus","Fragment","setFloating","CloseButton","size","Size","SMALL","onClick","clsx"],"mappings":";;;;;;;;;;;;AAmCM,SAAUA,sBAAsBA,CAAC;EACrCC,IAAI;EACJC,aAAa;EACbC,KAAK;EACLC,eAAe;AACfC,EAAAA,OAAO,GAAG,IAAI;EACdC,QAAQ;EACRC,OAAO;AACPC,EAAAA;AAAU,CACkB,EAAA;EAC5BC,kBAAkB,CAACR,IAAI,CAAC;EAExB,MAAM;IAAES,IAAI;AAAEC,IAAAA;GAAS,GAAGC,WAAW,CAAU;IAC7CX,IAAI;IACJY,YAAY,EAAGC,KAAK,IAAI;MACtB,IAAI,CAACA,KAAK,EAAE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vE,IAAI,eACR2B,GAAA,CAAA,KAAA,EAAA;AAAKU,wBAAAA,SAAS,EAAC,+CAA+C;AAAAlC,wBAAAA,QAAA,EAC3DA;AAAQ,uBACN,CACP;AAAA,qBAAK,CACP;mBAAiB;AACnB,iBAAA,EAnCOgB,WAmCG;eACU;aACZ;AACd,WAAK,CACP;SAAY;OACC;AACjB,KAAgB,CAClB;AAAA,GAAA,CAAG;AAEP;;"}
|
|
@@ -23,7 +23,7 @@ function SelectInputOption({
|
|
|
23
23
|
className: ({
|
|
24
24
|
active,
|
|
25
25
|
disabled: uiDisabled
|
|
26
|
-
}) => clsx.clsx('np-select-input-option-container
|
|
26
|
+
}) => clsx.clsx('np-select-input-option-container wds-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
|
|
27
27
|
children: ({
|
|
28
28
|
selected
|
|
29
29
|
}) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOption.js","sources":["../../../../src/Inputs/SelectInput/Option/SelectInputOption.tsx"],"sourcesContent":["import { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { ListboxOption } from '@headlessui/react';\nimport {\n SelectInputItemsCountContext,\n SelectInputItemPositionContext,\n} from '../SelectInput.contexts';\n\nexport interface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * A selectable option in a SelectInput dropdown.\n * Includes accessibility support and styling for selected, active, and disabled states.\n */\nexport function SelectInputOption<T = string>({\n value,\n disabled,\n children,\n}: SelectInputOptionProps<T>) {\n const itemsCount = useContext(SelectInputItemsCountContext);\n const itemPosition = useContext(SelectInputItemPositionContext);\n\n return (\n <ListboxOption\n as=\"div\"\n value={value}\n aria-setsize={itemsCount}\n aria-posinset={itemPosition}\n disabled={disabled}\n className={({ active, disabled: uiDisabled }) =>\n clsx(\n 'np-select-input-option-container
|
|
1
|
+
{"version":3,"file":"SelectInputOption.js","sources":["../../../../src/Inputs/SelectInput/Option/SelectInputOption.tsx"],"sourcesContent":["import { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { ListboxOption } from '@headlessui/react';\nimport {\n SelectInputItemsCountContext,\n SelectInputItemPositionContext,\n} from '../SelectInput.contexts';\n\nexport interface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * A selectable option in a SelectInput dropdown.\n * Includes accessibility support and styling for selected, active, and disabled states.\n */\nexport function SelectInputOption<T = string>({\n value,\n disabled,\n children,\n}: SelectInputOptionProps<T>) {\n const itemsCount = useContext(SelectInputItemsCountContext);\n const itemPosition = useContext(SelectInputItemPositionContext);\n\n return (\n <ListboxOption\n as=\"div\"\n value={value}\n aria-setsize={itemsCount}\n aria-posinset={itemPosition}\n disabled={disabled}\n className={({ active, disabled: uiDisabled }) =>\n clsx(\n 'np-select-input-option-container wds-text-body-large',\n active && 'np-select-input-option-container--active',\n uiDisabled && 'np-select-input-option-container--disabled',\n )\n }\n >\n {({ selected }) => (\n <>\n <div className=\"np-select-input-option\">{children}</div>\n <Check\n size={16}\n className={clsx(\n 'np-select-input-option-check',\n !selected && 'np-select-input-option-check--not-selected',\n )}\n />\n </>\n )}\n </ListboxOption>\n );\n}\n"],"names":["SelectInputOption","value","disabled","children","itemsCount","useContext","SelectInputItemsCountContext","itemPosition","SelectInputItemPositionContext","_jsx","ListboxOption","as","className","active","uiDisabled","clsx","selected","_jsxs","_Fragment","Check","size"],"mappings":";;;;;;;;;AAmBM,SAAUA,iBAAiBA,CAAa;EAC5CC,KAAK;EACLC,QAAQ;AACRC,EAAAA;AAAQ,CACkB,EAAA;AAC1B,EAAA,MAAMC,UAAU,GAAGC,gBAAU,CAACC,iDAA4B,CAAC;AAC3D,EAAA,MAAMC,YAAY,GAAGF,gBAAU,CAACG,mDAA8B,CAAC;EAE/D,oBACEC,cAAA,CAACC,mBAAa,EAAA;AACZC,IAAAA,EAAE,EAAC,KAAK;AACRV,IAAAA,KAAK,EAAEA,KAAM;AACb,IAAA,cAAA,EAAcG,UAAW;AACzB,IAAA,eAAA,EAAeG,YAAa;AAC5BL,IAAAA,QAAQ,EAAEA,QAAS;AACnBU,IAAAA,SAAS,EAAEA,CAAC;MAAEC,MAAM;AAAEX,MAAAA,QAAQ,EAAEY;AAAU,KAAE,KAC1CC,SAAI,CACF,sDAAsD,EACtDF,MAAM,IAAI,0CAA0C,EACpDC,UAAU,IAAI,4CAA4C,CAE7D;AAAAX,IAAAA,QAAA,EAEAA,CAAC;AAAEa,MAAAA;KAAU,kBACZC,eAAA,CAAAC,mBAAA,EAAA;AAAAf,MAAAA,QAAA,gBACEM,cAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,SAAS,EAAC,wBAAwB;AAAAT,QAAAA,QAAA,EAAEA;AAAQ,OAAM,CACvD,eAAAM,cAAA,CAACU,WAAK,EAAA;AACJC,QAAAA,IAAI,EAAE,EAAG;QACTR,SAAS,EAAEG,SAAI,CACb,8BAA8B,EAC9B,CAACC,QAAQ,IAAI,4CAA4C;AACzD,OAAA,CAEN;KAAA;AACD,GACY,CAAC;AAEpB;;"}
|
|
@@ -21,7 +21,7 @@ function SelectInputOption({
|
|
|
21
21
|
className: ({
|
|
22
22
|
active,
|
|
23
23
|
disabled: uiDisabled
|
|
24
|
-
}) => clsx('np-select-input-option-container
|
|
24
|
+
}) => clsx('np-select-input-option-container wds-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
|
|
25
25
|
children: ({
|
|
26
26
|
selected
|
|
27
27
|
}) => /*#__PURE__*/jsxs(Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOption.mjs","sources":["../../../../src/Inputs/SelectInput/Option/SelectInputOption.tsx"],"sourcesContent":["import { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { ListboxOption } from '@headlessui/react';\nimport {\n SelectInputItemsCountContext,\n SelectInputItemPositionContext,\n} from '../SelectInput.contexts';\n\nexport interface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * A selectable option in a SelectInput dropdown.\n * Includes accessibility support and styling for selected, active, and disabled states.\n */\nexport function SelectInputOption<T = string>({\n value,\n disabled,\n children,\n}: SelectInputOptionProps<T>) {\n const itemsCount = useContext(SelectInputItemsCountContext);\n const itemPosition = useContext(SelectInputItemPositionContext);\n\n return (\n <ListboxOption\n as=\"div\"\n value={value}\n aria-setsize={itemsCount}\n aria-posinset={itemPosition}\n disabled={disabled}\n className={({ active, disabled: uiDisabled }) =>\n clsx(\n 'np-select-input-option-container
|
|
1
|
+
{"version":3,"file":"SelectInputOption.mjs","sources":["../../../../src/Inputs/SelectInput/Option/SelectInputOption.tsx"],"sourcesContent":["import { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { ListboxOption } from '@headlessui/react';\nimport {\n SelectInputItemsCountContext,\n SelectInputItemPositionContext,\n} from '../SelectInput.contexts';\n\nexport interface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * A selectable option in a SelectInput dropdown.\n * Includes accessibility support and styling for selected, active, and disabled states.\n */\nexport function SelectInputOption<T = string>({\n value,\n disabled,\n children,\n}: SelectInputOptionProps<T>) {\n const itemsCount = useContext(SelectInputItemsCountContext);\n const itemPosition = useContext(SelectInputItemPositionContext);\n\n return (\n <ListboxOption\n as=\"div\"\n value={value}\n aria-setsize={itemsCount}\n aria-posinset={itemPosition}\n disabled={disabled}\n className={({ active, disabled: uiDisabled }) =>\n clsx(\n 'np-select-input-option-container wds-text-body-large',\n active && 'np-select-input-option-container--active',\n uiDisabled && 'np-select-input-option-container--disabled',\n )\n }\n >\n {({ selected }) => (\n <>\n <div className=\"np-select-input-option\">{children}</div>\n <Check\n size={16}\n className={clsx(\n 'np-select-input-option-check',\n !selected && 'np-select-input-option-check--not-selected',\n )}\n />\n </>\n )}\n </ListboxOption>\n );\n}\n"],"names":["SelectInputOption","value","disabled","children","itemsCount","useContext","SelectInputItemsCountContext","itemPosition","SelectInputItemPositionContext","_jsx","ListboxOption","as","className","active","uiDisabled","clsx","selected","_jsxs","_Fragment","Check","size"],"mappings":";;;;;;;AAmBM,SAAUA,iBAAiBA,CAAa;EAC5CC,KAAK;EACLC,QAAQ;AACRC,EAAAA;AAAQ,CACkB,EAAA;AAC1B,EAAA,MAAMC,UAAU,GAAGC,UAAU,CAACC,4BAA4B,CAAC;AAC3D,EAAA,MAAMC,YAAY,GAAGF,UAAU,CAACG,8BAA8B,CAAC;EAE/D,oBACEC,GAAA,CAACC,aAAa,EAAA;AACZC,IAAAA,EAAE,EAAC,KAAK;AACRV,IAAAA,KAAK,EAAEA,KAAM;AACb,IAAA,cAAA,EAAcG,UAAW;AACzB,IAAA,eAAA,EAAeG,YAAa;AAC5BL,IAAAA,QAAQ,EAAEA,QAAS;AACnBU,IAAAA,SAAS,EAAEA,CAAC;MAAEC,MAAM;AAAEX,MAAAA,QAAQ,EAAEY;AAAU,KAAE,KAC1CC,IAAI,CACF,sDAAsD,EACtDF,MAAM,IAAI,0CAA0C,EACpDC,UAAU,IAAI,4CAA4C,CAE7D;AAAAX,IAAAA,QAAA,EAEAA,CAAC;AAAEa,MAAAA;KAAU,kBACZC,IAAA,CAAAC,QAAA,EAAA;AAAAf,MAAAA,QAAA,gBACEM,GAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,SAAS,EAAC,wBAAwB;AAAAT,QAAAA,QAAA,EAAEA;AAAQ,OAAM,CACvD,eAAAM,GAAA,CAACU,KAAK,EAAA;AACJC,QAAAA,IAAI,EAAE,EAAG;QACTR,SAAS,EAAEG,IAAI,CACb,8BAA8B,EAC9B,CAACC,QAAQ,IAAI,4CAA4C;AACzD,OAAA,CAEN;KAAA;AACD,GACY,CAAC;AAEpB;;"}
|
|
@@ -14,7 +14,7 @@ function SelectInputOptionContent({
|
|
|
14
14
|
}) {
|
|
15
15
|
const withinTrigger = React.useContext(SelectInput_contexts.SelectInputOptionContentWithinTriggerContext);
|
|
16
16
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
17
|
-
className: clsx.clsx('np-select-input-option-content-container', (note || description) && '
|
|
17
|
+
className: clsx.clsx('np-select-input-option-content-container', (note || description) && 'wds-text-body-large', className),
|
|
18
18
|
children: [icon ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
19
19
|
className: clsx.clsx('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
|
|
20
20
|
children: icon
|
|
@@ -26,11 +26,11 @@ function SelectInputOptionContent({
|
|
|
26
26
|
className: "d-inline np-select-input-option-content-title",
|
|
27
27
|
children: title
|
|
28
28
|
}), note ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
29
|
-
className: "np-select-input-option-content-text-secondary
|
|
29
|
+
className: "np-select-input-option-content-text-secondary wds-text-body-default",
|
|
30
30
|
children: note
|
|
31
31
|
}) : null]
|
|
32
32
|
}), description ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
33
|
-
className: clsx.clsx('np-select-input-option-content-text-secondary
|
|
33
|
+
className: clsx.clsx('np-select-input-option-content-text-secondary wds-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger'),
|
|
34
34
|
children: description
|
|
35
35
|
}) : null]
|
|
36
36
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOptionContent.js","sources":["../../../../src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { SelectInputOptionContentWithinTriggerContext } from '../SelectInput.contexts';\n\nexport interface SelectInputOptionContentProps {\n title: React.ReactNode;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n className?: string;\n}\n\n/**\n * Component for rendering structured content within a SelectInput option.\n * Supports title, optional note, description, and icon with different styling\n * based on whether it's rendered within the trigger button or the dropdown.\n */\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n className,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && '
|
|
1
|
+
{"version":3,"file":"SelectInputOptionContent.js","sources":["../../../../src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { SelectInputOptionContentWithinTriggerContext } from '../SelectInput.contexts';\n\nexport interface SelectInputOptionContentProps {\n title: React.ReactNode;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n className?: string;\n}\n\n/**\n * Component for rendering structured content within a SelectInput option.\n * Supports title, optional note, description, and icon with different styling\n * based on whether it's rendered within the trigger button or the dropdown.\n */\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n className,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && 'wds-text-body-large',\n className,\n )}\n >\n {icon ? (\n <div\n className={clsx(\n 'np-select-input-option-content-icon',\n !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger',\n )}\n >\n {icon}\n </div>\n ) : null}\n\n <div className=\"np-select-input-option-content-text\">\n <div\n className={clsx(\n 'np-select-input-option-content-text-line-1',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n <div className=\"d-inline np-select-input-option-content-title\">{title}</div>\n {note ? (\n <span className=\"np-select-input-option-content-text-secondary wds-text-body-default\">\n {note}\n </span>\n ) : null}\n </div>\n\n {description ? (\n <div\n className={clsx(\n 'np-select-input-option-content-text-secondary wds-text-body-default',\n withinTrigger &&\n 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger',\n )}\n >\n {description}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["SelectInputOptionContent","title","note","description","icon","className","withinTrigger","useContext","SelectInputOptionContentWithinTriggerContext","_jsxs","clsx","children","_jsx"],"mappings":";;;;;;;AAiBM,SAAUA,wBAAwBA,CAAC;EACvCC,KAAK;EACLC,IAAI;EACJC,WAAW;EACXC,IAAI;AACJC,EAAAA;AAAS,CACqB,EAAA;AAC9B,EAAA,MAAMC,aAAa,GAAGC,gBAAU,CAACC,iEAA4C,CAAC;AAE9E,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,SAAS,EAAEK,SAAI,CACb,0CAA0C,EAC1C,CAACR,IAAI,IAAIC,WAAW,KAAK,qBAAqB,EAC9CE,SAAS,CACT;IAAAM,QAAA,EAAA,CAEDP,IAAI,gBACHQ,cAAA,CAAA,KAAA,EAAA;MACEP,SAAS,EAAEK,SAAI,CACb,qCAAqC,EACrC,CAACJ,aAAa,IAAI,yDAAyD,CAC3E;AAAAK,MAAAA,QAAA,EAEDP;AAAI,KACF,CAAC,GACJ,IAAI,eAERK,eAAA,CAAA,KAAA,EAAA;AAAKJ,MAAAA,SAAS,EAAC,qCAAqC;AAAAM,MAAAA,QAAA,gBAClDF,eAAA,CAAA,KAAA,EAAA;QACEJ,SAAS,EAAEK,SAAI,CACb,4CAA4C,EAC5CJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,gBAEFC,cAAA,CAAA,KAAA,EAAA;AAAKP,UAAAA,SAAS,EAAC,+CAA+C;AAAAM,UAAAA,QAAA,EAAEV;AAAK,SAAM,CAC3E,EAACC,IAAI,gBACHU,cAAA,CAAA,MAAA,EAAA;AAAMP,UAAAA,SAAS,EAAC,qEAAqE;AAAAM,UAAAA,QAAA,EAClFT;SACG,CAAC,GACL,IAAI;AAAA,OACL,CAEL,EAACC,WAAW,gBACVS,cAAA,CAAA,KAAA,EAAA;QACEP,SAAS,EAAEK,SAAI,CACb,qEAAqE,EACrEJ,aAAa,IACX,kGAAkG,CACpG;AAAAK,QAAAA,QAAA,EAEDR;OACE,CAAC,GACJ,IAAI;AAAA,KACL,CACP;AAAA,GAAK,CAAC;AAEV;;"}
|
|
@@ -12,7 +12,7 @@ function SelectInputOptionContent({
|
|
|
12
12
|
}) {
|
|
13
13
|
const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);
|
|
14
14
|
return /*#__PURE__*/jsxs("div", {
|
|
15
|
-
className: clsx('np-select-input-option-content-container', (note || description) && '
|
|
15
|
+
className: clsx('np-select-input-option-content-container', (note || description) && 'wds-text-body-large', className),
|
|
16
16
|
children: [icon ? /*#__PURE__*/jsx("div", {
|
|
17
17
|
className: clsx('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
|
|
18
18
|
children: icon
|
|
@@ -24,11 +24,11 @@ function SelectInputOptionContent({
|
|
|
24
24
|
className: "d-inline np-select-input-option-content-title",
|
|
25
25
|
children: title
|
|
26
26
|
}), note ? /*#__PURE__*/jsx("span", {
|
|
27
|
-
className: "np-select-input-option-content-text-secondary
|
|
27
|
+
className: "np-select-input-option-content-text-secondary wds-text-body-default",
|
|
28
28
|
children: note
|
|
29
29
|
}) : null]
|
|
30
30
|
}), description ? /*#__PURE__*/jsx("div", {
|
|
31
|
-
className: clsx('np-select-input-option-content-text-secondary
|
|
31
|
+
className: clsx('np-select-input-option-content-text-secondary wds-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger'),
|
|
32
32
|
children: description
|
|
33
33
|
}) : null]
|
|
34
34
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOptionContent.mjs","sources":["../../../../src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { SelectInputOptionContentWithinTriggerContext } from '../SelectInput.contexts';\n\nexport interface SelectInputOptionContentProps {\n title: React.ReactNode;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n className?: string;\n}\n\n/**\n * Component for rendering structured content within a SelectInput option.\n * Supports title, optional note, description, and icon with different styling\n * based on whether it's rendered within the trigger button or the dropdown.\n */\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n className,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && '
|
|
1
|
+
{"version":3,"file":"SelectInputOptionContent.mjs","sources":["../../../../src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { SelectInputOptionContentWithinTriggerContext } from '../SelectInput.contexts';\n\nexport interface SelectInputOptionContentProps {\n title: React.ReactNode;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n className?: string;\n}\n\n/**\n * Component for rendering structured content within a SelectInput option.\n * Supports title, optional note, description, and icon with different styling\n * based on whether it's rendered within the trigger button or the dropdown.\n */\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n className,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && 'wds-text-body-large',\n className,\n )}\n >\n {icon ? (\n <div\n className={clsx(\n 'np-select-input-option-content-icon',\n !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger',\n )}\n >\n {icon}\n </div>\n ) : null}\n\n <div className=\"np-select-input-option-content-text\">\n <div\n className={clsx(\n 'np-select-input-option-content-text-line-1',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n <div className=\"d-inline np-select-input-option-content-title\">{title}</div>\n {note ? (\n <span className=\"np-select-input-option-content-text-secondary wds-text-body-default\">\n {note}\n </span>\n ) : null}\n </div>\n\n {description ? (\n <div\n className={clsx(\n 'np-select-input-option-content-text-secondary wds-text-body-default',\n withinTrigger &&\n 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger',\n )}\n >\n {description}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["SelectInputOptionContent","title","note","description","icon","className","withinTrigger","useContext","SelectInputOptionContentWithinTriggerContext","_jsxs","clsx","children","_jsx"],"mappings":";;;;;AAiBM,SAAUA,wBAAwBA,CAAC;EACvCC,KAAK;EACLC,IAAI;EACJC,WAAW;EACXC,IAAI;AACJC,EAAAA;AAAS,CACqB,EAAA;AAC9B,EAAA,MAAMC,aAAa,GAAGC,UAAU,CAACC,4CAA4C,CAAC;AAE9E,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,SAAS,EAAEK,IAAI,CACb,0CAA0C,EAC1C,CAACR,IAAI,IAAIC,WAAW,KAAK,qBAAqB,EAC9CE,SAAS,CACT;IAAAM,QAAA,EAAA,CAEDP,IAAI,gBACHQ,GAAA,CAAA,KAAA,EAAA;MACEP,SAAS,EAAEK,IAAI,CACb,qCAAqC,EACrC,CAACJ,aAAa,IAAI,yDAAyD,CAC3E;AAAAK,MAAAA,QAAA,EAEDP;AAAI,KACF,CAAC,GACJ,IAAI,eAERK,IAAA,CAAA,KAAA,EAAA;AAAKJ,MAAAA,SAAS,EAAC,qCAAqC;AAAAM,MAAAA,QAAA,gBAClDF,IAAA,CAAA,KAAA,EAAA;QACEJ,SAAS,EAAEK,IAAI,CACb,4CAA4C,EAC5CJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,gBAEFC,GAAA,CAAA,KAAA,EAAA;AAAKP,UAAAA,SAAS,EAAC,+CAA+C;AAAAM,UAAAA,QAAA,EAAEV;AAAK,SAAM,CAC3E,EAACC,IAAI,gBACHU,GAAA,CAAA,MAAA,EAAA;AAAMP,UAAAA,SAAS,EAAC,qEAAqE;AAAAM,UAAAA,QAAA,EAClFT;SACG,CAAC,GACL,IAAI;AAAA,OACL,CAEL,EAACC,WAAW,gBACVS,GAAA,CAAA,KAAA,EAAA;QACEP,SAAS,EAAEK,IAAI,CACb,qEAAqE,EACrEJ,aAAa,IACX,kGAAkG,CACpG;AAAAK,QAAAA,QAAA,EAEDR;OACE,CAAC,GACJ,IAAI;AAAA,KACL,CACP;AAAA,GAAK,CAAC;AAEV;;"}
|
|
@@ -95,10 +95,10 @@ function SelectInputPopover({
|
|
|
95
95
|
'np-popover-v2--padding-md': padding === 'md'
|
|
96
96
|
}),
|
|
97
97
|
children: [title ? /*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
98
|
-
className: "np-popover-v2-title
|
|
98
|
+
className: "np-popover-v2-title wds-text-title-body",
|
|
99
99
|
children: title
|
|
100
100
|
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
101
|
-
className: "np-popover-v2-content
|
|
101
|
+
className: "np-popover-v2-content wds-text-body-default",
|
|
102
102
|
children: children
|
|
103
103
|
})]
|
|
104
104
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputPopover.js","sources":["../../../../src/Inputs/SelectInput/Popover/SelectInputPopover.tsx"],"sourcesContent":["import {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n type Placement,\n shift,\n size as floatingSize,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useState } from 'react';\n\nimport { PreventScroll } from '../../../common/PreventScroll/PreventScroll';\n\nexport interface SelectInputPopoverProps {\n placement?: Placement;\n open: boolean;\n renderTrigger: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n size?: 'md' | 'lg';\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nconst FLOATING_PADDING = 16;\n\nexport function SelectInputPopover({\n placement,\n open,\n renderTrigger,\n title,\n size = 'md',\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: SelectInputPopoverProps) {\n const { refs, floatingStyles, context } = useFloating<Element>({\n strategy: 'fixed',\n placement,\n middleware: [\n offset(8),\n flip({ padding: FLOATING_PADDING, crossAxis: false }),\n shift(),\n floatingSize({\n padding: FLOATING_PADDING,\n apply: ({ elements, rects, availableHeight }) => {\n elements.floating.style.setProperty('--max-height', `${availableHeight}px`);\n elements.floating.style.setProperty('--width', `${rects.reference.width}px`);\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([role, dismiss]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {/* eslint-disable react-hooks/refs -- setReference is a callback ref from floating-ui, safe to pass during render */}\n {renderTrigger({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n {/* eslint-enable react-hooks/refs */}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n as=\"div\"\n show={open}\n leave=\"transition-opacity\"\n leaveTo=\"opacity-0\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <FocusScope>\n <FloatingFocusManager context={context}>\n {/* eslint-disable react-hooks/refs -- setFloating is a callback ref from floating-ui, safe to pass during render */}\n <div\n key={floatingKey} // Force inner state invalidation on open\n ref={refs.setFloating}\n className={clsx('np-popover-v2-container', {\n 'np-popover-v2-container--size-md': size === 'md',\n 'np-popover-v2-container--size-lg': size === 'lg',\n })}\n style={floatingStyles}\n {...getFloatingProps()}\n >\n {/* eslint-enable react-hooks/refs */}\n <div\n className={clsx('np-popover-v2', title && 'np-popover-v2--has-title', {\n 'np-popover-v2--padding-md': padding === 'md',\n })}\n >\n {title ? (\n <h2 className=\"np-popover-v2-title
|
|
1
|
+
{"version":3,"file":"SelectInputPopover.js","sources":["../../../../src/Inputs/SelectInput/Popover/SelectInputPopover.tsx"],"sourcesContent":["import {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n type Placement,\n shift,\n size as floatingSize,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useState } from 'react';\n\nimport { PreventScroll } from '../../../common/PreventScroll/PreventScroll';\n\nexport interface SelectInputPopoverProps {\n placement?: Placement;\n open: boolean;\n renderTrigger: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n size?: 'md' | 'lg';\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nconst FLOATING_PADDING = 16;\n\nexport function SelectInputPopover({\n placement,\n open,\n renderTrigger,\n title,\n size = 'md',\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: SelectInputPopoverProps) {\n const { refs, floatingStyles, context } = useFloating<Element>({\n strategy: 'fixed',\n placement,\n middleware: [\n offset(8),\n flip({ padding: FLOATING_PADDING, crossAxis: false }),\n shift(),\n floatingSize({\n padding: FLOATING_PADDING,\n apply: ({ elements, rects, availableHeight }) => {\n elements.floating.style.setProperty('--max-height', `${availableHeight}px`);\n elements.floating.style.setProperty('--width', `${rects.reference.width}px`);\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([role, dismiss]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {/* eslint-disable react-hooks/refs -- setReference is a callback ref from floating-ui, safe to pass during render */}\n {renderTrigger({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n {/* eslint-enable react-hooks/refs */}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n as=\"div\"\n show={open}\n leave=\"transition-opacity\"\n leaveTo=\"opacity-0\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <FocusScope>\n <FloatingFocusManager context={context}>\n {/* eslint-disable react-hooks/refs -- setFloating is a callback ref from floating-ui, safe to pass during render */}\n <div\n key={floatingKey} // Force inner state invalidation on open\n ref={refs.setFloating}\n className={clsx('np-popover-v2-container', {\n 'np-popover-v2-container--size-md': size === 'md',\n 'np-popover-v2-container--size-lg': size === 'lg',\n })}\n style={floatingStyles}\n {...getFloatingProps()}\n >\n {/* eslint-enable react-hooks/refs */}\n <div\n className={clsx('np-popover-v2', title && 'np-popover-v2--has-title', {\n 'np-popover-v2--padding-md': padding === 'md',\n })}\n >\n {title ? (\n <h2 className=\"np-popover-v2-title wds-text-title-body\">{title}</h2>\n ) : null}\n <div className=\"np-popover-v2-content wds-text-body-default\">{children}</div>\n </div>\n </div>\n </FloatingFocusManager>\n </FocusScope>\n </Transition>\n </ThemeProvider>\n </FloatingPortal>\n </>\n );\n}\n"],"names":["FLOATING_PADDING","SelectInputPopover","placement","open","renderTrigger","title","size","padding","children","onClose","onCloseEnd","refs","floatingStyles","context","useFloating","strategy","middleware","offset","flip","crossAxis","shift","floatingSize","apply","elements","rects","availableHeight","floating","style","setProperty","reference","width","whileElementsMounted","autoUpdate","onOpenChange","value","dismiss","useDismiss","role","useRole","getReferenceProps","getFloatingProps","useInteractions","floatingKey","setFloatingKey","useState","theme","screenMode","useTheme","_jsxs","_Fragment","_jsx","PreventScroll","ref","setReference","getInteractionProps","FloatingPortal","ThemeProvider","Transition","as","show","leave","leaveTo","beforeEnter","prev","afterLeave","FocusScope","FloatingFocusManager","setFloating","className","clsx"],"mappings":";;;;;;;;;;;AAuCA,MAAMA,gBAAgB,GAAG,EAAE;AAErB,SAAUC,kBAAkBA,CAAC;EACjCC,SAAS;EACTC,IAAI;EACJC,aAAa;EACbC,KAAK;AACLC,EAAAA,IAAI,GAAG,IAAI;AACXC,EAAAA,OAAO,GAAG,IAAI;EACdC,QAAQ;EACRC,OAAO;AACPC,EAAAA;AAAU,CACc,EAAA;EACxB,MAAM;IAAEC,IAAI;IAAEC,cAAc;AAAEC,IAAAA;GAAS,GAAGC,iBAAW,CAAU;AAC7DC,IAAAA,QAAQ,EAAE,OAAO;IACjBb,SAAS;IACTc,UAAU,EAAE,CACVC,YAAM,CAAC,CAAC,CAAC,EACTC,UAAI,CAAC;AAAEX,MAAAA,OAAO,EAAEP,gBAAgB;AAAEmB,MAAAA,SAAS,EAAE;AAAK,KAAE,CAAC,EACrDC,WAAK,EAAE,EACPC,UAAY,CAAC;AACXd,MAAAA,OAAO,EAAEP,gBAAgB;AACzBsB,MAAAA,KAAK,EAAEA,CAAC;QAAEC,QAAQ;QAAEC,KAAK;AAAEC,QAAAA;AAAe,OAAE,KAAI;AAC9CF,QAAAA,QAAQ,CAACG,QAAQ,CAACC,KAAK,CAACC,WAAW,CAAC,cAAc,EAAE,CAAA,EAAGH,eAAe,CAAA,EAAA,CAAI,CAAC;AAC3EF,QAAAA,QAAQ,CAACG,QAAQ,CAACC,KAAK,CAACC,WAAW,CAAC,SAAS,EAAE,CAAA,EAAGJ,KAAK,CA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ding === 'md'
|
|
94
94
|
}),
|
|
95
95
|
children: [title ? /*#__PURE__*/jsx("h2", {
|
|
96
|
-
className: "np-popover-v2-title
|
|
96
|
+
className: "np-popover-v2-title wds-text-title-body",
|
|
97
97
|
children: title
|
|
98
98
|
}) : null, /*#__PURE__*/jsx("div", {
|
|
99
|
-
className: "np-popover-v2-content
|
|
99
|
+
className: "np-popover-v2-content wds-text-body-default",
|
|
100
100
|
children: children
|
|
101
101
|
})]
|
|
102
102
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputPopover.mjs","sources":["../../../../src/Inputs/SelectInput/Popover/SelectInputPopover.tsx"],"sourcesContent":["import {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n type Placement,\n shift,\n size as floatingSize,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useState } from 'react';\n\nimport { PreventScroll } from '../../../common/PreventScroll/PreventScroll';\n\nexport interface SelectInputPopoverProps {\n placement?: Placement;\n open: boolean;\n renderTrigger: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n size?: 'md' | 'lg';\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nconst FLOATING_PADDING = 16;\n\nexport function SelectInputPopover({\n placement,\n open,\n renderTrigger,\n title,\n size = 'md',\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: SelectInputPopoverProps) {\n const { refs, floatingStyles, context } = useFloating<Element>({\n strategy: 'fixed',\n placement,\n middleware: [\n offset(8),\n flip({ padding: FLOATING_PADDING, crossAxis: false }),\n shift(),\n floatingSize({\n padding: FLOATING_PADDING,\n apply: ({ elements, rects, availableHeight }) => {\n elements.floating.style.setProperty('--max-height', `${availableHeight}px`);\n elements.floating.style.setProperty('--width', `${rects.reference.width}px`);\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([role, dismiss]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {/* eslint-disable react-hooks/refs -- setReference is a callback ref from floating-ui, safe to pass during render */}\n {renderTrigger({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n {/* eslint-enable react-hooks/refs */}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n as=\"div\"\n show={open}\n leave=\"transition-opacity\"\n leaveTo=\"opacity-0\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <FocusScope>\n <FloatingFocusManager context={context}>\n {/* eslint-disable react-hooks/refs -- setFloating is a callback ref from floating-ui, safe to pass during render */}\n <div\n key={floatingKey} // Force inner state invalidation on open\n ref={refs.setFloating}\n className={clsx('np-popover-v2-container', {\n 'np-popover-v2-container--size-md': size === 'md',\n 'np-popover-v2-container--size-lg': size === 'lg',\n })}\n style={floatingStyles}\n {...getFloatingProps()}\n >\n {/* eslint-enable react-hooks/refs */}\n <div\n className={clsx('np-popover-v2', title && 'np-popover-v2--has-title', {\n 'np-popover-v2--padding-md': padding === 'md',\n })}\n >\n {title ? (\n <h2 className=\"np-popover-v2-title
|
|
1
|
+
{"version":3,"file":"SelectInputPopover.mjs","sources":["../../../../src/Inputs/SelectInput/Popover/SelectInputPopover.tsx"],"sourcesContent":["import {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n type Placement,\n shift,\n size as floatingSize,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useState } from 'react';\n\nimport { PreventScroll } from '../../../common/PreventScroll/PreventScroll';\n\nexport interface SelectInputPopoverProps {\n placement?: Placement;\n open: boolean;\n renderTrigger: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n size?: 'md' | 'lg';\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nconst FLOATING_PADDING = 16;\n\nexport function SelectInputPopover({\n placement,\n open,\n renderTrigger,\n title,\n size = 'md',\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: SelectInputPopoverProps) {\n const { refs, floatingStyles, context } = useFloating<Element>({\n strategy: 'fixed',\n placement,\n middleware: [\n offset(8),\n flip({ padding: FLOATING_PADDING, crossAxis: false }),\n shift(),\n floatingSize({\n padding: FLOATING_PADDING,\n apply: ({ elements, rects, availableHeight }) => {\n elements.floating.style.setProperty('--max-height', `${availableHeight}px`);\n elements.floating.style.setProperty('--width', `${rects.reference.width}px`);\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([role, dismiss]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {/* eslint-disable react-hooks/refs -- setReference is a callback ref from floating-ui, safe to pass during render */}\n {renderTrigger({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n {/* eslint-enable react-hooks/refs */}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n as=\"div\"\n show={open}\n leave=\"transition-opacity\"\n leaveTo=\"opacity-0\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <FocusScope>\n <FloatingFocusManager context={context}>\n {/* eslint-disable react-hooks/refs -- setFloating is a callback ref from floating-ui, safe to pass during render */}\n <div\n key={floatingKey} // Force inner state invalidation on open\n ref={refs.setFloating}\n className={clsx('np-popover-v2-container', {\n 'np-popover-v2-container--size-md': size === 'md',\n 'np-popover-v2-container--size-lg': size === 'lg',\n })}\n style={floatingStyles}\n {...getFloatingProps()}\n >\n {/* eslint-enable react-hooks/refs */}\n <div\n className={clsx('np-popover-v2', title && 'np-popover-v2--has-title', {\n 'np-popover-v2--padding-md': padding === 'md',\n })}\n >\n {title ? (\n <h2 className=\"np-popover-v2-title wds-text-title-body\">{title}</h2>\n ) : null}\n <div className=\"np-popover-v2-content wds-text-body-default\">{children}</div>\n </div>\n </div>\n </FloatingFocusManager>\n </FocusScope>\n </Transition>\n </ThemeProvider>\n </FloatingPortal>\n </>\n );\n}\n"],"names":["FLOATING_PADDING","SelectInputPopover","placement","open","renderTrigger","title","size","padding","children","onClose","onCloseEnd","refs","floatingStyles","context","useFloating","strategy","middleware","offset","flip","crossAxis","shift","floatingSize","apply","elements","rects","availableHeight","floating","style","setProperty","reference","width","whileElementsMounted","autoUpdate","onOpenChange","value","dismiss","useDismiss","role","useRole","getReferenceProps","getFloatingProps","useInteractions","floatingKey","setFloatingKey","useState","theme","screenMode","useTheme","_jsxs","_Fragment","_jsx","PreventScroll","ref","setReference","getInteractionProps","FloatingPortal","ThemeProvider","Transition","as","show","leave","leaveTo","beforeEnter","prev","afterLeave","FocusScope","FloatingFocusManager","setFloating","className","clsx"],"mappings":";;;;;;;;;AAuCA,MAAMA,gBAAg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AACtBC,gBAAAA,SAAS,EAAEC,IAAI,CAAC,yBAAyB,EAAE;kBACzC,kCAAkC,EAAE/D,MAAI,KAAK,IAAI;kBACjD,kCAAkC,EAAEA,MAAI,KAAK;AAC9C,iBAAA,CAAE;AACHqB,gBAAAA,KAAK,EAAEf,cAAe;gBAAA,GAClB4B,gBAAgB,EAAE;AAAAhC,gBAAAA,QAAA,eAGtBwC,IAAA,CAAA,KAAA,EAAA;kBACEoB,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAEhE,KAAK,IAAI,0BAA0B,EAAE;oBACpE,2BAA2B,EAAEE,OAAO,KAAK;AAC1C,mBAAA,CAAE;kBAAAC,QAAA,EAAA,CAEFH,KAAK,gBACJ6C,GAAA,CAAA,IAAA,EAAA;AAAIkB,oBAAAA,SAAS,EAAC,yCAAyC;AAAA5D,oBAAAA,QAAA,EAAEH;AAAK,mBAAK,CAAC,GAClE,IAAI,eACR6C,GAAA,CAAA,KAAA,EAAA;AAAKkB,oBAAAA,SAAS,EAAC,6CAA6C;AAAA5D,oBAAAA,QAAA,EAAEA;AAAQ,mBAAM,CAC9E;iBAAK;AACP,eAAA,EApBOkC,WAoBF;aACe;WACZ;SACF;OACC;AACjB,KAAgB,CAClB;AAAA,GAAA,CAAG;AAEP;;"}
|
package/build/Label/Label.js
CHANGED
|
@@ -19,7 +19,7 @@ const Label = /*#__PURE__*/React.forwardRef(({
|
|
|
19
19
|
ref: ref,
|
|
20
20
|
id: id,
|
|
21
21
|
htmlFor: htmlFor,
|
|
22
|
-
className: clsx.clsx('np-label d-flex flex-column
|
|
22
|
+
className: clsx.clsx('np-label d-flex flex-column wds-text-body-default-bold text-primary m-b-0', className),
|
|
23
23
|
children: children
|
|
24
24
|
});
|
|
25
25
|
});
|
package/build/Label/Label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","sources":["../../src/Label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport messages from './Label.messages';\nimport { useIntl } from 'react-intl';\nimport Body from '../Body';\nimport { CommonProps } from '../common';\nimport { forwardRef, PropsWithChildren } from 'react';\n\nexport type LabelProps = {\n id?: string;\n htmlFor?: string;\n className?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Avoid using `<Label>` component directly\n * it's for edge cases when `<Field />` isn't suitable for some reasons.\n *\n * Example:\n * ```\n * <Field label={..} description={..} required={..}>..</Field>\n * ```\n */\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, children, htmlFor, id }: LabelProps, ref) => {\n return (\n <label\n ref={ref}\n id={id}\n htmlFor={htmlFor}\n className={clsx(\n 'np-label d-flex flex-column
|
|
1
|
+
{"version":3,"file":"Label.js","sources":["../../src/Label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport messages from './Label.messages';\nimport { useIntl } from 'react-intl';\nimport Body from '../Body';\nimport { CommonProps } from '../common';\nimport { forwardRef, PropsWithChildren } from 'react';\n\nexport type LabelProps = {\n id?: string;\n htmlFor?: string;\n className?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Avoid using `<Label>` component directly\n * it's for edge cases when `<Field />` isn't suitable for some reasons.\n *\n * Example:\n * ```\n * <Field label={..} description={..} required={..}>..</Field>\n * ```\n */\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, children, htmlFor, id }: LabelProps, ref) => {\n return (\n <label\n ref={ref}\n id={id}\n htmlFor={htmlFor}\n className={clsx(\n 'np-label d-flex flex-column wds-text-body-default-bold text-primary m-b-0',\n className,\n )}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type LabelOptionalProps = PropsWithChildren<CommonProps>;\n\nconst Optional = function Optional({ children, className }: LabelOptionalProps) {\n const { formatMessage } = useIntl();\n return (\n <div>\n {children}\n <Body as=\"span\" className={clsx('text-secondary', 'm-l-1', className)}>\n {formatMessage(messages.optionalLabel)}\n </Body>\n </div>\n );\n};\n\nexport type LabelDescriptionProps = PropsWithChildren<CommonProps> & { id?: string };\n\nconst Description = function Description({ id, children, className }: LabelDescriptionProps) {\n return children ? (\n <Body id={id} className={clsx('text-secondary', className)}>\n {children}\n </Body>\n ) : null;\n};\n\n// eslint-disable-next-line functional/immutable-data\nconst LabelNamespace = Object.assign(Label, { Optional, Description });\n\nLabelNamespace.displayName = 'Label';\nexport default LabelNamespace;\n"],"names":["Label","forwardRef","className","children","htmlFor","id","ref","_jsx","clsx","Optional","formatMessage","useIntl","_jsxs","Body","as","messages","optionalLabel","Description","LabelNamespace","Object","assign","displayName"],"mappings":";;;;;;;;;;;AAuBA,MAAMA,KAAK,gBAAGC,gBAAU,CACtB,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,OAAO;AAAEC,EAAAA;CAAgB,EAAEC,GAAG,KAAI;AACxD,EAAA,oBACEC,cAAA,CAAA,OAAA,EAAA;AACED,IAAAA,GAAG,EAAEA,GAAI;AACTD,IAAAA,EAAE,EAAEA,EAAG;AACPD,IAAAA,OAAO,EAAEA,OAAQ;AACjBF,IAAAA,SAAS,EAAEM,SAAI,CACb,2EAA2E,EAC3EN,SAAS,CACT;AAAAC,IAAAA,QAAA,EAEDA;AAAQ,GACJ,CAAC;AAEZ,CAAC,CACF;AAID,MAAMM,QAAQ,GAAG,SAASA,QAAQA,CAAC;EAAEN,QAAQ;AAAED,EAAAA;AAAS,CAAsB,EAAA;EAC5E,MAAM;AAAEQ,IAAAA;GAAe,GAAGC,iBAAO,EAAE;AACnC,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AAAAT,IAAAA,QAAA,EAAA,CACGA,QAAQ,eACTI,cAAA,CAACM,YAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACZ,SAAS,EAAEM,SAAI,CAAC,gBAAgB,EAAE,OAAO,EAAEN,SAAS,CAAE;AAAAC,MAAAA,QAAA,EACnEO,aAAa,CAACK,sBAAQ,CAACC,aAAa;AAAC,KAClC,CACR;AAAA,GAAK,CAAC;AAEV,CAAC;AAID,MAAMC,WAAW,GAAG,SAASA,WAAWA,CAAC;EAAEZ,EAAE;EAAEF,QAAQ;AAAED,EAAAA;AAAS,CAAyB,EAAA;AACzF,EAAA,OAAOC,QAAQ,gBACbI,cAAA,CAACM,YAAI,EAAA;AAACR,IAAAA,EAAE,EAAEA,EAAG;AAACH,IAAAA,SAAS,EAAEM,SAAI,CAAC,gBAAgB,EAAEN,SAAS,CAAE;AAAAC,IAAAA,QAAA,EACxDA;GACG,CAAC,GACL,IAAI;AACV,CAAC;AAED;AACA,MAAMe,cAAc,GAAGC,MAAM,CAACC,MAAM,CAACpB,KAAK,EAAE;EAAES,QAAQ;AAAEQ,EAAAA;AAAW,CAAE;AAErEC,cAAc,CAACG,WAAW,GAAG,OAAO;;"}
|
package/build/Label/Label.mjs
CHANGED
|
@@ -15,7 +15,7 @@ const Label = /*#__PURE__*/forwardRef(({
|
|
|
15
15
|
ref: ref,
|
|
16
16
|
id: id,
|
|
17
17
|
htmlFor: htmlFor,
|
|
18
|
-
className: clsx('np-label d-flex flex-column
|
|
18
|
+
className: clsx('np-label d-flex flex-column wds-text-body-default-bold text-primary m-b-0', className),
|
|
19
19
|
children: children
|
|
20
20
|
});
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.mjs","sources":["../../src/Label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport messages from './Label.messages';\nimport { useIntl } from 'react-intl';\nimport Body from '../Body';\nimport { CommonProps } from '../common';\nimport { forwardRef, PropsWithChildren } from 'react';\n\nexport type LabelProps = {\n id?: string;\n htmlFor?: string;\n className?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Avoid using `<Label>` component directly\n * it's for edge cases when `<Field />` isn't suitable for some reasons.\n *\n * Example:\n * ```\n * <Field label={..} description={..} required={..}>..</Field>\n * ```\n */\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, children, htmlFor, id }: LabelProps, ref) => {\n return (\n <label\n ref={ref}\n id={id}\n htmlFor={htmlFor}\n className={clsx(\n 'np-label d-flex flex-column
|
|
1
|
+
{"version":3,"file":"Label.mjs","sources":["../../src/Label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport messages from './Label.messages';\nimport { useIntl } from 'react-intl';\nimport Body from '../Body';\nimport { CommonProps } from '../common';\nimport { forwardRef, PropsWithChildren } from 'react';\n\nexport type LabelProps = {\n id?: string;\n htmlFor?: string;\n className?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Avoid using `<Label>` component directly\n * it's for edge cases when `<Field />` isn't suitable for some reasons.\n *\n * Example:\n * ```\n * <Field label={..} description={..} required={..}>..</Field>\n * ```\n */\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, children, htmlFor, id }: LabelProps, ref) => {\n return (\n <label\n ref={ref}\n id={id}\n htmlFor={htmlFor}\n className={clsx(\n 'np-label d-flex flex-column wds-text-body-default-bold text-primary m-b-0',\n className,\n )}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type LabelOptionalProps = PropsWithChildren<CommonProps>;\n\nconst Optional = function Optional({ children, className }: LabelOptionalProps) {\n const { formatMessage } = useIntl();\n return (\n <div>\n {children}\n <Body as=\"span\" className={clsx('text-secondary', 'm-l-1', className)}>\n {formatMessage(messages.optionalLabel)}\n </Body>\n </div>\n );\n};\n\nexport type LabelDescriptionProps = PropsWithChildren<CommonProps> & { id?: string };\n\nconst Description = function Description({ id, children, className }: LabelDescriptionProps) {\n return children ? (\n <Body id={id} className={clsx('text-secondary', className)}>\n {children}\n </Body>\n ) : null;\n};\n\n// eslint-disable-next-line functional/immutable-data\nconst LabelNamespace = Object.assign(Label, { Optional, Description });\n\nLabelNamespace.displayName = 'Label';\nexport default LabelNamespace;\n"],"names":["Label","forwardRef","className","children","htmlFor","id","ref","_jsx","clsx","Optional","formatMessage","useIntl","_jsxs","Body","as","messages","optionalLabel","Description","LabelNamespace","Object","assign","displayName"],"mappings":";;;;;;;AAuBA,MAAMA,KAAK,gBAAGC,UA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