@mittwald/flow-react-components 1.3.0-next.9 → 1.3.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/AGENTS.md +42 -1
- package/USAGE.md +14 -6
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_28.locale.mjs +10 -0
- package/dist/js/default.mjs +1 -2
- package/dist/js/flr-universal.mjs +1 -2
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +26 -15
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Accordion/Accordion.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Action/models/ActionModel.mjs +8 -25
- package/dist/js/packages/components/src/components/Action/models/ActionModel.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Avatar/Avatar.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Button/Button.module.mjs +1 -0
- package/dist/js/packages/components/src/components/Button/Button.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Calendar/Calendar.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Calendar/Calendar.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Calendar/components/CalendarHeader/CalendarHeader.mjs +19 -15
- package/dist/js/packages/components/src/components/Calendar/components/CalendarHeader/CalendarHeader.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs +4 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs +4 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Line/Line.mjs +4 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Line/Line.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useChartAnimation.mjs +27 -0
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useChartAnimation.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Chat/Chat.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.module.mjs +2 -1
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxGroup/CheckboxGroup.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs +31 -5
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.module.mjs +6 -4
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Combine/Combine.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs +2 -2
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs +2 -2
- package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/lib.mjs +3 -7
- package/dist/js/packages/components/src/components/ContextMenu/lib.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.mjs +14 -11
- package/dist/js/packages/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.module.mjs +4 -2
- package/dist/js/packages/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DonutChart/DonutChart.module.mjs +6 -3
- package/dist/js/packages/components/src/components/DonutChart/DonutChart.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DonutChart/components/DonutChartFill.mjs +13 -2
- package/dist/js/packages/components/src/components/DonutChart/components/DonutChartFill.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs +2 -2
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs.map +1 -1
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs +9 -6
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.module.mjs +5 -1
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LayoutCard/LayoutCard.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/LightBox.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Link/Link.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/List.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/Items.mjs +3 -6
- package/dist/js/packages/components/src/components/List/components/Items/Items.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Table/Table.mjs +6 -2
- package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/{components/Items/hooks → hooks}/useInfiniteScrollTrigger.mjs +11 -12
- package/dist/js/packages/components/src/components/List/hooks/useInfiniteScrollTrigger.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Markdown/Markdown.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/MarkdownEditor.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.mjs +4 -6
- package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/components/LinkListTunnelExit/LinkListTunnelExit.mjs +5 -1
- package/dist/js/packages/components/src/components/Navigation/components/LinkListTunnelExit/LinkListTunnelExit.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/components/NavigationGroup/NavigationGroup.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/NumberField/NumberField.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Overlay/Overlay.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Overlay/Overlay.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +47 -9
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/OverlayTrigger/OverlayTrigger.mjs +0 -1
- package/dist/js/packages/components/src/components/OverlayTrigger/OverlayTrigger.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +8 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs +2 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs +13 -7
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.module.mjs +9 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.module.mjs.map +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs +12 -4
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs +52 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs.map +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/usePolicyValidationResult.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/usePolicyValidationResult.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/Popover.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Popover/Popover.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs +2 -6
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs +2 -6
- package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/PopoverTip/PopoverTip.mjs +17 -0
- package/dist/js/packages/components/src/components/Popover/components/PopoverTip/PopoverTip.mjs.map +1 -0
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.module.mjs +1 -0
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/RadioGroup/components/Radio/Radio.module.mjs +2 -1
- package/dist/js/packages/components/src/components/RadioGroup/components/Radio/Radio.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/SearchField/SearchField.module.mjs +3 -3
- package/dist/js/packages/components/src/components/SearchField/SearchField.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/Section.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Slider/Slider.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Switch/Switch.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs +2 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.module.mjs +5 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/Table.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/components/TabTitle/TabTitle.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Text/Text.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +14 -13
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tooltip/Tooltip.mjs +1 -0
- package/dist/js/packages/components/src/components/Tooltip/Tooltip.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tooltip/Tooltip.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Tooltip/Tooltip.module.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/OverlayContextProvider.mjs +3 -6
- package/dist/js/packages/components/src/lib/controller/overlay/OverlayContextProvider.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/OverlayController.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/context.mjs +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/context.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/useOverlayController.mjs +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/useOverlayController.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/files/acceptedFiles.mjs +34 -0
- package/dist/js/packages/components/src/lib/files/acceptedFiles.mjs.map +1 -0
- package/dist/js/packages/components/src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.mjs +1 -1
- package/dist/js/packages/components/src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.mjs.map +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +12 -0
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +12 -0
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
- package/dist/types/components/Action/models/ActionModel.d.ts +4 -12
- package/dist/types/components/Action/types.d.ts +2 -9
- package/dist/types/components/CartesianChart/hooks/useChartAnimation.d.ts +1 -0
- package/dist/types/components/ContextMenu/lib.d.ts +1 -5
- package/dist/types/components/Icon/components/icons/index.d.ts +0 -1
- package/dist/types/components/List/hooks/useInfiniteScrollTrigger.d.ts +17 -0
- package/dist/types/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.d.ts +0 -7
- package/dist/types/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.d.ts +0 -9
- package/dist/types/components/PasswordCreationField/lib/ariaAnnounce.d.ts +1 -0
- package/dist/types/components/PasswordCreationField/lib/generateValidationTranslation.d.ts +0 -2
- package/dist/types/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.d.ts +0 -3
- package/dist/types/components/PasswordCreationField/lib/usePolicyValidationResult.d.ts +1 -7
- package/dist/types/components/Popover/components/PopoverTip/PopoverTip.d.ts +1 -2
- package/dist/types/lib/controller/overlay/OverlayContextProvider.d.ts +0 -9
- package/dist/types/lib/controller/overlay/OverlayController.d.ts +1 -11
- package/dist/types/lib/controller/overlay/context.d.ts +2 -19
- package/dist/types/lib/files/acceptedFiles.d.ts +1 -0
- package/dist/types/lib/hooks/dom/useKeepBrowserExtensionsInteractive.d.ts +1 -0
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts +14 -0
- package/package.json +10 -10
- package/dist/js/packages/components/src/components/Icon/components/icons/IconAIHosting.mjs +0 -19
- package/dist/js/packages/components/src/components/Icon/components/icons/IconAIHosting.mjs.map +0 -1
- package/dist/js/packages/components/src/components/List/components/Items/hooks/useInfiniteScrollTrigger.mjs.map +0 -1
- package/dist/types/components/Icon/components/icons/IconAIHosting.d.ts +0 -4
- package/dist/types/components/List/components/Items/hooks/useInfiniteScrollTrigger.d.ts +0 -3
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useLocalizedStringFormatter } from "../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
4
|
+
import __locale_default from "../../../../../../_virtual/_28.locale.mjs";
|
|
5
|
+
import { useEffect, useRef } from "react";
|
|
6
|
+
import { announce } from "@react-aria/live-announcer";
|
|
7
|
+
//#region src/components/PasswordCreationField/lib/ariaAnnounce.ts
|
|
8
|
+
/**
|
|
9
|
+
* Announces the current validation message — which rule the password misses, or
|
|
10
|
+
* that it is secure.
|
|
11
|
+
*
|
|
12
|
+
* The same text is wired to the field via `aria-describedby`, but a description
|
|
13
|
+
* is only read when the field receives focus. The field keeps focus while the
|
|
14
|
+
* password is typed, so without a live region a screen reader reports the field
|
|
15
|
+
* as invalid and never says why.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
var useAriaAnnounceValidationState = (text, isAnnounceable) => {
|
|
20
|
+
const lastAnnouncedText = useRef(void 0);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!isAnnounceable || !text) {
|
|
23
|
+
lastAnnouncedText.current = void 0;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (text === lastAnnouncedText.current) return;
|
|
27
|
+
lastAnnouncedText.current = text;
|
|
28
|
+
announce(text, "polite");
|
|
29
|
+
}, [text, isAnnounceable]);
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Announces that the password became visible or hidden. The toggle button keeps
|
|
33
|
+
* focus, and a screen reader does not report that the input switched between
|
|
34
|
+
* masked characters and plain text on its own.
|
|
35
|
+
*
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
var useAriaAnnouncePasswordVisibility = (isRevealed) => {
|
|
39
|
+
const formatter = useLocalizedStringFormatter(__locale_default, "PasswordCreationField");
|
|
40
|
+
const isInitialRender = useRef(true);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (isInitialRender.current) {
|
|
43
|
+
isInitialRender.current = false;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
announce(formatter.format(isRevealed ? "password.announce.revealed" : "password.announce.hidden"), "polite");
|
|
47
|
+
}, [isRevealed]);
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { useAriaAnnouncePasswordVisibility, useAriaAnnounceValidationState };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=ariaAnnounce.mjs.map
|
package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ariaAnnounce.mjs","names":[],"sources":["../../../../../../../../src/components/PasswordCreationField/lib/ariaAnnounce.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { announce } from \"@react-aria/live-announcer\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./../locales/*.locale.json\";\n\n/**\n * Announces the current validation message — which rule the password misses, or\n * that it is secure.\n *\n * The same text is wired to the field via `aria-describedby`, but a description\n * is only read when the field receives focus. The field keeps focus while the\n * password is typed, so without a live region a screen reader reports the field\n * as invalid and never says why.\n *\n * @internal\n */\nexport const useAriaAnnounceValidationState = (\n text: string | undefined,\n isAnnounceable: boolean,\n): void => {\n const lastAnnouncedText = useRef<string>(undefined);\n\n useEffect(() => {\n if (!isAnnounceable || !text) {\n // Announce the text again when it comes back after an empty field or a\n // pending validation.\n lastAnnouncedText.current = undefined;\n return;\n }\n\n if (text === lastAnnouncedText.current) {\n return;\n }\n\n lastAnnouncedText.current = text;\n announce(text, \"polite\");\n }, [text, isAnnounceable]);\n};\n\n/**\n * Announces that the password became visible or hidden. The toggle button keeps\n * focus, and a screen reader does not report that the input switched between\n * masked characters and plain text on its own.\n *\n * @internal\n */\nexport const useAriaAnnouncePasswordVisibility = (\n isRevealed: boolean,\n): void => {\n const formatter = useLocalizedStringFormatter(\n locales,\n \"PasswordCreationField\",\n );\n const isInitialRender = useRef(true);\n\n useEffect(() => {\n if (isInitialRender.current) {\n isInitialRender.current = false;\n return;\n }\n\n announce(\n formatter.format(\n isRevealed ? \"password.announce.revealed\" : \"password.announce.hidden\",\n ),\n \"polite\",\n );\n }, [isRevealed]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,IAAa,kCACX,MACA,mBACS;CACT,MAAM,oBAAoB,OAAe,KAAA,CAAS;CAElD,gBAAgB;EACd,IAAI,CAAC,kBAAkB,CAAC,MAAM;GAG5B,kBAAkB,UAAU,KAAA;GAC5B;EACF;EAEA,IAAI,SAAS,kBAAkB,SAC7B;EAGF,kBAAkB,UAAU;EAC5B,SAAS,MAAM,QAAQ;CACzB,GAAG,CAAC,MAAM,cAAc,CAAC;AAC3B;;;;;;;;AASA,IAAa,qCACX,eACS;CACT,MAAM,YAAY,4BAChB,kBACA,uBACF;CACA,MAAM,kBAAkB,OAAO,IAAI;CAEnC,gBAAgB;EACd,IAAI,gBAAgB,SAAS;GAC3B,gBAAgB,UAAU;GAC1B;EACF;EAEA,SACE,UAAU,OACR,aAAa,+BAA+B,0BAC9C,GACA,QACF;CACF,GAAG,CAAC,UAAU,CAAC;AACjB"}
|
|
@@ -14,6 +14,7 @@ var generateTranslationString = (rule, shortVersion = false) => {
|
|
|
14
14
|
else finalTranslationString = translateString;
|
|
15
15
|
return shortVersion ? `${finalTranslationString}.short` : finalTranslationString;
|
|
16
16
|
};
|
|
17
|
+
/** @internal */
|
|
17
18
|
var generateValidationTranslation = (r, shotVersion = false) => {
|
|
18
19
|
const translationKey = generateTranslationString(r, shotVersion);
|
|
19
20
|
if (r.ruleType === RuleType.char && r.chars) return [translationKey, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateValidationTranslation.mjs","names":[],"sources":["../../../../../../../../src/components/PasswordCreationField/lib/generateValidationTranslation.ts"],"sourcesContent":["import {\n RuleType,\n type RuleValidationResult,\n} from \"@/integrations/@mittwald/password-tools-js\";\n\nconst generateTranslationString = (\n rule: Partial<RuleValidationResult> & { translationKey?: string },\n shortVersion = false,\n): string => {\n if (rule.translationKey) {\n return `validation.${rule.translationKey}`;\n }\n const translateString = `validation.${rule.ruleType ?? \"general\"}`;\n let finalTranslationString: string;\n\n if (\n (\"min\" in rule && rule.min !== undefined) ||\n (\"max\" in rule && rule.max !== undefined)\n ) {\n const breakingBoundaryProperty = rule.failingBoundary\n ? rule.failingBoundary\n : rule.min\n ? \"min\"\n : \"max\";\n\n if (rule.identifier) {\n finalTranslationString = `${translateString}.${rule.identifier}.${breakingBoundaryProperty}`;\n } else {\n finalTranslationString = `${translateString}.${breakingBoundaryProperty}`;\n }\n } else if (rule.identifier) {\n finalTranslationString = `${translateString}.${rule.identifier}`;\n } else {\n finalTranslationString = translateString;\n }\n\n return shortVersion\n ? `${finalTranslationString}.short`\n : finalTranslationString;\n};\n\nexport const generateValidationTranslation = (\n r: Partial<RuleValidationResult>,\n shotVersion = false,\n): [string, Record<string, string | number | boolean> | undefined] => {\n const translationKey = generateTranslationString(r, shotVersion);\n\n if (r.ruleType === RuleType.char && r.chars) {\n return [\n translationKey,\n { ...r, chars: r.chars.map((c) => c.char).join(\"\") },\n ];\n }\n\n return [\n translationKey,\n r as unknown as Record<string, string | number | boolean> | undefined,\n ];\n};\n\nexport default generateValidationTranslation;\n"],"mappings":";;;;AAKA,IAAM,6BACJ,MACA,eAAe,UACJ;CACX,IAAI,KAAK,gBACP,OAAO,cAAc,KAAK;CAE5B,MAAM,kBAAkB,cAAc,KAAK,YAAY;CACvD,IAAI;CAEJ,IACG,SAAS,QAAQ,KAAK,QAAQ,KAAA,KAC9B,SAAS,QAAQ,KAAK,QAAQ,KAAA,GAC/B;EACA,MAAM,2BAA2B,KAAK,kBAClC,KAAK,kBACL,KAAK,MACH,QACA;EAEN,IAAI,KAAK,YACP,yBAAyB,GAAG,gBAAgB,GAAG,KAAK,WAAW,GAAG;OAElE,yBAAyB,GAAG,gBAAgB,GAAG;CAEnD,OAAO,IAAI,KAAK,YACd,yBAAyB,GAAG,gBAAgB,GAAG,KAAK;MAEpD,yBAAyB;CAG3B,OAAO,eACH,GAAG,uBAAuB,UAC1B;AACN
|
|
1
|
+
{"version":3,"file":"generateValidationTranslation.mjs","names":[],"sources":["../../../../../../../../src/components/PasswordCreationField/lib/generateValidationTranslation.ts"],"sourcesContent":["import {\n RuleType,\n type RuleValidationResult,\n} from \"@/integrations/@mittwald/password-tools-js\";\n\nconst generateTranslationString = (\n rule: Partial<RuleValidationResult> & { translationKey?: string },\n shortVersion = false,\n): string => {\n if (rule.translationKey) {\n return `validation.${rule.translationKey}`;\n }\n const translateString = `validation.${rule.ruleType ?? \"general\"}`;\n let finalTranslationString: string;\n\n if (\n (\"min\" in rule && rule.min !== undefined) ||\n (\"max\" in rule && rule.max !== undefined)\n ) {\n const breakingBoundaryProperty = rule.failingBoundary\n ? rule.failingBoundary\n : rule.min\n ? \"min\"\n : \"max\";\n\n if (rule.identifier) {\n finalTranslationString = `${translateString}.${rule.identifier}.${breakingBoundaryProperty}`;\n } else {\n finalTranslationString = `${translateString}.${breakingBoundaryProperty}`;\n }\n } else if (rule.identifier) {\n finalTranslationString = `${translateString}.${rule.identifier}`;\n } else {\n finalTranslationString = translateString;\n }\n\n return shortVersion\n ? `${finalTranslationString}.short`\n : finalTranslationString;\n};\n\n/** @internal */\nexport const generateValidationTranslation = (\n r: Partial<RuleValidationResult>,\n shotVersion = false,\n): [string, Record<string, string | number | boolean> | undefined] => {\n const translationKey = generateTranslationString(r, shotVersion);\n\n if (r.ruleType === RuleType.char && r.chars) {\n return [\n translationKey,\n { ...r, chars: r.chars.map((c) => c.char).join(\"\") },\n ];\n }\n\n return [\n translationKey,\n r as unknown as Record<string, string | number | boolean> | undefined,\n ];\n};\n\nexport default generateValidationTranslation;\n"],"mappings":";;;;AAKA,IAAM,6BACJ,MACA,eAAe,UACJ;CACX,IAAI,KAAK,gBACP,OAAO,cAAc,KAAK;CAE5B,MAAM,kBAAkB,cAAc,KAAK,YAAY;CACvD,IAAI;CAEJ,IACG,SAAS,QAAQ,KAAK,QAAQ,KAAA,KAC9B,SAAS,QAAQ,KAAK,QAAQ,KAAA,GAC/B;EACA,MAAM,2BAA2B,KAAK,kBAClC,KAAK,kBACL,KAAK,MACH,QACA;EAEN,IAAI,KAAK,YACP,yBAAyB,GAAG,gBAAgB,GAAG,KAAK,WAAW,GAAG;OAElE,yBAAyB,GAAG,gBAAgB,GAAG;CAEnD,OAAO,IAAI,KAAK,YACd,yBAAyB,GAAG,gBAAgB,GAAG,KAAK;MAEpD,yBAAyB;CAG3B,OAAO,eACH,GAAG,uBAAuB,UAC1B;AACN;;AAGA,IAAa,iCACX,GACA,cAAc,UACsD;CACpE,MAAM,iBAAiB,0BAA0B,GAAG,WAAW;CAE/D,IAAI,EAAE,aAAa,SAAS,QAAQ,EAAE,OACpC,OAAO,CACL,gBACA;EAAE,GAAG;EAAG,OAAO,EAAE,MAAM,KAAK,MAAM,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE;CAAE,CACrD;CAGF,OAAO,CACL,gBACA,CACF;AACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
//#region src/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.ts
|
|
4
|
+
/** @internal */
|
|
4
5
|
var getStatusFromPolicyValidationResult = (isValid, result) => {
|
|
5
6
|
if (isValid === true) {
|
|
6
7
|
if (result.complexity && result.complexity.actual === result.complexity.min && result.complexity.min !== 4) return "warning";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStatusFromPolicyValidationResult.mjs","names":[],"sources":["../../../../../../../../src/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.ts"],"sourcesContent":["import type { ResolvedPolicyValidationResult } from \"@/components/PasswordCreationField/PasswordCreationField\";\nimport type { ComplexityStatus } from \"@/components/PasswordCreationField/components/ComplexityIndicator/ComplexityIndicator\";\n\nexport const getStatusFromPolicyValidationResult = (\n isValid: ResolvedPolicyValidationResult[\"isValid\"],\n result: ResolvedPolicyValidationResult,\n): ComplexityStatus => {\n if (isValid === true) {\n if (\n result.complexity &&\n result.complexity.actual === result.complexity.min &&\n result.complexity.min !== 4\n ) {\n return \"warning\";\n }\n\n return \"success\";\n } else if (isValid === \"indeterminate\") {\n return \"indeterminate\";\n }\n\n return \"danger\";\n};\n\nexport default getStatusFromPolicyValidationResult;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getStatusFromPolicyValidationResult.mjs","names":[],"sources":["../../../../../../../../src/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.ts"],"sourcesContent":["import type { ResolvedPolicyValidationResult } from \"@/components/PasswordCreationField/PasswordCreationField\";\nimport type { ComplexityStatus } from \"@/components/PasswordCreationField/components/ComplexityIndicator/ComplexityIndicator\";\n\n/** @internal */\nexport const getStatusFromPolicyValidationResult = (\n isValid: ResolvedPolicyValidationResult[\"isValid\"],\n result: ResolvedPolicyValidationResult,\n): ComplexityStatus => {\n if (isValid === true) {\n if (\n result.complexity &&\n result.complexity.actual === result.complexity.min &&\n result.complexity.min !== 4\n ) {\n return \"warning\";\n }\n\n return \"success\";\n } else if (isValid === \"indeterminate\") {\n return \"indeterminate\";\n }\n\n return \"danger\";\n};\n\nexport default getStatusFromPolicyValidationResult;\n"],"mappings":";;;;AAIA,IAAa,uCACX,SACA,WACqB;CACrB,IAAI,YAAY,MAAM;EACpB,IACE,OAAO,cACP,OAAO,WAAW,WAAW,OAAO,WAAW,OAC/C,OAAO,WAAW,QAAQ,GAE1B,OAAO;EAGT,OAAO;CACT,OAAO,IAAI,YAAY,iBACrB,OAAO;CAGT,OAAO;AACT"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { startTransition, useEffect, useRef } from "react";
|
|
4
4
|
import { useDebouncedCallback } from "use-debounce";
|
|
5
5
|
//#region src/components/PasswordCreationField/lib/usePolicyValidationResult.ts
|
|
6
|
+
/** @internal */
|
|
6
7
|
var usePolicyValidationResult = (validationPolicy, password, onValidationStart, onValidationResult) => {
|
|
7
8
|
const cache = useRef(null);
|
|
8
9
|
const validatePassword = (pwd) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePolicyValidationResult.mjs","names":[],"sources":["../../../../../../../../src/components/PasswordCreationField/lib/usePolicyValidationResult.ts"],"sourcesContent":["import { startTransition, useEffect, useRef } from \"react\";\nimport type { Policy } from \"@/integrations/@mittwald/password-tools-js\";\nimport type { ResolvedPolicyValidationResult } from \"@/components/PasswordCreationField/PasswordCreationField\";\nimport { useDebouncedCallback } from \"use-debounce\";\n\nexport const usePolicyValidationResult = (\n validationPolicy: Policy,\n password: string,\n onValidationStart?: () => void,\n onValidationResult?: (data: {\n password: string;\n isValid: boolean;\n results: ResolvedPolicyValidationResult;\n }) => void,\n) => {\n const cache = useRef<{\n password: string;\n results: ResolvedPolicyValidationResult;\n } | null>(null);\n\n const validatePassword = (pwd: string) => {\n onValidationStart?.();\n\n startTransition(async () => {\n if (cache.current?.password === pwd) {\n onValidationResult?.({\n password: cache.current.password,\n isValid: Boolean(cache.current.results.isValid),\n results: cache.current.results,\n });\n return;\n }\n\n const validationResult = await validationPolicy.validate(pwd);\n cache.current = { password: pwd, results: validationResult };\n onValidationResult?.({\n password: pwd,\n isValid: validationResult.isValid,\n results: validationResult,\n });\n });\n };\n\n const validatePasswordDebounce = useDebouncedCallback(validatePassword, 350, {\n trailing: true,\n });\n\n useEffect(() => {\n if (password) {\n validatePasswordDebounce(password);\n } else {\n validatePassword(password);\n }\n }, [password, validationPolicy]);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePolicyValidationResult.mjs","names":[],"sources":["../../../../../../../../src/components/PasswordCreationField/lib/usePolicyValidationResult.ts"],"sourcesContent":["import { startTransition, useEffect, useRef } from \"react\";\nimport type { Policy } from \"@/integrations/@mittwald/password-tools-js\";\nimport type { ResolvedPolicyValidationResult } from \"@/components/PasswordCreationField/PasswordCreationField\";\nimport { useDebouncedCallback } from \"use-debounce\";\n\n/** @internal */\nexport const usePolicyValidationResult = (\n validationPolicy: Policy,\n password: string,\n onValidationStart?: () => void,\n onValidationResult?: (data: {\n password: string;\n isValid: boolean;\n results: ResolvedPolicyValidationResult;\n }) => void,\n) => {\n const cache = useRef<{\n password: string;\n results: ResolvedPolicyValidationResult;\n } | null>(null);\n\n const validatePassword = (pwd: string) => {\n onValidationStart?.();\n\n startTransition(async () => {\n if (cache.current?.password === pwd) {\n onValidationResult?.({\n password: cache.current.password,\n isValid: Boolean(cache.current.results.isValid),\n results: cache.current.results,\n });\n return;\n }\n\n const validationResult = await validationPolicy.validate(pwd);\n cache.current = { password: pwd, results: validationResult };\n onValidationResult?.({\n password: pwd,\n isValid: validationResult.isValid,\n results: validationResult,\n });\n });\n };\n\n const validatePasswordDebounce = useDebouncedCallback(validatePassword, 350, {\n trailing: true,\n });\n\n useEffect(() => {\n if (password) {\n validatePasswordDebounce(password);\n } else {\n validatePassword(password);\n }\n }, [password, validationPolicy]);\n};\n"],"mappings":";;;;;;AAMA,IAAa,6BACX,kBACA,UACA,mBACA,uBAKG;CACH,MAAM,QAAQ,OAGJ,IAAI;CAEd,MAAM,oBAAoB,QAAgB;EACxC,oBAAoB;EAEpB,gBAAgB,YAAY;GAC1B,IAAI,MAAM,SAAS,aAAa,KAAK;IACnC,qBAAqB;KACnB,UAAU,MAAM,QAAQ;KACxB,SAAS,QAAQ,MAAM,QAAQ,QAAQ,OAAO;KAC9C,SAAS,MAAM,QAAQ;IACzB,CAAC;IACD;GACF;GAEA,MAAM,mBAAmB,MAAM,iBAAiB,SAAS,GAAG;GAC5D,MAAM,UAAU;IAAE,UAAU;IAAK,SAAS;GAAiB;GAC3D,qBAAqB;IACnB,UAAU;IACV,SAAS,iBAAiB;IAC1B,SAAS;GACX,CAAC;EACH,CAAC;CACH;CAEA,MAAM,2BAA2B,qBAAqB,kBAAkB,KAAK,EAC3E,UAAU,KACZ,CAAC;CAED,gBAAgB;EACd,IAAI,UACF,yBAAyB,QAAQ;OAEjC,iBAAiB,QAAQ;CAE7B,GAAG,CAAC,UAAU,gBAAgB,CAAC;AACjC"}
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
var popover = "flow--popover";
|
|
5
5
|
var content = "flow--popover--content";
|
|
6
6
|
var tip = "flow--popover--tip";
|
|
7
|
+
var tipIcon = "flow--popover--tip-icon";
|
|
7
8
|
var Popover_module_default = {
|
|
8
9
|
"non-modal": "flow--popover--non-modal",
|
|
9
10
|
popover,
|
|
10
11
|
content,
|
|
11
12
|
tip,
|
|
13
|
+
tipIcon,
|
|
12
14
|
"popover-slide": "flow--popover--popover-slide"
|
|
13
15
|
};
|
|
14
16
|
//#endregion
|
|
15
|
-
export { content, Popover_module_default as default, popover, tip };
|
|
17
|
+
export { content, Popover_module_default as default, popover, tip, tipIcon };
|
|
16
18
|
|
|
17
19
|
//# sourceMappingURL=Popover.module.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.module.mjs","names":[],"sources":["../../../../../../../src/components/Popover/Popover.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n/* Variants */\n\n/*\n * A non-modal popover stays in the document and scrolls with the page, so the\n * height react-aria caps it at — the room left in the viewport when it was last\n * measured — is not a limit that applies to it. Anchored below the fold that\n * room is zero, and the hint renders as a two-pixel sliver.\n *\n * `useOverlayPosition` writes the value straight onto the element\n * (`overlay.style.maxHeight = …`) rather than returning it among its props, so\n * no React style can remove it and only `!important` reaches it.\n */\n.non-modal {\n max-height: none !important;\n}\n\n.popover {\n background-color: var(--popover--background-color);\n box-shadow: var(--popover--box-shadow);\n border-radius: var(--popover--corner-radius);\n display: flex;\n flex-direction: column;\n\n --size-px--s--negative: calc(var(--size-px--s) * -1);\n\n min-width: var(--popover--min-width);\n border-width: var(--popover--border-width);\n border-style: var(--popover--border-style);\n border-color: var(--popover--border-color);\n max-width: calc(100% - 2 * var(--popover--viewport-padding));\n\n :where(.content) {\n @include scrollbar.scrollbar;\n\n overflow-y: auto;\n\n &:focus-visible {\n outline: none;\n }\n }\n\n .tip {\n width: var(--popover--tip-width);\n\n
|
|
1
|
+
{"version":3,"file":"Popover.module.mjs","names":[],"sources":["../../../../../../../src/components/Popover/Popover.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n/* Variants */\n\n/*\n * A non-modal popover stays in the document and scrolls with the page, so the\n * height react-aria caps it at — the room left in the viewport when it was last\n * measured — is not a limit that applies to it. Anchored below the fold that\n * room is zero, and the hint renders as a two-pixel sliver.\n *\n * `useOverlayPosition` writes the value straight onto the element\n * (`overlay.style.maxHeight = …`) rather than returning it among its props, so\n * no React style can remove it and only `!important` reaches it.\n */\n.non-modal {\n max-height: none !important;\n\n /*\n * The lowest level that still puts the popover in front of the page. Claiming\n * none at all left it in the `z-index: auto` group, where paint order is tree\n * order — so anything positioned that came later in the document painted over\n * it, and a `position: relative` written as a containing block for something\n * inside it was enough (a `TabNavigation` in a `LayoutCard` below the anchor,\n * #3232). Nothing an overlay can read tells that apart from a deliberate\n * claim, so it has to outrank the whole group.\n *\n * The cost is app chrome that claims level 1 itself: the popover comes later\n * in the document than a header does, so it now wins that tie. Chrome that has\n * to stay above a coach mark claims 2 — the docs site's own header does.\n */\n z-index: 1;\n}\n\n.popover {\n background-color: var(--popover--background-color);\n box-shadow: var(--popover--box-shadow);\n border-radius: var(--popover--corner-radius);\n display: flex;\n flex-direction: column;\n\n --size-px--s--negative: calc(var(--size-px--s) * -1);\n\n min-width: var(--popover--min-width);\n border-width: var(--popover--border-width);\n border-style: var(--popover--border-style);\n border-color: var(--popover--border-color);\n max-width: calc(100% - 2 * var(--popover--viewport-padding));\n\n :where(.content) {\n @include scrollbar.scrollbar;\n\n overflow-y: auto;\n\n &:focus-visible {\n outline: none;\n }\n }\n\n .tip {\n width: var(--popover--tip-width);\n\n .tipIcon {\n display: block;\n fill: var(--popover--background-color);\n stroke: var(--popover--border-color);\n stroke-width: var(--popover--border-width);\n }\n }\n\n &[data-placement=\"top\"] {\n --origin: translateY(var(--size-px--s));\n\n &:has(.tip) {\n margin-bottom: var(--popover--tip-height);\n }\n }\n\n &[data-placement=\"bottom\"] {\n --origin: translateY(var(--size-px--s--negative));\n\n &:has(.tip) {\n margin-top: var(--popover--tip-height);\n }\n\n .tip .tipIcon {\n transform: rotate(180deg);\n }\n }\n\n &[data-placement=\"right\"] {\n --origin: translateX(var(--size-px--s--negative));\n\n &:has(.tip) {\n margin-inline-start: var(--popover--tip-height);\n }\n\n .tip .tipIcon {\n transform: rotate(90deg);\n }\n }\n\n &[data-placement=\"left\"] {\n --origin: translateX(var(--size-px--s));\n\n &:has(.tip) {\n margin-inline-end: var(--popover--tip-height);\n }\n\n .tip .tipIcon {\n transform: rotate(-90deg);\n }\n }\n\n &[data-entering] {\n animation: popover-slide var(--transition--duration--default);\n }\n\n &[data-exiting] {\n animation: popover-slide var(--transition--duration--default) reverse\n ease-in;\n pointer-events: none;\n }\n\n &:has(:global(.flow--options):empty) {\n display: none;\n }\n}\n\n@keyframes popover-slide {\n from {\n transform: var(--origin);\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n"],"mappings":""}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import Popover_module_default from "../../Popover.module.mjs";
|
|
4
4
|
import { popoverViewportPadding } from "../../viewportPadding.mjs";
|
|
5
5
|
import { popoverWidthStyle } from "../../widthStyle.mjs";
|
|
6
|
+
import { PopoverTip } from "../PopoverTip/PopoverTip.mjs";
|
|
6
7
|
import clsx from "clsx";
|
|
7
8
|
import { useEffect, useId, useRef } from "react";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -107,12 +108,7 @@ var NonModalPopoverContentInner = (props) => {
|
|
|
107
108
|
...arrowProps.style,
|
|
108
109
|
...placement ? { [placement]: "100%" } : {}
|
|
109
110
|
},
|
|
110
|
-
children: /* @__PURE__ */ jsx(
|
|
111
|
-
width: 16,
|
|
112
|
-
height: 16,
|
|
113
|
-
viewBox: "0 0 16 16",
|
|
114
|
-
children: /* @__PURE__ */ jsx("path", { d: "M0 0 L8 8 L16 0" })
|
|
115
|
-
})
|
|
111
|
+
children: /* @__PURE__ */ jsx(PopoverTip, {})
|
|
116
112
|
}), /* @__PURE__ */ jsx("div", {
|
|
117
113
|
className: Popover_module_default.content,
|
|
118
114
|
id: detailsId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonModalPopoverContent.mjs","names":[],"sources":["../../../../../../../../../src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref, RefObject } from \"react\";\nimport { useEffect, useId, useRef } from \"react\";\nimport clsx from \"clsx\";\nimport { useObjectRef, useOverlayPosition } from \"react-aria\";\nimport type { Placement } from \"react-aria\";\nimport { useEnterAnimation, useExitAnimation } from \"@react-aria/utils\";\nimport styles from \"../../Popover.module.scss\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { popoverViewportPadding } from \"../../viewportPadding\";\nimport { popoverWidthStyle } from \"../../widthStyle\";\n\nexport interface NonModalPopoverContentProps\n extends PropsWithChildren, PropsWithClassName {\n withTip?: boolean;\n isOpen?: boolean;\n width?: string | number;\n placement?: Placement;\n offset?: number;\n crossOffset?: number;\n /** Swallowed on purpose — the stylesheet overrides `max-height` here. */\n maxHeight?: number;\n shouldFlip?: boolean;\n shouldUpdatePosition?: boolean;\n arrowBoundaryOffset?: number;\n boundaryElement?: Element;\n /** The id react-aria's trigger points its `aria-controls` at. */\n id?: string;\n onOpenChange: (isOpen: boolean) => void;\n ref?: Ref<HTMLElement>;\n triggerRef: RefObject<Element | null>;\n}\n\ninterface NonModalPopoverContentInnerProps extends Omit<\n NonModalPopoverContentProps,\n \"ref\"\n> {\n overlayRef: RefObject<HTMLDivElement | null>;\n isExiting: boolean;\n}\n\n/*\n * `useOverlayPosition` recalculates when the window resizes, when a scroll\n * container scrolls, and when the anchor or the popover changes *size*. It never\n * notices the anchor merely *moving*, because a popover normally opens on a user\n * interaction, long after the page settled.\n *\n * This one opens itself, so it places itself into a page that is still filling\n * in — and anything appearing above the anchor then pushes the anchor out from\n * under it. Remotely that is the normal case, not an edge case: the host\n * materializes the page in pieces as they arrive over the connection.\n *\n * Observing the ancestors covers it. In block layout an element moves because\n * something around it changed size, and a resized ancestor is the one signal\n * every such reflow has in common. What it does not catch is an ancestor of\n * fixed height rearranging inside — rare, and the next scroll or resize\n * corrects it.\n */\nconst useRepositionWhenAnchorMoves = (\n anchorRef: RefObject<Element | null>,\n isOpen: boolean,\n updatePosition: () => void,\n): void => {\n useEffect(() => {\n // Read inside the effect. A coach mark that is open from its first render\n // renders before the anchor's ref is attached, and a ref filling in does not\n // re-render anything — so reading during render would see `null`, bail, and\n // leave nothing observing.\n const anchor = anchorRef.current;\n\n if (!isOpen || !anchor) {\n return;\n }\n\n const observer = new ResizeObserver(updatePosition);\n\n for (\n let element = anchor.parentElement;\n element;\n element = element.parentElement\n ) {\n observer.observe(element);\n }\n\n return () => observer.disconnect();\n }, [anchorRef, isOpen, updatePosition]);\n};\n\n/*\n * The non-modal popover deliberately skips react-aria's `usePopover`, which is\n * what a popover normally builds on. That hook couples three things Flow does\n * not want here: it locks page scrolling, it hides the rest of the page from\n * assistive tech, and — the reason this component exists — it closes the\n * popover on the first scroll, with no way to opt out.\n *\n * What is left is `useOverlayPosition` for the anchoring, public react-aria API.\n * The popover therefore tracks its trigger while the page scrolls, and its\n * content stays plain content: no role, no label, no focus of its own.\n *\n * It is not portalled either. A popover that is announced by nothing has to be\n * findable where it belongs, and a portal to the end of `<body>` puts it behind\n * the whole page in reading order — so it renders where it was written, right\n * next to what it points at. Being absolutely positioned it still takes no\n * space; what it does inherit is its surroundings, so an ancestor that clips\n * (`overflow: hidden`) or a stacking context can cut it off.\n *\n * Mounting is split across two components for the same reason `Aria.Popover`\n * splits it: the closing animation has to outlive `isOpen`, so the element that\n * plays it cannot be unmounted by the render that closes it. This outer half\n * keeps the ref and the mount decision and survives across open and closed; the\n * inner half holds the positioning and remounts on every open, which is what\n * resets the entry animation.\n */\nexport const NonModalPopoverContent: FC<NonModalPopoverContentProps> = (\n props,\n) => {\n const { isOpen = false, ref, ...rest } = props;\n\n const overlayRef = useObjectRef(ref as Ref<HTMLDivElement>);\n\n const isExiting = useExitAnimation(overlayRef, isOpen);\n\n if (!isOpen && !isExiting) {\n return null;\n }\n\n return (\n <NonModalPopoverContentInner\n {...rest}\n overlayRef={overlayRef}\n isOpen={isOpen}\n isExiting={isExiting}\n />\n );\n};\n\nconst NonModalPopoverContentInner: FC<NonModalPopoverContentInnerProps> = (\n props,\n) => {\n const {\n children,\n className,\n withTip,\n isOpen = false,\n isExiting,\n width,\n id,\n onOpenChange,\n overlayRef,\n triggerRef,\n // Named one by one so that everything left over is a DOM prop and reaches\n // the element. Funnelling the rest into the positioning instead drops\n // `aria-*`, `data-*` and the like, which `Aria.Popover` forwards on the\n // modal path.\n placement: requestedPlacement,\n offset,\n crossOffset,\n maxHeight: ignoredMaxHeight,\n shouldFlip,\n shouldUpdatePosition,\n arrowBoundaryOffset,\n boundaryElement,\n ...rest\n } = props;\n\n void ignoredMaxHeight;\n\n const positionProps = {\n placement: requestedPlacement,\n offset,\n crossOffset,\n shouldFlip,\n shouldUpdatePosition,\n arrowBoundaryOffset,\n boundaryElement,\n };\n\n const arrowRef = useRef<HTMLDivElement>(null);\n const detailsId = useId();\n\n const { overlayProps, arrowProps, placement, updatePosition } =\n useOverlayPosition({\n ...positionProps,\n targetRef: triggerRef,\n overlayRef,\n arrowRef,\n isOpen,\n offset: positionProps.offset ?? 8,\n containerPadding: popoverViewportPadding,\n });\n\n useRepositionWhenAnchorMoves(triggerRef, isOpen, updatePosition);\n\n /*\n * Until it has a placement, `useOverlayPosition` parks the popover in the top\n * left corner (`position: fixed; top: 0; left: 0`) — it has not measured the\n * anchor yet. Rendered on a server that corner is what ships, and the popover\n * sits there until hydration measures; an anchor given by id is resolved a\n * frame later still. Either way it is visibly in the wrong place first and\n * jumps to the anchor after, so keep it out of sight until it knows where it\n * belongs. It stays in the DOM, which is what its place in the reading order\n * and `aria-details` depend on.\n */\n const isPositioned = placement !== null;\n\n // Held back until the popover knows where it belongs — an entry animation\n // that plays while the popover is still hidden is one the user never sees.\n const isEntering = useEnterAnimation(overlayRef, isPositioned);\n\n /*\n * Nothing announces this popover, so the trigger points at it: `aria-details`\n * tells assistive tech that there is related content and offers a way over to\n * it — unlike `aria-describedby`, which would flatten the popover into a\n * string and put its buttons out of reach.\n *\n * Set on the trigger element itself, because that element belongs to whoever\n * rendered it. Whatever it carried before is restored on the way out.\n */\n useEffect(() => {\n const trigger = triggerRef.current;\n\n if (!isOpen || !trigger) {\n return;\n }\n\n const previous = trigger.getAttribute(\"aria-details\");\n trigger.setAttribute(\n \"aria-details\",\n previous ? `${previous} ${detailsId}` : detailsId,\n );\n\n return () => {\n if (previous === null) {\n trigger.removeAttribute(\"aria-details\");\n } else {\n trigger.setAttribute(\"aria-details\", previous);\n }\n };\n }, [isOpen, triggerRef, detailsId]);\n\n // Escape closes it. react-aria would do this through `useOverlay`, which is\n // part of the machinery this component leaves out.\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n onOpenChange(false);\n }\n };\n\n document.addEventListener(\"keydown\", closeOnEscape);\n return () => document.removeEventListener(\"keydown\", closeOnEscape);\n }, [isOpen, onOpenChange]);\n\n return (\n <div\n {...rest}\n {...overlayProps}\n id={id}\n ref={overlayRef}\n className={clsx(className, styles[\"non-modal\"])}\n data-placement={placement ?? undefined}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}\n style={{\n ...overlayProps.style,\n /*\n * Two things `useOverlayPosition` adds for an overlay portalled to the\n * end of `<body>` and pinned to the viewport. This one renders where it\n * stands and scrolls with the page, so both are wrong here.\n *\n * `z-index: 100000` would put it in front of the whole application — it\n * scrolled over the docs site's sticky header. Claiming no stacking\n * level leaves that to the page: it still covers the ordinary content\n * around it, and app chrome that sets a `z-index` keeps its place above.\n *\n * The `max-height` it caps the overlay at is wrong here for the same\n * reason, but it is written straight onto the element and has to be\n * undone in CSS — see `.non-modal` in Popover.module.scss.\n */\n zIndex: undefined,\n ...popoverWidthStyle(width),\n ...(isPositioned ? {} : { visibility: \"hidden\" }),\n }}\n >\n {withTip && (\n <div\n {...arrowProps}\n ref={arrowRef}\n className={styles.tip}\n data-placement={placement ?? undefined}\n style={{\n // What <Aria.OverlayArrow /> contributes on top of `arrowProps`:\n // it lifts the tip out of the flow and centres it on the anchor.\n position: \"absolute\",\n transform:\n placement === \"top\" || placement === \"bottom\"\n ? \"translateX(-50%)\"\n : \"translateY(-50%)\",\n // `arrowProps.style` carries the offset along the popover's edge and\n // leaves the other axis `undefined` — which still overwrites. So the\n // edge the tip sits on is set last: spread first, it silently lost\n // `top: 100%` and the tip jumped to the popover's top edge, pointing\n // away from an anchor that was below it.\n ...arrowProps.style,\n ...(placement ? { [placement]: \"100%\" } : {}),\n }}\n >\n <svg width={16} height={16} viewBox=\"0 0 16 16\">\n <path d=\"M0 0 L8 8 L16 0\" />\n </svg>\n </div>\n )}\n <div className={styles.content} id={detailsId}>\n {children}\n </div>\n </div>\n );\n};\n\nexport default NonModalPopoverContent;\n"],"mappings":";;;;;;;;;;;AAyDA,IAAM,gCACJ,WACA,QACA,mBACS;CACT,gBAAgB;EAKd,MAAM,SAAS,UAAU;EAEzB,IAAI,CAAC,UAAU,CAAC,QACd;EAGF,MAAM,WAAW,IAAI,eAAe,cAAc;EAElD,KACE,IAAI,UAAU,OAAO,eACrB,SACA,UAAU,QAAQ,eAElB,SAAS,QAAQ,OAAO;EAG1B,aAAa,SAAS,WAAW;CACnC,GAAG;EAAC;EAAW;EAAQ;CAAc,CAAC;AACxC;AA2BA,IAAa,0BACX,UACG;CACH,MAAM,EAAE,SAAS,OAAO,KAAK,GAAG,SAAS;CAEzC,MAAM,aAAa,eAAa,GAA0B;CAE1D,MAAM,YAAY,iBAAiB,YAAY,MAAM;CAErD,IAAI,CAAC,UAAU,CAAC,WACd,OAAO;CAGT,OACE,oBAAC,6BAAD;EACE,GAAI;EACQ;EACJ;EACG;CACZ,CAAA;AAEL;AAEA,IAAM,+BACJ,UACG;CACH,MAAM,EACJ,UACA,WACA,SACA,SAAS,OACT,WACA,OACA,IACA,cACA,YACA,YAKA,WAAW,oBACX,QACA,aACA,WAAW,kBACX,YACA,sBACA,qBACA,iBACA,GAAG,SACD;CAIJ,MAAM,gBAAgB;EACpB,WAAW;EACX;EACA;EACA;EACA;EACA;EACA;CACF;CAEA,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,cAAc,YAAY,WAAW,mBAC3C,mBAAmB;EACjB,GAAG;EACH,WAAW;EACX;EACA;EACA;EACA,QAAQ,cAAc,UAAU;EAChC,kBAAkB;CACpB,CAAC;CAEH,6BAA6B,YAAY,QAAQ,cAAc;CAY/D,MAAM,eAAe,cAAc;CAInC,MAAM,aAAa,kBAAkB,YAAY,YAAY;CAW7D,gBAAgB;EACd,MAAM,UAAU,WAAW;EAE3B,IAAI,CAAC,UAAU,CAAC,SACd;EAGF,MAAM,WAAW,QAAQ,aAAa,cAAc;EACpD,QAAQ,aACN,gBACA,WAAW,GAAG,SAAS,GAAG,cAAc,SAC1C;EAEA,aAAa;GACX,IAAI,aAAa,MACf,QAAQ,gBAAgB,cAAc;QAEtC,QAAQ,aAAa,gBAAgB,QAAQ;EAEjD;CACF,GAAG;EAAC;EAAQ;EAAY;CAAS,CAAC;CAIlC,gBAAgB;EACd,IAAI,CAAC,QACH;EAGF,MAAM,iBAAiB,UAAyB;GAC9C,IAAI,MAAM,QAAQ,UAChB,aAAa,KAAK;EAEtB;EAEA,SAAS,iBAAiB,WAAW,aAAa;EAClD,aAAa,SAAS,oBAAoB,WAAW,aAAa;CACpE,GAAG,CAAC,QAAQ,YAAY,CAAC;CAEzB,OACE,qBAAC,OAAD;EACE,GAAI;EACJ,GAAI;EACA;EACJ,KAAK;EACL,WAAW,KAAK,WAAW,uBAAO,YAAY;EAC9C,kBAAgB,aAAa,KAAA;EAC7B,iBAAe,cAAc,KAAA;EAC7B,gBAAc,aAAa,KAAA;EAC3B,OAAO;GACL,GAAG,aAAa;GAehB,QAAQ,KAAA;GACR,GAAG,kBAAkB,KAAK;GAC1B,GAAI,eAAe,CAAC,IAAI,EAAE,YAAY,SAAS;EACjD;EA5BF,UAAA,CA8BG,WACC,oBAAC,OAAD;GACE,GAAI;GACJ,KAAK;GACL,WAAW,uBAAO;GAClB,kBAAgB,aAAa,KAAA;GAC7B,OAAO;IAGL,UAAU;IACV,WACE,cAAc,SAAS,cAAc,WACjC,qBACA;IAMN,GAAG,WAAW;IACd,GAAI,YAAY,GAAG,YAAY,OAAO,IAAI,CAAC;GAC7C;GAEA,UAAA,oBAAC,OAAD;IAAK,OAAO;IAAI,QAAQ;IAAI,SAAQ;IAClC,UAAA,oBAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA;GACxB,CAAA;EACF,CAAA,GAEP,oBAAC,OAAD;GAAK,WAAW,uBAAO;GAAS,IAAI;GACjC;EACE,CAAA,CACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"NonModalPopoverContent.mjs","names":[],"sources":["../../../../../../../../../src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref, RefObject } from \"react\";\nimport { useEffect, useId, useRef } from \"react\";\nimport clsx from \"clsx\";\nimport { useObjectRef, useOverlayPosition } from \"react-aria\";\nimport type { Placement } from \"react-aria\";\nimport { useEnterAnimation, useExitAnimation } from \"@react-aria/utils\";\nimport styles from \"../../Popover.module.scss\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { popoverViewportPadding } from \"../../viewportPadding\";\nimport { popoverWidthStyle } from \"../../widthStyle\";\nimport { PopoverTip } from \"../PopoverTip\";\n\nexport interface NonModalPopoverContentProps\n extends PropsWithChildren, PropsWithClassName {\n withTip?: boolean;\n isOpen?: boolean;\n width?: string | number;\n placement?: Placement;\n offset?: number;\n crossOffset?: number;\n /** Swallowed on purpose — the stylesheet overrides `max-height` here. */\n maxHeight?: number;\n shouldFlip?: boolean;\n shouldUpdatePosition?: boolean;\n arrowBoundaryOffset?: number;\n boundaryElement?: Element;\n /** The id react-aria's trigger points its `aria-controls` at. */\n id?: string;\n onOpenChange: (isOpen: boolean) => void;\n ref?: Ref<HTMLElement>;\n triggerRef: RefObject<Element | null>;\n}\n\ninterface NonModalPopoverContentInnerProps extends Omit<\n NonModalPopoverContentProps,\n \"ref\"\n> {\n overlayRef: RefObject<HTMLDivElement | null>;\n isExiting: boolean;\n}\n\n/*\n * `useOverlayPosition` recalculates when the window resizes, when a scroll\n * container scrolls, and when the anchor or the popover changes *size*. It never\n * notices the anchor merely *moving*, because a popover normally opens on a user\n * interaction, long after the page settled.\n *\n * This one opens itself, so it places itself into a page that is still filling\n * in — and anything appearing above the anchor then pushes the anchor out from\n * under it. Remotely that is the normal case, not an edge case: the host\n * materializes the page in pieces as they arrive over the connection.\n *\n * Observing the ancestors covers it. In block layout an element moves because\n * something around it changed size, and a resized ancestor is the one signal\n * every such reflow has in common. What it does not catch is an ancestor of\n * fixed height rearranging inside — rare, and the next scroll or resize\n * corrects it.\n */\nconst useRepositionWhenAnchorMoves = (\n anchorRef: RefObject<Element | null>,\n isOpen: boolean,\n updatePosition: () => void,\n): void => {\n useEffect(() => {\n // Read inside the effect. A coach mark that is open from its first render\n // renders before the anchor's ref is attached, and a ref filling in does not\n // re-render anything — so reading during render would see `null`, bail, and\n // leave nothing observing.\n const anchor = anchorRef.current;\n\n if (!isOpen || !anchor) {\n return;\n }\n\n const observer = new ResizeObserver(updatePosition);\n\n for (\n let element = anchor.parentElement;\n element;\n element = element.parentElement\n ) {\n observer.observe(element);\n }\n\n return () => observer.disconnect();\n }, [anchorRef, isOpen, updatePosition]);\n};\n\n/*\n * The non-modal popover deliberately skips react-aria's `usePopover`, which is\n * what a popover normally builds on. That hook couples three things Flow does\n * not want here: it locks page scrolling, it hides the rest of the page from\n * assistive tech, and — the reason this component exists — it closes the\n * popover on the first scroll, with no way to opt out.\n *\n * What is left is `useOverlayPosition` for the anchoring, public react-aria API.\n * The popover therefore tracks its trigger while the page scrolls, and its\n * content stays plain content: no role, no label, no focus of its own.\n *\n * It is not portalled either. A popover that is announced by nothing has to be\n * findable where it belongs, and a portal to the end of `<body>` puts it behind\n * the whole page in reading order — so it renders where it was written, right\n * next to what it points at. Being absolutely positioned it still takes no\n * space; what it does inherit is its surroundings, so an ancestor that clips\n * (`overflow: hidden`) or a stacking context can cut it off.\n *\n * Mounting is split across two components for the same reason `Aria.Popover`\n * splits it: the closing animation has to outlive `isOpen`, so the element that\n * plays it cannot be unmounted by the render that closes it. This outer half\n * keeps the ref and the mount decision and survives across open and closed; the\n * inner half holds the positioning and remounts on every open, which is what\n * resets the entry animation.\n */\nexport const NonModalPopoverContent: FC<NonModalPopoverContentProps> = (\n props,\n) => {\n const { isOpen = false, ref, ...rest } = props;\n\n const overlayRef = useObjectRef(ref as Ref<HTMLDivElement>);\n\n const isExiting = useExitAnimation(overlayRef, isOpen);\n\n if (!isOpen && !isExiting) {\n return null;\n }\n\n return (\n <NonModalPopoverContentInner\n {...rest}\n overlayRef={overlayRef}\n isOpen={isOpen}\n isExiting={isExiting}\n />\n );\n};\n\nconst NonModalPopoverContentInner: FC<NonModalPopoverContentInnerProps> = (\n props,\n) => {\n const {\n children,\n className,\n withTip,\n isOpen = false,\n isExiting,\n width,\n id,\n onOpenChange,\n overlayRef,\n triggerRef,\n // Named one by one so that everything left over is a DOM prop and reaches\n // the element. Funnelling the rest into the positioning instead drops\n // `aria-*`, `data-*` and the like, which `Aria.Popover` forwards on the\n // modal path.\n placement: requestedPlacement,\n offset,\n crossOffset,\n maxHeight: ignoredMaxHeight,\n shouldFlip,\n shouldUpdatePosition,\n arrowBoundaryOffset,\n boundaryElement,\n ...rest\n } = props;\n\n void ignoredMaxHeight;\n\n const positionProps = {\n placement: requestedPlacement,\n offset,\n crossOffset,\n shouldFlip,\n shouldUpdatePosition,\n arrowBoundaryOffset,\n boundaryElement,\n };\n\n const arrowRef = useRef<HTMLDivElement>(null);\n const detailsId = useId();\n\n const { overlayProps, arrowProps, placement, updatePosition } =\n useOverlayPosition({\n ...positionProps,\n targetRef: triggerRef,\n overlayRef,\n arrowRef,\n isOpen,\n offset: positionProps.offset ?? 8,\n containerPadding: popoverViewportPadding,\n });\n\n useRepositionWhenAnchorMoves(triggerRef, isOpen, updatePosition);\n\n /*\n * Until it has a placement, `useOverlayPosition` parks the popover in the top\n * left corner (`position: fixed; top: 0; left: 0`) — it has not measured the\n * anchor yet. Rendered on a server that corner is what ships, and the popover\n * sits there until hydration measures; an anchor given by id is resolved a\n * frame later still. Either way it is visibly in the wrong place first and\n * jumps to the anchor after, so keep it out of sight until it knows where it\n * belongs. It stays in the DOM, which is what its place in the reading order\n * and `aria-details` depend on.\n */\n const isPositioned = placement !== null;\n\n // Held back until the popover knows where it belongs — an entry animation\n // that plays while the popover is still hidden is one the user never sees.\n const isEntering = useEnterAnimation(overlayRef, isPositioned);\n\n /*\n * Nothing announces this popover, so the trigger points at it: `aria-details`\n * tells assistive tech that there is related content and offers a way over to\n * it — unlike `aria-describedby`, which would flatten the popover into a\n * string and put its buttons out of reach.\n *\n * Set on the trigger element itself, because that element belongs to whoever\n * rendered it. Whatever it carried before is restored on the way out.\n */\n useEffect(() => {\n const trigger = triggerRef.current;\n\n if (!isOpen || !trigger) {\n return;\n }\n\n const previous = trigger.getAttribute(\"aria-details\");\n trigger.setAttribute(\n \"aria-details\",\n previous ? `${previous} ${detailsId}` : detailsId,\n );\n\n return () => {\n if (previous === null) {\n trigger.removeAttribute(\"aria-details\");\n } else {\n trigger.setAttribute(\"aria-details\", previous);\n }\n };\n }, [isOpen, triggerRef, detailsId]);\n\n // Escape closes it. react-aria would do this through `useOverlay`, which is\n // part of the machinery this component leaves out.\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n onOpenChange(false);\n }\n };\n\n document.addEventListener(\"keydown\", closeOnEscape);\n return () => document.removeEventListener(\"keydown\", closeOnEscape);\n }, [isOpen, onOpenChange]);\n\n return (\n <div\n {...rest}\n {...overlayProps}\n id={id}\n ref={overlayRef}\n className={clsx(className, styles[\"non-modal\"])}\n data-placement={placement ?? undefined}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}\n style={{\n ...overlayProps.style,\n /*\n * Two things `useOverlayPosition` adds for an overlay portalled to the\n * end of `<body>` and pinned to the viewport. This one renders where it\n * stands and scrolls with the page, so both are wrong here.\n *\n * `z-index: 100000` would put it in front of the whole application — it\n * scrolled over the docs site's sticky header. Dropping the value here\n * hands the level to CSS, where `.non-modal` claims the lowest one that\n * still clears ordinary page content.\n *\n * The `max-height` it caps the overlay at is wrong here for the same\n * reason, but it is written straight onto the element and has to be\n * undone in CSS — see `.non-modal` in Popover.module.scss.\n */\n zIndex: undefined,\n ...popoverWidthStyle(width),\n ...(isPositioned ? {} : { visibility: \"hidden\" }),\n }}\n >\n {withTip && (\n <div\n {...arrowProps}\n ref={arrowRef}\n className={styles.tip}\n data-placement={placement ?? undefined}\n style={{\n // What <Aria.OverlayArrow /> contributes on top of `arrowProps`:\n // it lifts the tip out of the flow and centres it on the anchor.\n position: \"absolute\",\n transform:\n placement === \"top\" || placement === \"bottom\"\n ? \"translateX(-50%)\"\n : \"translateY(-50%)\",\n // `arrowProps.style` carries the offset along the popover's edge and\n // leaves the other axis `undefined` — which still overwrites. So the\n // edge the tip sits on is set last: spread first, it silently lost\n // `top: 100%` and the tip jumped to the popover's top edge, pointing\n // away from an anchor that was below it.\n ...arrowProps.style,\n ...(placement ? { [placement]: \"100%\" } : {}),\n }}\n >\n <PopoverTip />\n </div>\n )}\n <div className={styles.content} id={detailsId}>\n {children}\n </div>\n </div>\n );\n};\n\nexport default NonModalPopoverContent;\n"],"mappings":";;;;;;;;;;;;AA0DA,IAAM,gCACJ,WACA,QACA,mBACS;CACT,gBAAgB;EAKd,MAAM,SAAS,UAAU;EAEzB,IAAI,CAAC,UAAU,CAAC,QACd;EAGF,MAAM,WAAW,IAAI,eAAe,cAAc;EAElD,KACE,IAAI,UAAU,OAAO,eACrB,SACA,UAAU,QAAQ,eAElB,SAAS,QAAQ,OAAO;EAG1B,aAAa,SAAS,WAAW;CACnC,GAAG;EAAC;EAAW;EAAQ;CAAc,CAAC;AACxC;AA2BA,IAAa,0BACX,UACG;CACH,MAAM,EAAE,SAAS,OAAO,KAAK,GAAG,SAAS;CAEzC,MAAM,aAAa,eAAa,GAA0B;CAE1D,MAAM,YAAY,iBAAiB,YAAY,MAAM;CAErD,IAAI,CAAC,UAAU,CAAC,WACd,OAAO;CAGT,OACE,oBAAC,6BAAD;EACE,GAAI;EACQ;EACJ;EACG;CACZ,CAAA;AAEL;AAEA,IAAM,+BACJ,UACG;CACH,MAAM,EACJ,UACA,WACA,SACA,SAAS,OACT,WACA,OACA,IACA,cACA,YACA,YAKA,WAAW,oBACX,QACA,aACA,WAAW,kBACX,YACA,sBACA,qBACA,iBACA,GAAG,SACD;CAIJ,MAAM,gBAAgB;EACpB,WAAW;EACX;EACA;EACA;EACA;EACA;EACA;CACF;CAEA,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,cAAc,YAAY,WAAW,mBAC3C,mBAAmB;EACjB,GAAG;EACH,WAAW;EACX;EACA;EACA;EACA,QAAQ,cAAc,UAAU;EAChC,kBAAkB;CACpB,CAAC;CAEH,6BAA6B,YAAY,QAAQ,cAAc;CAY/D,MAAM,eAAe,cAAc;CAInC,MAAM,aAAa,kBAAkB,YAAY,YAAY;CAW7D,gBAAgB;EACd,MAAM,UAAU,WAAW;EAE3B,IAAI,CAAC,UAAU,CAAC,SACd;EAGF,MAAM,WAAW,QAAQ,aAAa,cAAc;EACpD,QAAQ,aACN,gBACA,WAAW,GAAG,SAAS,GAAG,cAAc,SAC1C;EAEA,aAAa;GACX,IAAI,aAAa,MACf,QAAQ,gBAAgB,cAAc;QAEtC,QAAQ,aAAa,gBAAgB,QAAQ;EAEjD;CACF,GAAG;EAAC;EAAQ;EAAY;CAAS,CAAC;CAIlC,gBAAgB;EACd,IAAI,CAAC,QACH;EAGF,MAAM,iBAAiB,UAAyB;GAC9C,IAAI,MAAM,QAAQ,UAChB,aAAa,KAAK;EAEtB;EAEA,SAAS,iBAAiB,WAAW,aAAa;EAClD,aAAa,SAAS,oBAAoB,WAAW,aAAa;CACpE,GAAG,CAAC,QAAQ,YAAY,CAAC;CAEzB,OACE,qBAAC,OAAD;EACE,GAAI;EACJ,GAAI;EACA;EACJ,KAAK;EACL,WAAW,KAAK,WAAW,uBAAO,YAAY;EAC9C,kBAAgB,aAAa,KAAA;EAC7B,iBAAe,cAAc,KAAA;EAC7B,gBAAc,aAAa,KAAA;EAC3B,OAAO;GACL,GAAG,aAAa;GAehB,QAAQ,KAAA;GACR,GAAG,kBAAkB,KAAK;GAC1B,GAAI,eAAe,CAAC,IAAI,EAAE,YAAY,SAAS;EACjD;EA5BF,UAAA,CA8BG,WACC,oBAAC,OAAD;GACE,GAAI;GACJ,KAAK;GACL,WAAW,uBAAO;GAClB,kBAAgB,aAAa,KAAA;GAC7B,OAAO;IAGL,UAAU;IACV,WACE,cAAc,SAAS,cAAc,WACjC,qBACA;IAMN,GAAG,WAAW;IACd,GAAI,YAAY,GAAG,YAAY,OAAO,IAAI,CAAC;GAC7C;GAEA,UAAA,oBAAC,YAAD,CAAa,CAAA;EACV,CAAA,GAEP,oBAAC,OAAD;GAAK,WAAW,uBAAO;GAAS,IAAI;GACjC;EACE,CAAA,CACF;;AAET"}
|
|
@@ -4,6 +4,7 @@ import { useIsActivityActive } from "../../../Activity/context.mjs";
|
|
|
4
4
|
import Popover_module_default from "../../Popover.module.mjs";
|
|
5
5
|
import { popoverViewportPadding } from "../../viewportPadding.mjs";
|
|
6
6
|
import { popoverWidthStyle } from "../../widthStyle.mjs";
|
|
7
|
+
import { PopoverTip } from "../PopoverTip/PopoverTip.mjs";
|
|
7
8
|
import { NonModalPopoverContent } from "../NonModalPopoverContent/NonModalPopoverContent.mjs";
|
|
8
9
|
import { useContext } from "react";
|
|
9
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -47,12 +48,7 @@ var PopoverContent = (props) => {
|
|
|
47
48
|
style: popoverWidthStyle(width),
|
|
48
49
|
children: [withTip && /* @__PURE__ */ jsx(Aria.OverlayArrow, {
|
|
49
50
|
className: Popover_module_default.tip,
|
|
50
|
-
children: /* @__PURE__ */ jsx(
|
|
51
|
-
width: 16,
|
|
52
|
-
height: 16,
|
|
53
|
-
viewBox: "0 0 16 16",
|
|
54
|
-
children: /* @__PURE__ */ jsx("path", { d: "M0 0 L8 8 L16 0" })
|
|
55
|
-
})
|
|
51
|
+
children: /* @__PURE__ */ jsx(PopoverTip, {})
|
|
56
52
|
}), /* @__PURE__ */ jsx(ContentComponent, {
|
|
57
53
|
className: Popover_module_default.content,
|
|
58
54
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverContent.mjs","names":[],"sources":["../../../../../../../../../src/components/Popover/components/PopoverContent/PopoverContent.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref, RefObject } from \"react\";\nimport { useContext } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"../../Popover.module.scss\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { useIsActivityActive } from \"@/components/Activity/context\";\nimport { NonModalPopoverContent } from \"../NonModalPopoverContent\";\nimport { popoverViewportPadding } from \"../../viewportPadding\";\nimport { popoverWidthStyle } from \"../../widthStyle\";\n\nexport interface PopoverContentProps\n extends PropsWithChildren, PropsWithClassName {\n withTip?: boolean;\n isDialogContent?: boolean;\n isOpen?: boolean;\n width?: string | number;\n /** @internal Set by `CoachMark`; see `PopoverProps`. */\n modality?: \"modal\" | \"non-modal\";\n onOpenChange: (isOpen: boolean) => void;\n ref?: Ref<HTMLElement>;\n triggerRef?: RefObject<Element | null>;\n}\n\n/**\n * @flr-generate all\n * @flr-ignore-props modality\n */\nexport const PopoverContent: FC<PopoverContentProps> = (props) => {\n const {\n children,\n className,\n isDialogContent = false,\n withTip,\n onOpenChange,\n ref,\n isOpen,\n width,\n modality,\n ...rest\n } = props;\n\n const isActivityActive = useIsActivityActive();\n\n // A trigger hands its popover a ref through the context react-aria sets up,\n // and the non-modal popover has to anchor itself with it.\n const popoverContext = useContext(Aria.PopoverContext);\n const triggerRefFromContext =\n popoverContext && \"triggerRef\" in popoverContext\n ? popoverContext.triggerRef\n : undefined;\n\n // The trigger points its `aria-controls` at this id while the popover is\n // open, so the popover has to carry it — react-aria's own only applies it\n // when the popover is a dialog.\n const idFromContext =\n popoverContext && \"id\" in popoverContext ? popoverContext.id : undefined;\n\n const ContentComponent = isDialogContent ? Aria.Dialog : \"div\";\n\n if (!isActivityActive) {\n return null;\n }\n\n if (modality === \"non-modal\") {\n const anchor = rest.triggerRef ?? triggerRefFromContext;\n\n // Without an anchor there is nothing to position against. react-aria's own\n // popover has the same requirement; it just throws further in.\n if (!anchor) {\n return null;\n }\n\n return (\n <NonModalPopoverContent\n {...rest}\n className={className}\n ref={ref}\n isOpen={isOpen}\n width={width}\n withTip={withTip}\n id={idFromContext}\n triggerRef={anchor}\n onOpenChange={onOpenChange}\n >\n {children}\n </NonModalPopoverContent>\n );\n }\n\n return (\n <Aria.Popover\n {...rest}\n className={className}\n containerPadding={popoverViewportPadding}\n ref={ref}\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n style={popoverWidthStyle(width)}\n >\n {withTip && (\n <Aria.OverlayArrow className={styles.tip}>\n <
|
|
1
|
+
{"version":3,"file":"PopoverContent.mjs","names":[],"sources":["../../../../../../../../../src/components/Popover/components/PopoverContent/PopoverContent.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref, RefObject } from \"react\";\nimport { useContext } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"../../Popover.module.scss\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { useIsActivityActive } from \"@/components/Activity/context\";\nimport { NonModalPopoverContent } from \"../NonModalPopoverContent\";\nimport { PopoverTip } from \"../PopoverTip\";\nimport { popoverViewportPadding } from \"../../viewportPadding\";\nimport { popoverWidthStyle } from \"../../widthStyle\";\n\nexport interface PopoverContentProps\n extends PropsWithChildren, PropsWithClassName {\n withTip?: boolean;\n isDialogContent?: boolean;\n isOpen?: boolean;\n width?: string | number;\n /** @internal Set by `CoachMark`; see `PopoverProps`. */\n modality?: \"modal\" | \"non-modal\";\n onOpenChange: (isOpen: boolean) => void;\n ref?: Ref<HTMLElement>;\n triggerRef?: RefObject<Element | null>;\n}\n\n/**\n * @flr-generate all\n * @flr-ignore-props modality\n */\nexport const PopoverContent: FC<PopoverContentProps> = (props) => {\n const {\n children,\n className,\n isDialogContent = false,\n withTip,\n onOpenChange,\n ref,\n isOpen,\n width,\n modality,\n ...rest\n } = props;\n\n const isActivityActive = useIsActivityActive();\n\n // A trigger hands its popover a ref through the context react-aria sets up,\n // and the non-modal popover has to anchor itself with it.\n const popoverContext = useContext(Aria.PopoverContext);\n const triggerRefFromContext =\n popoverContext && \"triggerRef\" in popoverContext\n ? popoverContext.triggerRef\n : undefined;\n\n // The trigger points its `aria-controls` at this id while the popover is\n // open, so the popover has to carry it — react-aria's own only applies it\n // when the popover is a dialog.\n const idFromContext =\n popoverContext && \"id\" in popoverContext ? popoverContext.id : undefined;\n\n const ContentComponent = isDialogContent ? Aria.Dialog : \"div\";\n\n if (!isActivityActive) {\n return null;\n }\n\n if (modality === \"non-modal\") {\n const anchor = rest.triggerRef ?? triggerRefFromContext;\n\n // Without an anchor there is nothing to position against. react-aria's own\n // popover has the same requirement; it just throws further in.\n if (!anchor) {\n return null;\n }\n\n return (\n <NonModalPopoverContent\n {...rest}\n className={className}\n ref={ref}\n isOpen={isOpen}\n width={width}\n withTip={withTip}\n id={idFromContext}\n triggerRef={anchor}\n onOpenChange={onOpenChange}\n >\n {children}\n </NonModalPopoverContent>\n );\n }\n\n return (\n <Aria.Popover\n {...rest}\n className={className}\n containerPadding={popoverViewportPadding}\n ref={ref}\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n style={popoverWidthStyle(width)}\n >\n {withTip && (\n <Aria.OverlayArrow className={styles.tip}>\n <PopoverTip />\n </Aria.OverlayArrow>\n )}\n <ContentComponent className={styles.content}>{children}</ContentComponent>\n </Aria.Popover>\n );\n};\n\nexport default PopoverContent;\n"],"mappings":";;;;;;;;;;;;;;;;AA4BA,IAAa,kBAA2C,UAAU;CAChE,MAAM,EACJ,UACA,WACA,kBAAkB,OAClB,SACA,cACA,KACA,QACA,OACA,UACA,GAAG,SACD;CAEJ,MAAM,mBAAmB,oBAAoB;CAI7C,MAAM,iBAAiB,WAAW,KAAK,cAAc;CACrD,MAAM,wBACJ,kBAAkB,gBAAgB,iBAC9B,eAAe,aACf,KAAA;CAKN,MAAM,gBACJ,kBAAkB,QAAQ,iBAAiB,eAAe,KAAK,KAAA;CAEjE,MAAM,mBAAmB,kBAAkB,KAAK,SAAS;CAEzD,IAAI,CAAC,kBACH,OAAO;CAGT,IAAI,aAAa,aAAa;EAC5B,MAAM,SAAS,KAAK,cAAc;EAIlC,IAAI,CAAC,QACH,OAAO;EAGT,OACE,oBAAC,wBAAD;GACE,GAAI;GACO;GACN;GACG;GACD;GACE;GACT,IAAI;GACJ,YAAY;GACE;GAEb;EACqB,CAAA;CAE5B;CAEA,OACE,qBAAC,KAAK,SAAN;EACE,GAAI;EACO;EACX,kBAAkB;EACb;EACG;EACM;EACd,OAAO,kBAAkB,KAAK;EAPhC,UAAA,CASG,WACC,oBAAC,KAAK,cAAN;GAAmB,WAAW,uBAAO;GACnC,UAAA,oBAAC,YAAD,CAAa,CAAA;EACI,CAAA,GAErB,oBAAC,kBAAD;GAAkB,WAAW,uBAAO;GAAU;EAA2B,CAAA,CAC7D;;AAElB"}
|
package/dist/js/packages/components/src/components/Popover/components/PopoverTip/PopoverTip.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import Popover_module_default from "../../Popover.module.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Popover/components/PopoverTip/PopoverTip.tsx
|
|
6
|
+
var PopoverTip = () => /* @__PURE__ */ jsx("svg", {
|
|
7
|
+
className: Popover_module_default.tipIcon,
|
|
8
|
+
width: 16,
|
|
9
|
+
height: 16,
|
|
10
|
+
viewBox: "0 0 16 16",
|
|
11
|
+
"aria-hidden": true,
|
|
12
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0 L8 8 L16 0" })
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { PopoverTip };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=PopoverTip.mjs.map
|
package/dist/js/packages/components/src/components/Popover/components/PopoverTip/PopoverTip.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverTip.mjs","names":[],"sources":["../../../../../../../../../src/components/Popover/components/PopoverTip/PopoverTip.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport styles from \"../../Popover.module.scss\";\n\n/*\n * The tip's shape — and only the shape. What positions it differs per popover\n * path: the modal one uses `Aria.OverlayArrow`, which takes the placement from\n * a context that only `Aria.Popover` puts up and that react-aria-components\n * does not export, while the non-modal one builds its wrapper from what\n * `useOverlayPosition` hands it. Both wrappers carry `.tip`; `.tipIcon` is the\n * hook `Popover.module.scss` fills, strokes and turns to face the trigger.\n */\nexport const PopoverTip: FC = () => (\n <svg\n className={styles.tipIcon}\n width={16}\n height={16}\n viewBox=\"0 0 16 16\"\n aria-hidden\n >\n <path d=\"M0 0 L8 8 L16 0\" />\n </svg>\n);\n"],"mappings":";;;;;AAWA,IAAa,mBACX,oBAAC,OAAD;CACE,WAAW,uBAAO;CAClB,OAAO;CACP,QAAQ;CACR,SAAQ;CACR,eAAA;CAEA,UAAA,oBAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA;AACxB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.module.mjs","names":[],"sources":["../../../../../../../src/components/ProgressBar/ProgressBar.module.scss"],"sourcesContent":[".progressBar {\n display: grid;\n grid-template-areas:\n \"label value\"\n \"bar bar\";\n grid-template-columns: 1fr auto;\n column-gap: var(--progress-bar--spacing-x);\n width: 100%;\n font-size: var(--progress-bar--font-size);\n\n @extend .size-m;\n @extend .info;\n\n &:has(.legend) {\n grid-template-areas:\n \"label value\"\n \"bar bar\"\n \"legend legend\";\n }\n\n /* Elements */\n\n .label {\n grid-area: label;\n }\n\n .value {\n grid-area: value;\n font-weight: var(--progress-bar--value-font-weight);\n }\n\n .bar {\n grid-area: bar;\n border-radius: var(--progress-bar--corner-radius);\n background-color: var(--progress-bar--background-color);\n box-shadow: inset 0 0 0 var(--progress-bar--border-width)\n var(--progress-bar--border-color);\n overflow: hidden;\n margin-top: var(--progress-bar--spacing-y);\n }\n\n .fill {\n height: 100%;\n display: flex;\n }\n\n .legend {\n grid-area: legend;\n margin-top: var(--progress-bar--spacing-bar-to-legend);\n }\n\n /* Size */\n\n &.size-s {\n font-size: var(--progress-bar--font-size-s);\n }\n\n /* Sizes */\n\n @mixin size($size) {\n &.size-#{$size} {\n .bar {\n height: var(--progress-bar--height--#{$size});\n }\n }\n }\n\n @include size(s);\n @include size(m);\n @include size(l);\n\n /* Variants */\n\n @mixin status($status) {\n &.#{$status} {\n .fill {\n background: var(--progress-bar--#{$status}-fill-background-color);\n }\n }\n }\n\n @include status(info);\n @include status(success);\n @include status(danger);\n @include status(warning);\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ProgressBar.module.mjs","names":[],"sources":["../../../../../../../src/components/ProgressBar/ProgressBar.module.scss"],"sourcesContent":[".progressBar {\n display: grid;\n grid-template-areas:\n \"label value\"\n \"bar bar\";\n grid-template-columns: 1fr auto;\n column-gap: var(--progress-bar--spacing-x);\n width: 100%;\n font-size: var(--progress-bar--font-size);\n\n @extend .size-m;\n @extend .info;\n\n &:has(.legend) {\n grid-template-areas:\n \"label value\"\n \"bar bar\"\n \"legend legend\";\n }\n\n /* Elements */\n\n .label {\n grid-area: label;\n }\n\n .value {\n grid-area: value;\n font-weight: var(--progress-bar--value-font-weight);\n }\n\n .bar {\n grid-area: bar;\n border-radius: var(--progress-bar--corner-radius);\n background-color: var(--progress-bar--background-color);\n box-shadow: inset 0 0 0 var(--progress-bar--border-width)\n var(--progress-bar--border-color);\n overflow: hidden;\n margin-top: var(--progress-bar--spacing-y);\n }\n\n .fill {\n height: 100%;\n display: flex;\n animation: progress-bar-fill var(--progress-bar--transition-duration) ease;\n }\n\n .legend {\n grid-area: legend;\n margin-top: var(--progress-bar--spacing-bar-to-legend);\n }\n\n /* Size */\n\n &.size-s {\n font-size: var(--progress-bar--font-size-s);\n }\n\n /* Sizes */\n\n @mixin size($size) {\n &.size-#{$size} {\n .bar {\n height: var(--progress-bar--height--#{$size});\n }\n }\n }\n\n @include size(s);\n @include size(m);\n @include size(l);\n\n /* Variants */\n\n @mixin status($status) {\n &.#{$status} {\n .fill {\n background: var(--progress-bar--#{$status}-fill-background-color);\n }\n }\n }\n\n @include status(info);\n @include status(success);\n @include status(danger);\n @include status(warning);\n}\n\n/* The implicit \"to\" keyframe picks up the fill's inline width. */\n@keyframes progress-bar-fill {\n from {\n width: 0%;\n }\n}\n"],"mappings":""}
|
package/dist/js/packages/components/src/components/RadioGroup/components/Radio/Radio.module.mjs
CHANGED
|
@@ -5,7 +5,8 @@ var radio = "flow--radio-group--radio";
|
|
|
5
5
|
var icon = "flow--radio-group--radio--icon";
|
|
6
6
|
var Radio_module_default = {
|
|
7
7
|
radio,
|
|
8
|
-
icon
|
|
8
|
+
icon,
|
|
9
|
+
"radio-pop": "flow--radio-group--radio--radio-pop"
|
|
9
10
|
};
|
|
10
11
|
//#endregion
|
|
11
12
|
export { Radio_module_default as default, icon, radio };
|
package/dist/js/packages/components/src/components/RadioGroup/components/Radio/Radio.module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.module.mjs","names":[],"sources":["../../../../../../../../../src/components/RadioGroup/components/Radio/Radio.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.radio {\n display: grid;\n column-gap: var(--form-control--spacing-x);\n grid-template-columns: auto 1fr;\n width: fit-content;\n\n @include focus.focus;\n\n .icon {\n color: var(--choice--icon-color--default);\n }\n\n &[data-selected] {\n .icon {\n color: var(--choice--icon-color--selected);\n }\n }\n\n &[data-disabled] {\n color: var(--text--color--disabled);\n\n .icon {\n color: var(--choice--icon-color--disabled);\n }\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Radio.module.mjs","names":[],"sources":["../../../../../../../../../src/components/RadioGroup/components/Radio/Radio.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.radio {\n display: grid;\n column-gap: var(--form-control--spacing-x);\n grid-template-columns: auto 1fr;\n width: fit-content;\n\n @include focus.focus;\n\n .icon {\n color: var(--choice--icon-color--default);\n }\n\n &[data-selected] {\n .icon {\n color: var(--choice--icon-color--selected);\n\n /* Subtle pop when the filled dot mounts on selection. */\n animation: radio-pop var(--transition--duration--fast)\n cubic-bezier(0.2, 0, 0, 1);\n }\n }\n\n &[data-disabled] {\n color: var(--text--color--disabled);\n\n .icon {\n color: var(--choice--icon-color--disabled);\n }\n }\n}\n\n@keyframes radio-pop {\n from {\n transform: scale(0.9);\n opacity: 0.5;\n }\n\n to {\n transform: scale(1);\n opacity: 1;\n }\n}\n"],"mappings":""}
|
|
@@ -6,16 +6,16 @@ var clearButton = "flow--search-field--clear-button";
|
|
|
6
6
|
var searchIcon = "flow--search-field--search-icon";
|
|
7
7
|
var kbd = "flow--search-field--kbd";
|
|
8
8
|
var inputContainer = "flow--search-field--input-container";
|
|
9
|
-
var readonly = "flow--search-field--readonly";
|
|
10
9
|
var input = "flow--search-field--input";
|
|
10
|
+
var readonly = "flow--search-field--readonly";
|
|
11
11
|
var SearchField_module_default = {
|
|
12
12
|
searchField,
|
|
13
13
|
clearButton,
|
|
14
14
|
searchIcon,
|
|
15
15
|
kbd,
|
|
16
16
|
inputContainer,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
input,
|
|
18
|
+
readonly
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
export { clearButton, SearchField_module_default as default, input, inputContainer, kbd, readonly, searchField, searchIcon };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.module.mjs","names":[],"sources":["../../../../../../../src/components/SearchField/SearchField.module.scss"],"sourcesContent":["@use \"@/styles/mixins/formControl\";\n\n.searchField {\n &[data-empty] .clearButton {\n display: none;\n }\n\n .searchIcon {\n color: var(--form-control--placeholder-color--default);\n margin-inline: var(--size-px--s);\n }\n\n .kbd {\n margin-inline-end: var(--size-px--m);\n }\n\n &:disabled,\n &[data-disabled],\n [aria-disabled] & {\n .inputContainer {\n background-color: var(--form-control--background-color--disabled);\n border-color: var(--form-control--border-color--disabled);\n }\n\n .searchIcon {\n color: var(--form-control--placeholder-color--disabled);\n }\n\n input::placeholder {\n color: var(--form-control--placeholder-color--disabled);\n }\n }\n}\n\n.inputContainer {\n order: 2;\n display: flex;\n position: relative;\n align-items: center;\n\n @include formControl.formControl();\n\n & {\n padding: 0;\n }\n\n .input {\n border: none;\n background: none;\n padding-block: calc(\n var(--form-control--padding-y) - var(--form-control--border-width)\n );\n flex-grow: 1;\n min-width: 0;\n\n &::-webkit-search-cancel-button,\n &::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n &::placeholder {\n color: var(--form-control--placeholder-color--default);\n }\n\n &[data-focused],\n &:focus-visible {\n outline: none;\n }\n }\n\n .clearButton {\n padding-block: initial;\n align-self: stretch;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SearchField.module.mjs","names":[],"sources":["../../../../../../../src/components/SearchField/SearchField.module.scss"],"sourcesContent":["@use \"@/styles/mixins/formControl\";\n\n.searchField {\n &[data-empty] .clearButton {\n display: none;\n }\n\n .searchIcon {\n color: var(--form-control--placeholder-color--default);\n margin-inline: var(--size-px--s);\n }\n\n .kbd {\n margin-inline-end: var(--size-px--m);\n }\n\n &:disabled,\n &[data-disabled],\n [aria-disabled] & {\n .inputContainer {\n background-color: var(--form-control--background-color--disabled);\n border-color: var(--form-control--border-color--disabled);\n }\n\n .searchIcon {\n color: var(--form-control--placeholder-color--disabled);\n }\n\n .input::placeholder {\n color: var(--form-control--placeholder-color--disabled);\n }\n }\n}\n\n.inputContainer {\n order: 2;\n display: flex;\n position: relative;\n align-items: center;\n\n @include formControl.formControl();\n\n & {\n padding: 0;\n }\n\n .input {\n border: none;\n background: none;\n padding-block: calc(\n var(--form-control--padding-y) - var(--form-control--border-width)\n );\n flex-grow: 1;\n min-width: 0;\n\n &::-webkit-search-cancel-button,\n &::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n &::placeholder {\n color: var(--form-control--placeholder-color--default);\n }\n\n &[data-focused],\n &:focus-visible {\n outline: none;\n }\n }\n\n .clearButton {\n padding-block: initial;\n align-self: stretch;\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.module.mjs","names":[],"sources":["../../../../../../../src/components/Section/Section.module.scss"],"sourcesContent":[".section {\n display: flex;\n flex-direction: column;\n row-gap: var(--section--spacing);\n
|
|
1
|
+
{"version":3,"file":"Section.module.mjs","names":[],"sources":["../../../../../../../src/components/Section/Section.module.scss"],"sourcesContent":[".section {\n display: flex;\n flex-direction: column;\n row-gap: var(--section--spacing);\n width: 100%;\n min-width: 0;\n\n // A consumer `Form` wrapping the section content. `Form` is a plain FC, so\n // the props context cannot give it a class.\n // stylelint-disable-next-line selector-max-type -- consumer form, no class\n > form {\n display: flex;\n flex-direction: column;\n row-gap: var(--section--spacing);\n }\n\n /* Children that render nothing still leave the element behind — the guard in\n Section.tsx only sees the child, not its output (a boundary returning null,\n an empty fragment, a map over an empty array). Collapse it so it neither\n draws its own separator nor claims section-to-section spacing, while\n staying in the sibling chain so the next section keeps exactly one\n separator. */\n &:empty {\n display: none;\n }\n\n + .section {\n margin-block-start: var(--section--section-to-section-spacing);\n }\n\n &:not(.hideSeparator) + .section {\n border-block-start: var(--separator--height) var(--border-style--default)\n var(--separator--color);\n padding-block-start: var(--section--section-to-section-spacing);\n }\n\n /* Keys on the heading's rendered element, not on `Heading`'s level class: a\n `Heading` with `elementType` renders a span/p that carries the level class\n but must not claim heading-to-content spacing. */\n // stylelint-disable selector-max-type -- element type is the signal, see above\n h2.heading:not(:first-child),\n h3.heading:not(:first-child) {\n margin-top: var(--section--sub-heading-spacing-m);\n }\n\n h4.heading:not(:first-child),\n h5.heading:not(:first-child),\n h6.heading:not(:first-child) {\n margin-top: var(--section--sub-heading-spacing-s);\n }\n // stylelint-enable selector-max-type\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.module.mjs","names":[],"sources":["../../../../../../../../../src/components/Section/components/SectionHeader/SectionHeader.module.scss"],"sourcesContent":[".sectionHeader {\n display: flex;\n gap: var(--section-header--heading-to-action-spacing);\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n\n .actions {\n display: flex;\n gap: var(--section-header--action-to-action-spacing);\n margin-inline-start: auto;\n flex-wrap: wrap;\n align-items: center;\n }\n\n &:not(:first-child):has(h2),\n &:not(:first-child):has(h3) {\n margin-top: var(--section--sub-heading-spacing-m);\n }\n\n &:not(:first-child):has(h4),\n &:not(:first-child):has(h5),\n &:not(:first-child):has(h6) {\n margin-top: var(--section--sub-heading-spacing-s);\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SectionHeader.module.mjs","names":[],"sources":["../../../../../../../../../src/components/Section/components/SectionHeader/SectionHeader.module.scss"],"sourcesContent":[".sectionHeader {\n display: flex;\n gap: var(--section-header--heading-to-action-spacing);\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n\n .actions {\n display: flex;\n gap: var(--section-header--action-to-action-spacing);\n margin-inline-start: auto;\n flex-wrap: wrap;\n align-items: center;\n }\n\n /* Keys on the heading's rendered element, not on `Heading`'s level class: a\n `Heading` with `elementType` renders a span/p that carries the level class\n but must not claim heading-to-content spacing. */\n // stylelint-disable selector-max-type -- element type is the signal, see above\n &:not(:first-child):has(h2),\n &:not(:first-child):has(h3) {\n margin-top: var(--section--sub-heading-spacing-m);\n }\n\n &:not(:first-child):has(h4),\n &:not(:first-child):has(h5),\n &:not(:first-child):has(h6) {\n margin-top: var(--section--sub-heading-spacing-s);\n }\n // stylelint-enable selector-max-type\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.module.mjs","names":[],"sources":["../../../../../../../src/components/Slider/Slider.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.slider {\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: var(--slider--spacing-y);\n\n --button-size: calc(\n var(--button--line-height-s) + var(--button--padding-s-y) * 2\n );\n\n .text {\n text-align: center;\n align-items: end;\n padding-inline: calc(var(--button-size) + var(--slider--spacing-x));\n padding-top: calc(var(--slider--spacing-y) / 2);\n\n
|
|
1
|
+
{"version":3,"file":"Slider.module.mjs","names":[],"sources":["../../../../../../../src/components/Slider/Slider.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.slider {\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: var(--slider--spacing-y);\n\n --button-size: calc(\n var(--button--line-height-s) + var(--button--padding-s-y) * 2\n );\n\n .text {\n text-align: center;\n align-items: end;\n padding-inline: calc(var(--button-size) + var(--slider--spacing-x));\n padding-top: calc(var(--slider--spacing-y) / 2);\n\n .value {\n font-size: var(--font-size-text--s);\n font-weight: var(--slider--value-font-weight);\n }\n\n .label {\n margin: 0;\n display: inline-flex;\n column-gap: var(--label--spacing);\n }\n }\n\n .track {\n grid-area: track;\n position: relative;\n height: var(--slider--track-height);\n background-color: var(--slider--track-color--default);\n width: 100%;\n border-radius: var(--slider--corner-radius);\n border: var(--slider--track-border-width) var(--slider--track-border-style)\n var(--slider--track-border-color--default);\n }\n\n .fill {\n position: absolute;\n height: var(--slider--track-height);\n background-color: var(--slider--color--default);\n top: calc(50% - var(--slider--track-height) / 2);\n border-radius: var(--slider--corner-radius);\n }\n\n .initialMarker {\n position: absolute;\n height: var(--slider--initial-marker-height);\n width: var(--slider--initial-marker-border-width);\n background-color: var(--slider--color--default);\n top: calc(50% - var(--slider--initial-marker-height) / 2);\n border-radius: var(--slider--corner-radius);\n }\n\n .handle {\n width: var(--slider--handle-size);\n height: var(--slider--handle-size);\n border-radius: var(--slider--handle-corner-radius);\n background-color: var(--slider--handle-fill-color);\n border: var(--slider--handle-border-width) var(--slider--track-border-style)\n var(--slider--color--default);\n forced-color-adjust: none;\n top: 50%;\n transition-property: background-color;\n transition-duration: var(--transition--duration--default);\n\n &[data-dragging],\n &[data-focus-visible] {\n background-color: var(--slider--color--default);\n }\n\n &[data-focus-visible] {\n @include focus.focus;\n\n & {\n outline-offset: var(--size-px--xs);\n }\n }\n }\n\n .increment,\n .decrement {\n position: absolute;\n top: calc((var(--slider--spacing-y) + var(--button-size)) * -1);\n }\n\n .increment {\n inset-inline-end: 0;\n }\n\n .decrement {\n inset-inline-start: 0;\n }\n\n &.disabled {\n .track {\n background-color: var(--slider--track-color--disabled);\n border-color: var(--slider--track-border-color--disabled);\n }\n\n .fill {\n background-color: var(--slider--color--disabled);\n }\n\n .handle {\n border-color: var(--slider--color--disabled);\n }\n\n .text {\n color: var(--text--color--disabled);\n }\n }\n}\n\n/*\n.slider {\n\n\n\n\n\n\n\n\n\n}\n*/\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.module.mjs","names":[],"sources":["../../../../../../../src/components/Switch/Switch.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n@use \"@/styles/mixins/formControl\";\n\n.switch {\n @include formControl.formHiddenInputScrollBehaviorFix;\n\n display: flex;\n align-items: center;\n column-gap: var(--switch--label-to-track-spacing);\n\n &.label-leading {\n flex-direction: row-reverse;\n }\n\n /* Elements */\n .track {\n width: var(--switch--track-width);\n height: var(--switch--track-height);\n background-color: var(--switch--track-background-color--default);\n border-radius: var(--switch--track-corner-radius);\n padding: var(--switch--track-padding);\n flex-shrink: 0;\n position: relative;\n transition-property: background-color;\n transition-duration: var(--transition--duration--default);\n align-self: start;\n\n @include focus.focus;\n }\n\n .handle {\n display: flex;\n justify-content: center;\n align-items: center;\n width: var(--switch--handle-size);\n height: var(--switch--handle-size);\n background-color: var(--switch--handle-background-color);\n border-radius: var(--corner-radius--round);\n transition-property: transform;\n transition-duration: var(--transition--duration--default);\n transform: translateX(0);\n position: absolute;\n top: var(--switch--track-padding);\n inset-inline-start: var(--switch--track-padding);\n }\n\n .label {\n margin: 0;\n }\n\n /* States */\n\n &[data-focus-visible] .track {\n outline-style: solid;\n }\n\n &[data-selected] {\n .track {\n background-color: var(--switch--track-background-color--selected);\n }\n\n .handle {\n transform: translate(100%);\n }\n }\n\n &[data-disabled] {\n .track {\n background-color: var(--switch--track-background-color--disabled);\n color: var(--switch--track-background-color--disabled);\n }\n\n .handle {\n color: var(--switch--handle-content-color--disabled);\n }\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Switch.module.mjs","names":[],"sources":["../../../../../../../src/components/Switch/Switch.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n@use \"@/styles/mixins/formControl\";\n\n.switch {\n @include formControl.formHiddenInputScrollBehaviorFix;\n\n display: flex;\n align-items: center;\n column-gap: var(--switch--label-to-track-spacing);\n\n &.label-leading {\n flex-direction: row-reverse;\n }\n\n /* Elements */\n .track {\n width: var(--switch--track-width);\n height: var(--switch--track-height);\n background-color: var(--switch--track-background-color--default);\n border-radius: var(--switch--track-corner-radius);\n padding: var(--switch--track-padding);\n flex-shrink: 0;\n position: relative;\n transition-property: background-color;\n transition-duration: var(--transition--duration--default);\n align-self: start;\n\n @include focus.focus;\n }\n\n .handle {\n display: flex;\n justify-content: center;\n align-items: center;\n width: var(--switch--handle-size);\n height: var(--switch--handle-size);\n background-color: var(--switch--handle-background-color);\n border-radius: var(--corner-radius--round);\n transition-property: transform;\n transition-duration: var(--transition--duration--default);\n\n /* Subtle overshoot: the handle settles with a slight spring, like a\n physical toggle. */\n transition-timing-function: cubic-bezier(0.34, 1.35, 0.5, 1);\n transform: translateX(0);\n position: absolute;\n top: var(--switch--track-padding);\n inset-inline-start: var(--switch--track-padding);\n }\n\n .label {\n margin: 0;\n }\n\n /* States */\n\n &[data-focus-visible] .track {\n outline-style: solid;\n }\n\n &[data-selected] {\n .track {\n background-color: var(--switch--track-background-color--selected);\n }\n\n .handle {\n transform: translate(100%);\n }\n }\n\n &[data-disabled] {\n .track {\n background-color: var(--switch--track-background-color--disabled);\n color: var(--switch--track-background-color--disabled);\n }\n\n .handle {\n color: var(--switch--handle-content-color--disabled);\n }\n }\n}\n"],"mappings":""}
|
|
@@ -27,7 +27,7 @@ var TabNavigation = flowComponent("TabNavigation", (props) => {
|
|
|
27
27
|
const { listRef, moreRef, visibleCount, hasOverflow, menuHasCurrentItem } = useCollapsingItems();
|
|
28
28
|
const rootClassName = clsx(TabNavigation_module_default.tabNavigation, hasOverflow && TabNavigation_module_default.collapsed, className);
|
|
29
29
|
const propsContext = { Link: {
|
|
30
|
-
wrapWith: /* @__PURE__ */ jsx("li", {}),
|
|
30
|
+
wrapWith: /* @__PURE__ */ jsx("li", { className: TabNavigation_module_default.item }),
|
|
31
31
|
className: TabNavigation_module_default.link,
|
|
32
32
|
unstyled: true,
|
|
33
33
|
children: dynamic((linkProps) => /* @__PURE__ */ jsx(LinkContent, { linkProps }))
|
|
@@ -38,6 +38,7 @@ var TabNavigation = flowComponent("TabNavigation", (props) => {
|
|
|
38
38
|
...rest,
|
|
39
39
|
ref,
|
|
40
40
|
children: [/* @__PURE__ */ jsx("ul", {
|
|
41
|
+
className: TabNavigation_module_default.list,
|
|
41
42
|
ref: listRef,
|
|
42
43
|
children: /* @__PURE__ */ jsx(PropsContextProvider, {
|
|
43
44
|
props: propsContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabNavigation.mjs","names":[],"sources":["../../../../../../../src/components/TabNavigation/TabNavigation.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Text } from \"@/components/Text\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\nimport { LinkContent } from \"./components/LinkContent\";\nimport styles from \"./TabNavigation.module.scss\";\nimport locales from \"./locales/*.locale.json\";\nimport { useCollapsingItems } from \"./lib/useCollapsingItems\";\n\nexport interface TabNavigationProps\n extends\n PropsWithChildren<ComponentProps<\"nav\">>,\n PropsWithClassName,\n FlowComponentProps<HTMLElement> {}\n\n/**\n * @flr-generate all\n * @flowStatus new\n */\nexport const TabNavigation = flowComponent(\"TabNavigation\", (props) => {\n const { children, className, ref, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"TabNavigation\");\n\n const { listRef, moreRef, visibleCount, hasOverflow, menuHasCurrentItem } =\n useCollapsingItems();\n\n const rootClassName = clsx(\n styles.tabNavigation,\n hasOverflow && styles.collapsed,\n className,\n );\n\n const propsContext: PropsContext = {\n Link: {\n wrapWith: <li />,\n className: styles.link,\n unstyled: true,\n children: dynamic((linkProps) => <LinkContent linkProps={linkProps} />),\n },\n };\n\n return (\n <nav className={rootClassName} role=\"navigation\" {...rest} ref={ref}>\n <ul ref={listRef}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ul>\n <div className={styles.more} ref={moreRef}>\n <ContextMenuTriggerView>\n <Button\n unstyled\n className={clsx(\n styles.moreButton,\n menuHasCurrentItem && styles.current,\n )}\n >\n <Text emulateBoldWidth>\n {stringFormatter.format(\"moreButton.title\")}\n </Text>\n <IconChevronDown />\n </Button>\n <ContextMenuView placement=\"bottom end\">\n <UiComponentTunnelExit\n id=\"menuItems\"\n component=\"TabNavigation\"\n children={(menuItems) =>\n Array.isArray(menuItems)\n ? menuItems.slice(visibleCount ?? menuItems.length)\n : menuItems\n }\n />\n </ContextMenuView>\n </ContextMenuTriggerView>\n </div>\n </nav>\n );\n});\n\nexport default TabNavigation;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,gBAAgB,cAAc,kBAAkB,UAAU;CACrE,MAAM,EAAE,UAAU,WAAW,KAAK,GAAG,SAAS;CAE9C,MAAM,kBAAkB,4BAA4B,kBAAS,eAAe;CAE5E,MAAM,EAAE,SAAS,SAAS,cAAc,aAAa,uBACnD,mBAAmB;CAErB,MAAM,gBAAgB,KACpB,6BAAO,eACP,eAAe,6BAAO,WACtB,SACF;CAEA,MAAM,eAA6B,EACjC,MAAM;EACJ,UAAU,oBAAC,MAAD,
|
|
1
|
+
{"version":3,"file":"TabNavigation.mjs","names":[],"sources":["../../../../../../../src/components/TabNavigation/TabNavigation.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Text } from \"@/components/Text\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport ContextMenuTriggerView from \"@/views/ContextMenuTriggerView\";\nimport ContextMenuView from \"@/views/ContextMenuView\";\nimport { LinkContent } from \"./components/LinkContent\";\nimport styles from \"./TabNavigation.module.scss\";\nimport locales from \"./locales/*.locale.json\";\nimport { useCollapsingItems } from \"./lib/useCollapsingItems\";\n\nexport interface TabNavigationProps\n extends\n PropsWithChildren<ComponentProps<\"nav\">>,\n PropsWithClassName,\n FlowComponentProps<HTMLElement> {}\n\n/**\n * @flr-generate all\n * @flowStatus new\n */\nexport const TabNavigation = flowComponent(\"TabNavigation\", (props) => {\n const { children, className, ref, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"TabNavigation\");\n\n const { listRef, moreRef, visibleCount, hasOverflow, menuHasCurrentItem } =\n useCollapsingItems();\n\n const rootClassName = clsx(\n styles.tabNavigation,\n hasOverflow && styles.collapsed,\n className,\n );\n\n const propsContext: PropsContext = {\n Link: {\n wrapWith: <li className={styles.item} />,\n className: styles.link,\n unstyled: true,\n children: dynamic((linkProps) => <LinkContent linkProps={linkProps} />),\n },\n };\n\n return (\n <nav className={rootClassName} role=\"navigation\" {...rest} ref={ref}>\n <ul className={styles.list} ref={listRef}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ul>\n <div className={styles.more} ref={moreRef}>\n <ContextMenuTriggerView>\n <Button\n unstyled\n className={clsx(\n styles.moreButton,\n menuHasCurrentItem && styles.current,\n )}\n >\n <Text emulateBoldWidth>\n {stringFormatter.format(\"moreButton.title\")}\n </Text>\n <IconChevronDown />\n </Button>\n <ContextMenuView placement=\"bottom end\">\n <UiComponentTunnelExit\n id=\"menuItems\"\n component=\"TabNavigation\"\n children={(menuItems) =>\n Array.isArray(menuItems)\n ? menuItems.slice(visibleCount ?? menuItems.length)\n : menuItems\n }\n />\n </ContextMenuView>\n </ContextMenuTriggerView>\n </div>\n </nav>\n );\n});\n\nexport default TabNavigation;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,gBAAgB,cAAc,kBAAkB,UAAU;CACrE,MAAM,EAAE,UAAU,WAAW,KAAK,GAAG,SAAS;CAE9C,MAAM,kBAAkB,4BAA4B,kBAAS,eAAe;CAE5E,MAAM,EAAE,SAAS,SAAS,cAAc,aAAa,uBACnD,mBAAmB;CAErB,MAAM,gBAAgB,KACpB,6BAAO,eACP,eAAe,6BAAO,WACtB,SACF;CAEA,MAAM,eAA6B,EACjC,MAAM;EACJ,UAAU,oBAAC,MAAD,EAAI,WAAW,6BAAO,KAAO,CAAA;EACvC,WAAW,6BAAO;EAClB,UAAU;EACV,UAAU,SAAS,cAAc,oBAAC,aAAD,EAAwB,UAAY,CAAA,CAAC;CACxE,EACF;CAEA,OACE,qBAAC,OAAD;EAAK,WAAW;EAAe,MAAK;EAAa,GAAI;EAAW;EAAhE,UAAA,CACE,oBAAC,MAAD;GAAI,WAAW,6BAAO;GAAM,KAAK;GAC/B,UAAA,oBAAC,sBAAD;IAAsB,OAAO;IAC1B;GACmB,CAAA;EACpB,CAAA,GACJ,oBAAC,OAAD;GAAK,WAAW,6BAAO;GAAM,KAAK;GAChC,UAAA,qBAAC,wBAAD,EAAA,UAAA,CACE,qBAAC,QAAD;IACE,UAAA;IACA,WAAW,KACT,6BAAO,YACP,sBAAsB,6BAAO,OAC/B;IALF,UAAA,CAOE,oBAAC,MAAD;KAAM,kBAAA;KACH,UAAA,gBAAgB,OAAO,kBAAkB;IACtC,CAAA,GACN,oBAAC,iBAAD,CAAkB,CAAA,CACZ;GACR,CAAA,GAAA,oBAAC,iBAAD;IAAiB,WAAU;IACzB,UAAA,oBAAC,uBAAD;KACE,IAAG;KACH,WAAU;KACV,WAAW,cACT,MAAM,QAAQ,SAAS,IACnB,UAAU,MAAM,gBAAgB,UAAU,MAAM,IAChD;IAEP,CAAA;GACc,CAAA,CACK,EAAA,CAAA;EACrB,CAAA,CACF;;AAET,CAAC"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
//#region src/components/TabNavigation/TabNavigation.module.scss
|
|
4
4
|
var tabNavigation = "flow--tab-navigation";
|
|
5
|
+
var list = "flow--tab-navigation--list";
|
|
6
|
+
var item = "flow--tab-navigation--item";
|
|
5
7
|
var link = "flow--tab-navigation--link";
|
|
6
8
|
var text = "flow--tab-navigation--text";
|
|
7
9
|
var more = "flow--tab-navigation--more";
|
|
@@ -10,6 +12,8 @@ var current = "flow--tab-navigation--current";
|
|
|
10
12
|
var collapsed = "flow--tab-navigation--collapsed";
|
|
11
13
|
var TabNavigation_module_default = {
|
|
12
14
|
tabNavigation,
|
|
15
|
+
list,
|
|
16
|
+
item,
|
|
13
17
|
link,
|
|
14
18
|
text,
|
|
15
19
|
more,
|
|
@@ -18,6 +22,6 @@ var TabNavigation_module_default = {
|
|
|
18
22
|
collapsed
|
|
19
23
|
};
|
|
20
24
|
//#endregion
|
|
21
|
-
export { collapsed, current, TabNavigation_module_default as default, link, more, moreButton, tabNavigation, text };
|
|
25
|
+
export { collapsed, current, TabNavigation_module_default as default, item, link, list, more, moreButton, tabNavigation, text };
|
|
22
26
|
|
|
23
27
|
//# sourceMappingURL=TabNavigation.module.mjs.map
|
package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabNavigation.module.mjs","names":[],"sources":["../../../../../../../src/components/TabNavigation/TabNavigation.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.tabNavigation {\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: stretch;\n background-color: var(--tab-navigation--background-color--default);\n\n
|
|
1
|
+
{"version":3,"file":"TabNavigation.module.mjs","names":[],"sources":["../../../../../../../src/components/TabNavigation/TabNavigation.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.tabNavigation {\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: stretch;\n background-color: var(--tab-navigation--background-color--default);\n\n .list {\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n min-width: 0;\n overflow-x: clip;\n }\n\n .item {\n display: flex;\n list-style: none;\n }\n\n /* Elements */\n\n .link {\n display: flex;\n align-items: center;\n column-gap: var(--tab-navigation--spacing);\n padding: var(--tab-navigation--padding);\n background-color: var(--tab-navigation--background-color--default);\n color: var(--tab-navigation--color);\n white-space: nowrap;\n transition-property: background-color;\n\n @include focus.focus;\n\n & {\n outline-offset: calc(var(--size-px--xs) * -1);\n }\n\n &:hover {\n background-color: var(--tab-navigation--background-color--hover);\n transition-duration: var(--transition--duration--default);\n }\n\n &[data-pressed] {\n background-color: var(--tab-navigation--background-color--pressed);\n transition-duration: var(--transition--duration--default);\n }\n\n &[aria-current] {\n background-color: var(--tab-navigation--background-color--current);\n font-weight: var(--tab-navigation--font-weight--current);\n }\n }\n\n .text {\n display: flex;\n align-items: center;\n column-gap: var(--tab-navigation--spacing);\n }\n\n .more {\n display: flex;\n align-items: stretch;\n\n /* Rendered (but hidden) when there is no overflow, so its width can be\n reserved before items are collapsed. */\n visibility: hidden;\n position: absolute;\n inset-inline-end: 0;\n }\n\n .moreButton {\n display: flex;\n align-items: center;\n column-gap: var(--tab-navigation--spacing);\n padding: var(--tab-navigation--padding);\n border: none;\n border-radius: 0;\n background-color: var(--tab-navigation--background-color--default);\n color: var(--tab-navigation--color);\n cursor: pointer;\n white-space: nowrap;\n transition-property: background-color;\n\n @include focus.focus;\n\n & {\n outline-offset: calc(var(--size-px--xs) * -1);\n }\n\n &:hover {\n background-color: var(--tab-navigation--background-color--hover);\n transition-duration: var(--transition--duration--default);\n }\n\n &[data-pressed] {\n background-color: var(--tab-navigation--background-color--pressed);\n transition-duration: var(--transition--duration--default);\n }\n\n &.current,\n &.current:hover {\n background-color: var(--tab-navigation--background-color--current);\n font-weight: var(--tab-navigation--font-weight--current);\n }\n }\n\n /* States */\n\n &.collapsed {\n .more {\n visibility: visible;\n position: static;\n }\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.module.mjs","names":[],"sources":["../../../../../../../src/components/Table/Table.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n.tableContainer {\n @include scrollbar.scrollbar;\n\n width: 100%;\n overflow-x: auto;\n}\n\n.tableScrollArea {\n width: 100%;\n}\n\n.table {\n border-radius: var(--table--corner-radius);\n overflow: hidden;\n width: 100%;\n border-width: var(--table--border-width);\n border-style: var(--table--border-style);\n border-color: var(--table--border-color);\n border-spacing: 0;\n background-color: var(--table--background-color);\n\n .column {\n font-weight: var(--table--header-font-weight);\n\n &:empty {\n display: none;\n }\n }\n\n .cell,\n .column {\n padding-inline: var(--table--padding-x);\n padding-block: var(--table--padding-y);\n text-align: start;\n vertical-align: top;\n border-style: var(--table--border-style);\n border-color: var(--table--border-color);\n border-width: 0;\n\n > svg {\n vertical-align: bottom;\n }\n\n &.horizontal-align-center {\n text-align: center;\n }\n\n &.horizontal-align-end {\n text-align: end;\n }\n }\n\n .header {\n .column {\n border-block-end-width: var(--table--header-border-width);\n }\n\n &:empty {\n display: none;\n }\n }\n\n :where(.body) {\n :where(.row) {\n &:where(:nth-of-type(odd):not(.footer)) {\n background-color: var(--table--background-color-accent);\n }\n\n &:not(:last-child) {\n .cell {\n border-block-end-width: var(--table--border-width);\n }\n }\n\n &.footer .cell {\n border-block-start-width: var(--table--border-width);\n }\n }\n }\n\n &.vertical-align-middle {\n .cell,\n .column {\n vertical-align: middle;\n }\n }\n\n &.layout-auto {\n table-layout: auto;\n }\n\n &.layout-fixed {\n table-layout: fixed;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Table.module.mjs","names":[],"sources":["../../../../../../../src/components/Table/Table.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n.tableContainer {\n @include scrollbar.scrollbar;\n\n width: 100%;\n overflow-x: auto;\n}\n\n.tableScrollArea {\n width: 100%;\n}\n\n.table {\n border-radius: var(--table--corner-radius);\n overflow: hidden;\n width: 100%;\n border-width: var(--table--border-width);\n border-style: var(--table--border-style);\n border-color: var(--table--border-color);\n border-spacing: 0;\n background-color: var(--table--background-color);\n\n .column {\n font-weight: var(--table--header-font-weight);\n\n &:empty {\n display: none;\n }\n }\n\n .cell,\n .column {\n padding-inline: var(--table--padding-x);\n padding-block: var(--table--padding-y);\n text-align: start;\n vertical-align: top;\n border-style: var(--table--border-style);\n border-color: var(--table--border-color);\n border-width: 0;\n\n // Cell content is the consumer's — a Flow icon or a raw `<svg>`.\n // stylelint-disable-next-line selector-max-type -- consumer content\n > svg {\n vertical-align: bottom;\n }\n\n &.horizontal-align-center {\n text-align: center;\n }\n\n &.horizontal-align-end {\n text-align: end;\n }\n }\n\n .header {\n .column {\n border-block-end-width: var(--table--header-border-width);\n }\n\n &:empty {\n display: none;\n }\n }\n\n :where(.body) {\n :where(.row) {\n &:where(:nth-of-type(odd):not(.footer)) {\n background-color: var(--table--background-color-accent);\n }\n\n &:not(:last-child) {\n .cell {\n border-block-end-width: var(--table--border-width);\n }\n }\n\n &.footer .cell {\n border-block-start-width: var(--table--border-width);\n }\n }\n }\n\n &.vertical-align-middle {\n .cell,\n .column {\n vertical-align: middle;\n }\n }\n\n &.layout-auto {\n table-layout: auto;\n }\n\n &.layout-fixed {\n table-layout: fixed;\n }\n}\n"],"mappings":""}
|
package/dist/js/packages/components/src/components/Tabs/components/TabTitle/TabTitle.module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabTitle.module.mjs","names":[],"sources":["../../../../../../../../../src/components/Tabs/components/TabTitle/TabTitle.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.tabTitle {\n position: relative;\n padding-block: var(--tabs--padding-y);\n padding-inline: var(--tabs--padding-x);\n color: var(--tabs--color--default);\n cursor: default;\n white-space: nowrap;\n transition-property: background-color;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1 1 0;\n column-gap: var(--tabs--spacing);\n border-radius: var(--tabs--corner-radius);\n\n @include focus.focus;\n\n & {\n outline-offset: calc(var(--size-px--xs) * -1);\n }\n\n /* The active indicator is painted below the titles (it precedes them in the\n tab list), so the selected title must not paint a background over it. */\n &:not([data-selected]) {\n &:hover {\n background-color: var(--tabs--background-color--hover);\n transition-duration: var(--transition--duration--default);\n }\n\n &[data-pressed] {\n background-color: var(--tabs--background-color--pressed);\n transition-duration: var(--transition--duration--default);\n }\n }\n\n &[aria-disabled=\"true\"] {\n color: var(--tabs--color--disabled);\n }\n\n .text {\n display: flex;\n align-items: center;\n column-gap: var(--tabs--spacing);\n }\n}\n\n/* selected tab */\n.tabTitle[data-selected] {\n font-weight: var(--tabs--font-weight--selected);\n}\n\n.menuItem {\n > span {\n display: flex;\n align-items: center;\n justify-content: space-between;\n column-gap: var(--tabs--spacing);\n flex-grow: 1;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"TabTitle.module.mjs","names":[],"sources":["../../../../../../../../../src/components/Tabs/components/TabTitle/TabTitle.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.tabTitle {\n position: relative;\n padding-block: var(--tabs--padding-y);\n padding-inline: var(--tabs--padding-x);\n color: var(--tabs--color--default);\n cursor: default;\n white-space: nowrap;\n transition-property: background-color;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1 1 0;\n column-gap: var(--tabs--spacing);\n border-radius: var(--tabs--corner-radius);\n\n @include focus.focus;\n\n & {\n outline-offset: calc(var(--size-px--xs) * -1);\n }\n\n /* The active indicator is painted below the titles (it precedes them in the\n tab list), so the selected title must not paint a background over it. */\n &:not([data-selected]) {\n &:hover {\n background-color: var(--tabs--background-color--hover);\n transition-duration: var(--transition--duration--default);\n }\n\n &[data-pressed] {\n background-color: var(--tabs--background-color--pressed);\n transition-duration: var(--transition--duration--default);\n }\n }\n\n &[aria-disabled=\"true\"] {\n color: var(--tabs--color--disabled);\n }\n\n .text {\n display: flex;\n align-items: center;\n column-gap: var(--tabs--spacing);\n }\n}\n\n/* selected tab */\n.tabTitle[data-selected] {\n font-weight: var(--tabs--font-weight--selected);\n}\n\n.menuItem {\n // The tab's children are the consumer's; a `Text` child renders this span.\n // stylelint-disable-next-line selector-max-type -- consumer children\n > span {\n display: flex;\n align-items: center;\n justify-content: space-between;\n column-gap: var(--tabs--spacing);\n flex-grow: 1;\n }\n}\n"],"mappings":""}
|