@mittwald/flow-react-components 0.2.0-alpha.1030 → 0.2.0-alpha.1032
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/CHANGELOG.md +8 -0
- package/dist/assets/doc-properties.json +63626 -63568
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +0 -1
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +0 -1
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Action/Action.mjs +0 -1
- package/dist/js/packages/components/src/components/Action/Action.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs +0 -1
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Alert/Alert.mjs +0 -1
- package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AlertText/AlertText.mjs +0 -1
- package/dist/js/packages/components/src/components/AlertText/AlertText.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Align/Align.mjs +0 -1
- package/dist/js/packages/components/src/components/Align/Align.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Autocomplete/Autocomplete.mjs +0 -1
- package/dist/js/packages/components/src/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Avatar/Avatar.mjs +0 -1
- package/dist/js/packages/components/src/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs +0 -1
- package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Badge/Badge.mjs +0 -1
- package/dist/js/packages/components/src/components/Badge/Badge.mjs.map +1 -1
- package/dist/js/packages/components/src/components/BigNumber/BigNumber.mjs +0 -1
- package/dist/js/packages/components/src/components/BigNumber/BigNumber.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Breadcrumb/Breadcrumb.mjs +0 -1
- package/dist/js/packages/components/src/components/Breadcrumb/Breadcrumb.mjs.map +1 -1
- package/dist/js/packages/components/src/components/BrowserOnly/BrowserOnly.mjs +0 -1
- package/dist/js/packages/components/src/components/BrowserOnly/BrowserOnly.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Button/Button.mjs +0 -1
- package/dist/js/packages/components/src/components/Button/Button.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Chat/Chat.mjs +0 -1
- package/dist/js/packages/components/src/components/Chat/Chat.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs +0 -1
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.mjs +0 -1
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxGroup/CheckboxGroup.mjs +0 -1
- package/dist/js/packages/components/src/components/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs +0 -1
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ColumnLayout/ColumnLayout.mjs +0 -1
- package/dist/js/packages/components/src/components/ColumnLayout/ColumnLayout.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +0 -1
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs +0 -1
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs +0 -1
- package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextualHelp/ContextualHelp.mjs +0 -1
- package/dist/js/packages/components/src/components/ContextualHelp/ContextualHelp.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs +0 -1
- package/dist/js/packages/components/src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +0 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +0 -1
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DonutChart/DonutChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileCard/FileCard.mjs +0 -1
- package/dist/js/packages/components/src/components/FileCard/FileCard.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileCardList/FileCardList.mjs +0 -1
- package/dist/js/packages/components/src/components/FileCardList/FileCardList.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs +0 -1
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileField/FileField.mjs +0 -1
- package/dist/js/packages/components/src/components/FileField/FileField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileField/components/FileInput.mjs +0 -1
- package/dist/js/packages/components/src/components/FileField/components/FileInput.mjs.map +1 -1
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs +0 -1
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs +0 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +0 -1
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Label/Label.mjs +0 -1
- package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LabeledValue/LabeledValue.mjs +0 -1
- package/dist/js/packages/components/src/components/LabeledValue/LabeledValue.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LayoutCard/LayoutCard.mjs +0 -1
- package/dist/js/packages/components/src/components/LayoutCard/LayoutCard.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/LightBox.mjs +0 -1
- package/dist/js/packages/components/src/components/LightBox/LightBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGalleryItem/LightBoxGalleryItem.mjs +0 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGalleryItem/LightBoxGalleryItem.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Link/Link.mjs +0 -1
- package/dist/js/packages/components/src/components/Link/Link.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/List.mjs +0 -1
- package/dist/js/packages/components/src/components/List/List.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.mjs +0 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +0 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs +0 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/components/ListItemViewContent/ListItemViewContent.mjs +0 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/components/ListItemViewContent/ListItemViewContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/types.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Markdown/Markdown.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/MarkdownEditor.mjs +0 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/MarkdownEditor.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MenuItem/components/MenuItemContent/MenuItemContent.mjs +0 -1
- package/dist/js/packages/components/src/components/MenuItem/components/MenuItemContent/MenuItemContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Message/Message.mjs +0 -1
- package/dist/js/packages/components/src/components/Message/Message.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs +0 -1
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.mjs +0 -1
- package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.mjs +0 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/components/NavigationGroup/NavigationGroup.mjs +0 -1
- package/dist/js/packages/components/src/components/Navigation/components/NavigationGroup/NavigationGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Notification/Notification.mjs +0 -1
- package/dist/js/packages/components/src/components/Notification/Notification.mjs.map +1 -1
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs +0 -1
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Overlay/Overlay.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +0 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs +0 -1
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs +0 -1
- package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/RadioGroup/components/RadioButton/RadioButton.mjs +0 -1
- package/dist/js/packages/components/src/components/RadioGroup/components/RadioButton/RadioButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Rating/Rating.mjs +0 -1
- package/dist/js/packages/components/src/components/Rating/Rating.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/EmptySegment.mjs +0 -1
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/EmptySegment.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/FilledSegment.mjs +0 -1
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/FilledSegment.mjs.map +1 -1
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs +0 -1
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/Section.mjs +0 -1
- package/dist/js/packages/components/src/components/Section/Section.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs +0 -1
- package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs.map +1 -1
- package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs +0 -1
- package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Select/Select.mjs +0 -1
- package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Slider/Slider.mjs +0 -1
- package/dist/js/packages/components/src/components/Slider/Slider.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Switch/Switch.mjs +0 -1
- package/dist/js/packages/components/src/components/Switch/Switch.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs +0 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/Table.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs +0 -1
- package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/Tabs.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/components/Tab/Tab.mjs +0 -1
- package/dist/js/packages/components/src/components/Tabs/components/Tab/Tab.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Text/Text.mjs +0 -1
- package/dist/js/packages/components/src/components/Text/Text.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +0 -1
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextField/TextField.mjs +0 -1
- package/dist/js/packages/components/src/components/TextField/TextField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs +0 -1
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Truncate/Truncate.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +0 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/hooks/useFormSubmitController.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormResetAction.mjs +0 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormResetAction.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormSubmitAction.mjs +0 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormSubmitAction.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/componentFactory/flowComponent.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/useModalController.mjs +0 -1
- package/dist/js/packages/components/src/lib/controller/overlay/useModalController.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/hooks/useFieldComponent.mjs +0 -1
- package/dist/js/packages/components/src/lib/hooks/useFieldComponent.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/hooks/useFieldError.mjs +0 -1
- package/dist/js/packages/components/src/lib/hooks/useFieldError.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/types/props.mjs.map +1 -1
- package/dist/types/components/Action/types.d.ts +32 -0
- package/dist/types/components/Action/types.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/CartesianChart.d.ts +2 -0
- package/dist/types/components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/types/components/Chat/Chat.d.ts +1 -0
- package/dist/types/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +1 -0
- package/dist/types/components/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/types/components/CodeEditor/CodeEditor.d.ts +24 -1
- package/dist/types/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/types/components/ComboBox/ComboBox.d.ts +1 -0
- package/dist/types/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +6 -0
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/types/components/DonutChart/DonutChart.d.ts +1 -0
- package/dist/types/components/DonutChart/DonutChart.d.ts.map +1 -1
- package/dist/types/components/FileDropZone/FileDropZone.d.ts +1 -0
- package/dist/types/components/FileDropZone/FileDropZone.d.ts.map +1 -1
- package/dist/types/components/Link/Link.d.ts +2 -0
- package/dist/types/components/Link/Link.d.ts.map +1 -1
- package/dist/types/components/List/List.d.ts +7 -0
- package/dist/types/components/List/List.d.ts.map +1 -1
- package/dist/types/components/List/model/types.d.ts +35 -0
- package/dist/types/components/List/model/types.d.ts.map +1 -1
- package/dist/types/components/Markdown/Markdown.d.ts +1 -0
- package/dist/types/components/Markdown/Markdown.d.ts.map +1 -1
- package/dist/types/components/Message/Message.d.ts +1 -0
- package/dist/types/components/Message/Message.d.ts.map +1 -1
- package/dist/types/components/Overlay/Overlay.d.ts +9 -0
- package/dist/types/components/Overlay/Overlay.d.ts.map +1 -1
- package/dist/types/components/PasswordCreationField/PasswordCreationField.d.ts +9 -0
- package/dist/types/components/PasswordCreationField/PasswordCreationField.d.ts.map +1 -1
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +1 -0
- package/dist/types/components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/types/components/Table/Table.d.ts +1 -0
- package/dist/types/components/Table/Table.d.ts.map +1 -1
- package/dist/types/components/Tabs/Tabs.d.ts +4 -0
- package/dist/types/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/components/Text/Text.d.ts +13 -0
- package/dist/types/components/Text/Text.d.ts.map +1 -1
- package/dist/types/components/Truncate/Truncate.d.ts +5 -0
- package/dist/types/components/Truncate/Truncate.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts +26 -0
- package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Form/hooks/useFormSubmitController.d.ts +1 -0
- package/dist/types/integrations/react-hook-form/components/Form/hooks/useFormSubmitController.d.ts.map +1 -1
- package/dist/types/lib/componentFactory/flowComponent.d.ts +6 -0
- package/dist/types/lib/componentFactory/flowComponent.d.ts.map +1 -1
- package/dist/types/lib/types/props.d.ts +6 -0
- package/dist/types/lib/types/props.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileCard.mjs","sources":["../../../../../../../src/components/FileCard/FileCard.tsx"],"sourcesContent":["import { Avatar } from \"./components/Avatar\";\nimport { Text } from \"@/components/Text\";\nimport type {\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport styles from \"./FileCard.module.scss\";\nimport clsx from \"clsx\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { FileSizeText } from \"@/components/FileCard/components/FileSizeText\";\nimport { Link, type LinkProps } from \"@/components/Link\";\nimport Wrap from \"@/components/Wrap\";\nimport { DeleteButton } from \"@/components/FileCard/components/DeleteButton\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { OptionsButton } from \"@/components/List/components/Items/components/Item/components/OptionsButton\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface FileCardProps\n extends\n FlowComponentProps<HTMLDivElement | HTMLLIElement>,\n PropsWithClassName,\n PropsWithElementType<\"div\" | \"li\">,\n Pick<LinkProps, \"onPress\" | \"href\" | \"target\" | \"download\"> {\n /** The name of the file. */\n name?: string;\n /** The type of the file. */\n type?: string;\n /** Handler that is called when the file cards delete button is clicked. */\n onDelete?: () => void;\n /** The size of the file in bytes. */\n sizeInBytes?: number;\n /** The source of an image file. */\n imageSrc?: string;\n /** Whether the file card is in a failed state. */\n isFailed?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileCard = flowComponent(\"FileCard\", (props) => {\n const {\n ref,\n onDelete,\n type,\n sizeInBytes,\n name,\n className,\n elementType = \"div\",\n onPress,\n href,\n target,\n download,\n imageSrc,\n children,\n isFailed,\n } = props;\n\n const rootClassName = clsx(\n styles.fileCard,\n isFailed && styles[\"failed\"],\n className,\n );\n\n const propsContext: PropsContext = {\n ContextMenu: {\n wrapWith: <OptionsButton />,\n placement: \"bottom right\",\n },\n Text: {\n elementType: \"span\",\n className: styles.subTitle,\n tunnel: {\n id: \"subTitle\",\n component: \"FileCard\",\n },\n },\n ProgressBar: {\n size: \"s\",\n tunnel: {\n id: \"progressBar\",\n component: \"FileCard\",\n },\n },\n Button: { variant: \"plain\", color: \"secondary\" },\n };\n\n const Element = elementType;\n\n return (\n <PropsContextProvider props={propsContext}>\n <Element ref={ref as never} className={rootClassName}>\n <Wrap if={(href || onPress) && !isFailed}>\n <Link\n className={styles.link}\n unstyled\n href={href}\n onPress={onPress}\n target={target}\n download={download}\n >\n <Avatar type={type} imageSrc={imageSrc} isFailed={isFailed} />\n\n <span className={styles.text}>\n {name && (\n <Text className={styles.title}>\n <strong>{name}</strong>\n </Text>\n )}\n {sizeInBytes && <FileSizeText sizeInBytes={sizeInBytes} />}\n <UiComponentTunnelExit id=\"subTitle\" component=\"FileCard\" />\n <UiComponentTunnelExit id=\"progressBar\" component=\"FileCard\" />\n </span>\n </Link>\n </Wrap>\n {children}\n {onDelete && <DeleteButton onDelete={onDelete} />}\n </Element>\n </PropsContextProvider>\n );\n});\n\nexport default FileCard;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileCard.mjs","sources":["../../../../../../../src/components/FileCard/FileCard.tsx"],"sourcesContent":["import { Avatar } from \"./components/Avatar\";\nimport { Text } from \"@/components/Text\";\nimport type {\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport styles from \"./FileCard.module.scss\";\nimport clsx from \"clsx\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { FileSizeText } from \"@/components/FileCard/components/FileSizeText\";\nimport { Link, type LinkProps } from \"@/components/Link\";\nimport Wrap from \"@/components/Wrap\";\nimport { DeleteButton } from \"@/components/FileCard/components/DeleteButton\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { OptionsButton } from \"@/components/List/components/Items/components/Item/components/OptionsButton\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface FileCardProps\n extends\n FlowComponentProps<HTMLDivElement | HTMLLIElement>,\n PropsWithClassName,\n PropsWithElementType<\"div\" | \"li\">,\n Pick<LinkProps, \"onPress\" | \"href\" | \"target\" | \"download\"> {\n /** The name of the file. */\n name?: string;\n /** The type of the file. */\n type?: string;\n /** Handler that is called when the file cards delete button is clicked. */\n onDelete?: () => void;\n /** The size of the file in bytes. */\n sizeInBytes?: number;\n /** The source of an image file. */\n imageSrc?: string;\n /** Whether the file card is in a failed state. */\n isFailed?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileCard = flowComponent(\"FileCard\", (props) => {\n const {\n ref,\n onDelete,\n type,\n sizeInBytes,\n name,\n className,\n elementType = \"div\",\n onPress,\n href,\n target,\n download,\n imageSrc,\n children,\n isFailed,\n } = props;\n\n const rootClassName = clsx(\n styles.fileCard,\n isFailed && styles[\"failed\"],\n className,\n );\n\n const propsContext: PropsContext = {\n ContextMenu: {\n wrapWith: <OptionsButton />,\n placement: \"bottom right\",\n },\n Text: {\n elementType: \"span\",\n className: styles.subTitle,\n tunnel: {\n id: \"subTitle\",\n component: \"FileCard\",\n },\n },\n ProgressBar: {\n size: \"s\",\n tunnel: {\n id: \"progressBar\",\n component: \"FileCard\",\n },\n },\n Button: { variant: \"plain\", color: \"secondary\" },\n };\n\n const Element = elementType;\n\n return (\n <PropsContextProvider props={propsContext}>\n <Element ref={ref as never} className={rootClassName}>\n <Wrap if={(href || onPress) && !isFailed}>\n <Link\n className={styles.link}\n unstyled\n href={href}\n onPress={onPress}\n target={target}\n download={download}\n >\n <Avatar type={type} imageSrc={imageSrc} isFailed={isFailed} />\n\n <span className={styles.text}>\n {name && (\n <Text className={styles.title}>\n <strong>{name}</strong>\n </Text>\n )}\n {sizeInBytes && <FileSizeText sizeInBytes={sizeInBytes} />}\n <UiComponentTunnelExit id=\"subTitle\" component=\"FileCard\" />\n <UiComponentTunnelExit id=\"progressBar\" component=\"FileCard\" />\n </span>\n </Link>\n </Wrap>\n {children}\n {onDelete && <DeleteButton onDelete={onDelete} />}\n </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../ColumnLayout/ColumnLayout.mjs';
|
|
5
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
6
5
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
6
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileCardList.mjs","sources":["../../../../../../../src/components/FileCardList/FileCardList.tsx"],"sourcesContent":["import type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport { ColumnLayout } from \"@/components/ColumnLayout\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\n\nexport type FileCardListProps = Omit<ColumnLayoutProps, \"elementType\"> &\n FlowComponentProps<HTMLUListElement>;\n\n/** @flr-generate all */\nexport const FileCardList = flowComponent(\"FileCardList\", (props) => {\n const { className, ref, children, ...rest } = props;\n\n const propsContext: PropsContext = {\n FileCard: { elementType: \"li\" },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <ColumnLayout ref={ref} elementType=\"ul\" className={className} {...rest}>\n {children}\n </ColumnLayout>\n </PropsContextProvider>\n );\n});\n\nexport default FileCardList;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileCardList.mjs","sources":["../../../../../../../src/components/FileCardList/FileCardList.tsx"],"sourcesContent":["import type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport { ColumnLayout } from \"@/components/ColumnLayout\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\n\nexport type FileCardListProps = Omit<ColumnLayoutProps, \"elementType\"> &\n FlowComponentProps<HTMLUListElement>;\n\n/** @flr-generate all */\nexport const FileCardList = flowComponent(\"FileCardList\", (props) => {\n const { className, ref, children, ...rest } = props;\n\n const propsContext: PropsContext = {\n FileCard: { elementType: \"li\" },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <ColumnLayout ref={ref} elementType=\"ul\" className={className} {...rest}>\n {children}\n </ColumnLayout>\n </PropsContextProvider>\n );\n});\n\nexport default FileCardList;\n"],"names":[],"mappings":";;;;;AAaO,MAAM,YAAA,GAAe,aAAA,CAAc,cAAA,EAAgB,CAAC,KAAA,KAAU;AACnE,EAAA,MAAM,EAAE,SAAA,EAAW,GAAA,EAAK,QAAA,EAAU,GAAG,MAAK,GAAI,KAAA;AAE9C,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,QAAA,EAAU,EAAE,WAAA,EAAa,IAAA;AAAK,GAChC;AAEA,EAAA,uBACE,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,GAAA,EAAU,WAAA,EAAY,IAAA,EAAK,SAAA,EAAuB,GAAG,IAAA,EAChE,UACH,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -6,7 +6,6 @@ import * as Aria from 'react-aria-components';
|
|
|
6
6
|
import { IllustratedMessage } from '../IllustratedMessage/IllustratedMessage.mjs';
|
|
7
7
|
import styles from './FileDropZone.module.scss.mjs';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
10
9
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
11
10
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
12
11
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDropZone.mjs","sources":["../../../../../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { IllustratedMessage } from \"@/components/IllustratedMessage\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./FileDropZone.module.scss\";\nimport clsx from \"clsx\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { DropEvent, FocusableElement } from \"@react-types/shared\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface FileDropZoneProps\n extends\n PropsWithClassName,\n FlowComponentProps<FocusableElement>,\n PropsWithChildren,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<Aria.DropZoneProps, \"isDisabled\"> {\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileDropZone: FC<FileDropZoneProps> = flowComponent(\n \"FileDropZone\",\n (props) => {\n const {\n multiple,\n accept,\n className,\n onChange: onChangeDropZone,\n children,\n name,\n isDisabled,\n isReadOnly,\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"FileDropZone\");\n\n const fileFieldRef = useRef<HTMLInputElement>(null);\n const rootClassName = clsx(\n styles.fileDropZone,\n isDisabled && styles.disabled,\n className,\n );\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n IllustratedMessage: {\n FileField: {\n name,\n onChange: onChangeDropZone,\n ref: fileFieldRef,\n accept: accept,\n multiple: multiple,\n Button: { variant: \"outline\", color: \"dark\" },\n isDisabled,\n isReadOnly,\n },\n Heading: {\n className: styles.heading,\n },\n Icon: { className: styles.icon },\n Text: { className: styles.text },\n },\n };\n\n const onDropHandler = async (event: DropEvent) => {\n if (isReadOnly) {\n return;\n }\n\n const fileDropItems = event.items.filter(\n (file) => file.kind === \"file\",\n ) as Aria.FileDropItem[];\n\n const files = await Promise.all(\n fileDropItems\n .filter((f) => !accept || accept?.includes(f.type))\n .map(async (f) => await f.getFile()),\n );\n\n if (files.length > 0) {\n const fileTransfer = new DataTransfer();\n for (const file of multiple ? files : [files[0]]) {\n if (file) {\n fileTransfer.items.add(file);\n }\n }\n\n onChangeDropZone?.(fileTransfer.files);\n if (fileFieldRef.current) {\n fileFieldRef.current.files = fileTransfer.files;\n }\n }\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={propsContext}>\n <Aria.DropZone\n className={rootClassName}\n onDrop={onDropHandler}\n isDisabled={isDisabled}\n data-readonly={isReadOnly}\n >\n <IllustratedMessage color=\"dark\">{children}</IllustratedMessage>\n </Aria.DropZone>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n },\n);\n\nexport default FileDropZone;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileDropZone.mjs","sources":["../../../../../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { IllustratedMessage } from \"@/components/IllustratedMessage\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./FileDropZone.module.scss\";\nimport clsx from \"clsx\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { DropEvent, FocusableElement } from \"@react-types/shared\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface FileDropZoneProps\n extends\n PropsWithClassName,\n FlowComponentProps<FocusableElement>,\n PropsWithChildren,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<Aria.DropZoneProps, \"isDisabled\"> {\n /** Called with the dropped or selected files whenever the selection changes. */\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileDropZone: FC<FileDropZoneProps> = flowComponent(\n \"FileDropZone\",\n (props) => {\n const {\n multiple,\n accept,\n className,\n onChange: onChangeDropZone,\n children,\n name,\n isDisabled,\n isReadOnly,\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"FileDropZone\");\n\n const fileFieldRef = useRef<HTMLInputElement>(null);\n const rootClassName = clsx(\n styles.fileDropZone,\n isDisabled && styles.disabled,\n className,\n );\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n IllustratedMessage: {\n FileField: {\n name,\n onChange: onChangeDropZone,\n ref: fileFieldRef,\n accept: accept,\n multiple: multiple,\n Button: { variant: \"outline\", color: \"dark\" },\n isDisabled,\n isReadOnly,\n },\n Heading: {\n className: styles.heading,\n },\n Icon: { className: styles.icon },\n Text: { className: styles.text },\n },\n };\n\n const onDropHandler = async (event: DropEvent) => {\n if (isReadOnly) {\n return;\n }\n\n const fileDropItems = event.items.filter(\n (file) => file.kind === \"file\",\n ) as Aria.FileDropItem[];\n\n const files = await Promise.all(\n fileDropItems\n .filter((f) => !accept || accept?.includes(f.type))\n .map(async (f) => await f.getFile()),\n );\n\n if (files.length > 0) {\n const fileTransfer = new DataTransfer();\n for (const file of multiple ? files : [files[0]]) {\n if (file) {\n fileTransfer.items.add(file);\n }\n }\n\n onChangeDropZone?.(fileTransfer.files);\n if (fileFieldRef.current) {\n fileFieldRef.current.files = fileTransfer.files;\n }\n }\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={propsContext}>\n <Aria.DropZone\n className={rootClassName}\n onDrop={onDropHandler}\n isDisabled={isDisabled}\n data-readonly={isReadOnly}\n >\n <IllustratedMessage color=\"dark\">{children}</IllustratedMessage>\n </Aria.DropZone>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n },\n);\n\nexport default FileDropZone;\n"],"names":[],"mappings":";;;;;;;;;;AA8BO,MAAM,YAAA,GAAsC,aAAA;AAAA,EACjD,cAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA,EAAU,gBAAA;AAAA,MACV,QAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,KAAA;AAEJ,IAAA,MAAM;AAAA,MACJ,cAAA;AAAA,MACA,wBAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,iBAAA,CAAkB,KAAA,EAAO,cAAc,CAAA;AAE3C,IAAA,MAAM,YAAA,GAAe,OAAyB,IAAI,CAAA;AAClD,IAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,MACpB,MAAA,CAAO,YAAA;AAAA,MACP,cAAc,MAAA,CAAO,QAAA;AAAA,MACrB;AAAA,KACF;AAEA,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,GAAG,iBAAA;AAAA,MACH,kBAAA,EAAoB;AAAA,QAClB,SAAA,EAAW;AAAA,UACT,IAAA;AAAA,UACA,QAAA,EAAU,gBAAA;AAAA,UACV,GAAA,EAAK,YAAA;AAAA,UACL,MAAA;AAAA,UACA,QAAA;AAAA,UACA,MAAA,EAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,MAAA,EAAO;AAAA,UAC5C,UAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,OAAA,EAAS;AAAA,UACP,WAAW,MAAA,CAAO;AAAA,SACpB;AAAA,QACA,IAAA,EAAM,EAAE,SAAA,EAAW,MAAA,CAAO,IAAA,EAAK;AAAA,QAC/B,IAAA,EAAM,EAAE,SAAA,EAAW,MA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,SAAA,EAAW,aAAA;AAAA,UACX,MAAA,EAAQ,aAAA;AAAA,UACR,UAAA;AAAA,UACA,eAAA,EAAe,UAAA;AAAA,UAEf,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,KAAA,EAAM,MAAA,EAAQ,QAAA,EAAS;AAAA;AAAA,SAE/C,CAAA,EACF,CAAA;AAAA,0BACC,cAAA,EAAA,EAAe;AAAA,KAAA,EAClB,CAAA;AAAA,EAEJ;AACF;;;;"}
|
|
@@ -6,7 +6,6 @@ import { useFormValidationState } from '@react-stately/form';
|
|
|
6
6
|
import { FieldErrorContext } from 'react-aria-components';
|
|
7
7
|
import { FileInput } from './components/FileInput.mjs';
|
|
8
8
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
9
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
10
9
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
11
10
|
import { useObjectRef } from '@react-aria/utils';
|
|
12
11
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileField.mjs","sources":["../../../../../../../src/components/FileField/FileField.tsx"],"sourcesContent":["import { useFormValidation } from \"@react-aria/form\";\nimport { useFormValidationState } from \"@react-stately/form\";\nimport type { PropsWithChildren } from \"react\";\nimport type * as Aria from \"react-aria-components\";\nimport { FieldErrorContext } from \"react-aria-components\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport { FileInput } from \"@/components/FileField/components/FileInput\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./FileField.module.scss\";\nimport clsx from \"clsx\";\n\nexport interface FileFieldProps\n extends\n PropsWithChildren,\n FlowComponentProps<HTMLInputElement>,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<\n Aria.TextFieldProps,\n \"isRequired\" | \"isInvalid\" | \"validationBehavior\" | \"isDisabled\"\n > {\n /** Handler that is called when the file input changes. */\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileField = flowComponent(\"FileField\", (props) => {\n const {\n children,\n ref,\n isRequired,\n isInvalid,\n isDisabled,\n validationBehavior,\n onChange,\n isReadOnly,\n ...restInputProps\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"FileField\");\n\n const inputRef = useObjectRef(ref);\n\n const formValidationState = useFormValidationState({\n value: undefined,\n validationBehavior,\n isInvalid,\n });\n\n useFormValidation({ validationBehavior }, formValidationState, inputRef);\n\n const inputProps = {\n ...restInputProps,\n \"aria-invalid\": formValidationState.displayValidation.isInvalid,\n value: undefined,\n };\n\n const handleChange: FileInputOnChangeHandler = (fileList) => {\n if (fileList && onChange) {\n onChange(fileList);\n }\n };\n\n return (\n <div\n {...fieldProps}\n className={clsx(fieldProps.className, styles.fileField)}\n >\n <FieldErrorContext.Provider value={formValidationState.displayValidation}>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={fieldPropsContext}>\n <div\n data-readonly={isReadOnly}\n data-required={!!isRequired || undefined}\n data-invalid={\n formValidationState.displayValidation.isInvalid || undefined\n }\n >\n <FileInput\n ref={inputRef}\n isReadOnly={isReadOnly}\n onChange={isReadOnly ? undefined : handleChange}\n isDisabled={isDisabled}\n {...inputProps}\n >\n {children}\n </FileInput>\n </div>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </FieldErrorContext.Provider>\n </div>\n );\n});\nexport default FileField;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileField.mjs","sources":["../../../../../../../src/components/FileField/FileField.tsx"],"sourcesContent":["import { useFormValidation } from \"@react-aria/form\";\nimport { useFormValidationState } from \"@react-stately/form\";\nimport type { PropsWithChildren } from \"react\";\nimport type * as Aria from \"react-aria-components\";\nimport { FieldErrorContext } from \"react-aria-components\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport { FileInput } from \"@/components/FileField/components/FileInput\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./FileField.module.scss\";\nimport clsx from \"clsx\";\n\nexport interface FileFieldProps\n extends\n PropsWithChildren,\n FlowComponentProps<HTMLInputElement>,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<\n Aria.TextFieldProps,\n \"isRequired\" | \"isInvalid\" | \"validationBehavior\" | \"isDisabled\"\n > {\n /** Handler that is called when the file input changes. */\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileField = flowComponent(\"FileField\", (props) => {\n const {\n children,\n ref,\n isRequired,\n isInvalid,\n isDisabled,\n validationBehavior,\n onChange,\n isReadOnly,\n ...restInputProps\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"FileField\");\n\n const inputRef = useObjectRef(ref);\n\n const formValidationState = useFormValidationState({\n value: undefined,\n validationBehavior,\n isInvalid,\n });\n\n useFormValidation({ validationBehavior }, formValidationState, inputRef);\n\n const inputProps = {\n ...restInputProps,\n \"aria-invalid\": formValidationState.displayValidation.isInvalid,\n value: undefined,\n };\n\n const handleChange: FileInputOnChangeHandler = (fileList) => {\n if (fileList && onChange) {\n onChange(fileList);\n }\n };\n\n return (\n <div\n {...fieldProps}\n className={clsx(fieldProps.className, styles.fileField)}\n >\n <FieldErrorContext.Provider value={formValidationState.displayValidation}>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={fieldPropsContext}>\n <div\n data-readonly={isReadOnly}\n data-required={!!isRequired || undefined}\n data-invalid={\n formValidationState.displayValidation.isInvalid || undefined\n }\n >\n <FileInput\n ref={inputRef}\n isReadOnly={isReadOnly}\n onChange={isReadOnly ? undefined : handleChange}\n isDisabled={isDisabled}\n {...inputProps}\n >\n {children}\n </FileInput>\n </div>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </FieldErrorContext.Provider>\n </div>\n );\n});\nexport default FileField;\n"],"names":[],"mappings":";;;;;;;;;;;;AA+BO,MAAM,SAAA,GAAY,aAAA,CAAc,WAAA,EAAa,CAAC,KAAA,KAAU;AAC7D,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,GAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,iBAAA,CAAkB,KAAA,EAAO,WAAW,CAAA;AAExC,EAAA,MAAM,QAAA,GAAW,aAAa,GAAG,CAAA;AAEjC,EAAA,MAAM,sBAAsB,sBAAA,CAAuB;AAAA,IACjD,KAAA,EAAO,MAAA;AAAA,IACP,kBAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,iBAAA,CAAkB,EAAE,kBAAA,EAAmB,EAAG,mBAAA,EAAqB,QAAQ,CAAA;AAEvE,EAAA,MAAM,UAAA,GAAa;AAAA,IACjB,GAAG,cAAA;AAAA,IACH,cAAA,EAAgB,oBAAoB,iBAAA,CAAkB,SAA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import { useObjectRef } from '@react-aria/utils';
|
|
7
|
-
import '../../../lib/propsContext/propsContext.mjs';
|
|
8
7
|
import { PropsContextProvider } from '../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
8
|
import styles from './FileInput.module.scss.mjs';
|
|
10
9
|
import { useVisuallyHidden } from 'react-aria';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.mjs","sources":["../../../../../../../../src/components/FileField/components/FileInput.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref } from \"react\";\nimport { type ChangeEvent } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport styles from \"./FileInput.module.scss\";\nimport { useVisuallyHidden } from \"react-aria\";\n\nexport type FileInputOnChangeHandler = (files: FileList | null) => void;\n\n/** @internal */\nexport interface FileInputProps extends PropsWithChildren {\n onChange?: FileInputOnChangeHandler;\n isDisabled?: boolean;\n ref?: Ref<HTMLInputElement>;\n isReadOnly?: boolean;\n}\n\n/** @internal */\nexport const FileInput: FC<FileInputProps> = (props) => {\n const { children, isDisabled, onChange, isReadOnly, ref, ...restInputProps } =\n props;\n const inputRef = useObjectRef(ref);\n const { visuallyHiddenProps } = useVisuallyHidden();\n\n const handlePress = () => {\n if (inputRef.current?.value) {\n inputRef.current.value = \"\";\n onChange?.(null);\n }\n inputRef.current?.click();\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event.target.files);\n };\n\n const propsContext: PropsContext = {\n Button: {\n onPress: handlePress,\n className: styles.trigger,\n isDisabled,\n isReadOnly,\n },\n FieldDescription: { className: styles.fieldDescription },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n {children}\n <Aria.Input\n {...restInputProps}\n {...visuallyHiddenProps}\n type=\"file\"\n ref={inputRef}\n onChange={handleChange}\n />\n </PropsContextProvider>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileInput.mjs","sources":["../../../../../../../../src/components/FileField/components/FileInput.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref } from \"react\";\nimport { type ChangeEvent } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport styles from \"./FileInput.module.scss\";\nimport { useVisuallyHidden } from \"react-aria\";\n\nexport type FileInputOnChangeHandler = (files: FileList | null) => void;\n\n/** @internal */\nexport interface FileInputProps extends PropsWithChildren {\n onChange?: FileInputOnChangeHandler;\n isDisabled?: boolean;\n ref?: Ref<HTMLInputElement>;\n isReadOnly?: boolean;\n}\n\n/** @internal */\nexport const FileInput: FC<FileInputProps> = (props) => {\n const { children, isDisabled, onChange, isReadOnly, ref, ...restInputProps } =\n props;\n const inputRef = useObjectRef(ref);\n const { visuallyHiddenProps } = useVisuallyHidden();\n\n const handlePress = () => {\n if (inputRef.current?.value) {\n inputRef.current.value = \"\";\n onChange?.(null);\n }\n inputRef.current?.click();\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event.target.files);\n };\n\n const propsContext: PropsContext = {\n Button: {\n onPress: handlePress,\n className: styles.trigger,\n isDisabled,\n isReadOnly,\n },\n FieldDescription: { className: styles.fieldDescription },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n {children}\n <Aria.Input\n {...restInputProps}\n {...visuallyHiddenProps}\n type=\"file\"\n ref={inputRef}\n onChange={handleChange}\n />\n </PropsContextProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAoBO,MAAM,SAAA,GAAgC,CAAC,KAAA,KAAU;AACtD,EAAA,MAAM,EAAE,UAAU,UAAA,EAAY,QAAA,EAAU,YAAY,GAAA,EAAK,GAAG,gBAAe,GACzE,KAAA;AACF,EAAA,MAAM,QAAA,GAAW,aAAa,GAAG,CAAA;AACjC,EAAA,MAAM,EAAE,mBAAA,EAAoB,GAAI,iBAAA,EAAkB;AAElD,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,IAAI,QAAA,CAAS,SAAS,KAAA,EAAO;AAC3B,MAAA,QAAA,CAAS,QAAQ,KAAA,GAAQ,EAAA;AACzB,MAAA,QAAA,GAAW,IAAI,CAAA;AAAA,IACjB;AACA,IAAA,QAAA,CAAS,SAAS,KAAA,EAAM;AAAA,EAC1B,CAAA;AAEA,EAAA,MAAM,YAAA,GAAe,CAAC,KAAA,KAAyC;AAC7D,IAAA,QAAA,GAAW,KAAA,CAAM,OAAO,KAAK,CAAA;AAAA,EAC/B,CAAA;AAEA,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,MAAA,EAAQ;AAAA,MACN,OAAA,EAAS,WAAA;AAAA,MACT,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,UAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,gBAAA,EAAkB,EAAE,SAAA,EAAW,MAAA,CAAO,gBAAA;AAAiB,GACzD;AAEA,EAAA,uBACE,IAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EAAA;AAAA,IAAA,QAAA;AAAA,oBACD,GAAA;AAAA,MAAC,IAAA,CAAK,KAAA;AAAA,MAAL;AAAA,QACE,GAAG,cAAA;AAAA,QACH,GAAG,mBAAA;AAAA,QACJ,IAAA,EAAK,MAAA;AAAA,QACL,GAAA,EAAK,QAAA;AAAA,QACL,QAAA,EAAU;AAAA;AAAA;AACZ,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { dynamic } from '../../lib/propsContext/dynamicProps/dynamic.mjs';
|
|
5
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
6
5
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
6
|
import clsx from 'clsx';
|
|
8
7
|
import styles from './HeaderNavigation.module.scss.mjs';
|
package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderNavigation.mjs","sources":["../../../../../../../src/components/HeaderNavigation/HeaderNavigation.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./HeaderNavigation.module.scss\";\nimport {\n type AlphaColor,\n isAlphaColor,\n type PropsWithClassName,\n} from \"@/lib/types/props\";\nimport { Text } from \"@/components/Text\";\n\nexport interface HeaderNavigationProps\n extends PropsWithChildren<ComponentProps<\"nav\">>, PropsWithClassName {\n /** The color of the header navigation. @default \"default\" */\n color?: \"default\" | AlphaColor;\n}\n\n/** @flr-generate all */\nexport const HeaderNavigation: FC<HeaderNavigationProps> = (props) => {\n const { children, className, color = \"default\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.headerNavigation,\n isAlphaColor(color) && styles[color],\n className,\n );\n\n const propsContext: PropsContext = {\n Link: {\n wrapWith: <li />,\n className: styles.link,\n unstyled: true,\n children: dynamic((props) => (\n <Text emulateBoldWidth>{props.children}</Text>\n )),\n },\n Button: {\n className: styles.button,\n color: isAlphaColor(color) ? color : \"secondary\",\n variant: \"plain\",\n wrapWith: <li />,\n },\n };\n\n return (\n <nav className={rootClassName} role=\"navigation\" {...rest}>\n <ul>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ul>\n </nav>\n );\n};\n\nexport default HeaderNavigation;\n"],"names":["props"],"mappings":"
|
|
1
|
+
{"version":3,"file":"HeaderNavigation.mjs","sources":["../../../../../../../src/components/HeaderNavigation/HeaderNavigation.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./HeaderNavigation.module.scss\";\nimport {\n type AlphaColor,\n isAlphaColor,\n type PropsWithClassName,\n} from \"@/lib/types/props\";\nimport { Text } from \"@/components/Text\";\n\nexport interface HeaderNavigationProps\n extends PropsWithChildren<ComponentProps<\"nav\">>, PropsWithClassName {\n /** The color of the header navigation. @default \"default\" */\n color?: \"default\" | AlphaColor;\n}\n\n/** @flr-generate all */\nexport const HeaderNavigation: FC<HeaderNavigationProps> = (props) => {\n const { children, className, color = \"default\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.headerNavigation,\n isAlphaColor(color) && styles[color],\n className,\n );\n\n const propsContext: PropsContext = {\n Link: {\n wrapWith: <li />,\n className: styles.link,\n unstyled: true,\n children: dynamic((props) => (\n <Text emulateBoldWidth>{props.children}</Text>\n )),\n },\n Button: {\n className: styles.button,\n color: isAlphaColor(color) ? color : \"secondary\",\n variant: \"plain\",\n wrapWith: <li />,\n },\n };\n\n return (\n <nav className={rootClassName} role=\"navigation\" {...rest}>\n <ul>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ul>\n </nav>\n );\n};\n\nexport default HeaderNavigation;\n"],"names":["props"],"mappings":";;;;;;;;AAsBO,MAAM,gBAAA,GAA8C,CAAC,KAAA,KAAU;AACpE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,QAAQ,SAAA,EAAW,GAAG,MAAK,GAAI,KAAA;AAE5D,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,gBAAA;AAAA,IACP,YAAA,CAAa,KAAK,CAAA,IAAK,MAAA,CAAO,KAAK,CAAA;AAAA,IACnC;AAAA,GACF;AAEA,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,IAAA,EAAM;AAAA,MACJ,QAAA,sBAAW,IAAA,EAAA,EAAG,CAAA;AAAA,MACd,WAAW,MAAA,CAAO,IAAA;AAAA,MAClB,QAAA,EAAU,IAAA;AAAA,MACV,QAAA,EAAU,OAAA,CAAQ,CAACA,MAAAA,qBACjB,GAAA,CAAC,IAAA,EAAA,EAAK,gBAAA,EAAgB,IAAA,EAAE,QAAA,EAAAA,MAAAA,CAAM,QAAA,EAAS,CACxC;AAAA,KACH;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,WAAW,MAAA,CAAO,MAAA;AAAA,MAClB,KAAA,EAAO,YAAA,CAAa,KAAK,CAAA,GAAI,KAAA,GAAQ,WAAA;AAAA,MACrC,OAAA,EAAS,OAAA;AAAA,MACT,QAAA,sBAAW,IAAA,EAAA,EAAG;AAAA;AAChB,GACF;AAEA,EAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EAAW,aAAA,EAAe,IAAA,EAAK,cAAc,GAAG,IAAA,EACnD,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EACC,8BAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,GACF,CAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -4,7 +4,6 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
4
4
|
import styles from './Heading.module.scss.mjs';
|
|
5
5
|
import { styleClassname } from '../../lib/scss/selectors.mjs';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
8
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
8
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
10
9
|
import * as Aria from 'react-aria-components';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.mjs","sources":["../../../../../../../src/components/Heading/Heading.tsx"],"sourcesContent":["import type { AlphaColor, PropsWithElementType } from \"@/lib/types/props\";\nimport styles from \"./Heading.module.scss\";\nimport { styleClassname } from \"@/lib/scss/selectors\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface HeadingProps\n extends\n Aria.HeadingProps,\n FlowComponentProps,\n PropsWithElementType<\"span\" | \"p\"> {\n /** The font size of the heading. */\n size?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\";\n /** The color of the heading. @default \"default\" */\n color?: \"default\" | \"danger\" | \"unavailable\" | AlphaColor;\n /** The text-wrap property of the text. @default undefined */\n wrap?: \"wrap\" | \"balance\";\n}\n\n/** @flr-generate all */\nexport const Heading = flowComponent(\"Heading\", (props) => {\n const {\n children,\n className,\n level = 2,\n color = \"default\",\n wrap,\n size,\n ref,\n elementType,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.heading,\n size && styles[`size-${size}`],\n color !== \"default\" && styles[color],\n wrap && styles[`wrap-${wrap}`],\n elementType && styleClassname(styles, `h${level}`),\n className,\n );\n\n const Element = elementType ?? Aria.Heading;\n\n const propsContext: PropsContext = {\n Icon: {\n \"aria-hidden\": true,\n className: styles.icon,\n },\n AlertBadge: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n },\n Badge: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n },\n ContextualHelpTrigger: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n Button: {\n tunnel: null,\n },\n },\n AlertText: {\n Icon: {\n className: styles.icon,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <Element className={rootClassName} {...rest} ref={ref} level={level}>\n <span className={styles.headingText}>{children}</span>\n <span className={styles.headingContent}>\n <UiComponentTunnelExit id=\"headingContent\" component=\"Heading\" />\n </span>\n </Element>\n </PropsContextProvider>\n );\n});\n\nexport default Heading;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Heading.mjs","sources":["../../../../../../../src/components/Heading/Heading.tsx"],"sourcesContent":["import type { AlphaColor, PropsWithElementType } from \"@/lib/types/props\";\nimport styles from \"./Heading.module.scss\";\nimport { styleClassname } from \"@/lib/scss/selectors\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface HeadingProps\n extends\n Aria.HeadingProps,\n FlowComponentProps,\n PropsWithElementType<\"span\" | \"p\"> {\n /** The font size of the heading. */\n size?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\";\n /** The color of the heading. @default \"default\" */\n color?: \"default\" | \"danger\" | \"unavailable\" | AlphaColor;\n /** The text-wrap property of the text. @default undefined */\n wrap?: \"wrap\" | \"balance\";\n}\n\n/** @flr-generate all */\nexport const Heading = flowComponent(\"Heading\", (props) => {\n const {\n children,\n className,\n level = 2,\n color = \"default\",\n wrap,\n size,\n ref,\n elementType,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.heading,\n size && styles[`size-${size}`],\n color !== \"default\" && styles[color],\n wrap && styles[`wrap-${wrap}`],\n elementType && styleClassname(styles, `h${level}`),\n className,\n );\n\n const Element = elementType ?? Aria.Heading;\n\n const propsContext: PropsContext = {\n Icon: {\n \"aria-hidden\": true,\n className: styles.icon,\n },\n AlertBadge: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n },\n Badge: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n },\n ContextualHelpTrigger: {\n tunnel: {\n id: \"headingContent\",\n component: \"Heading\",\n },\n Button: {\n tunnel: null,\n },\n },\n AlertText: {\n Icon: {\n className: styles.icon,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <Element className={rootClassName} {...rest} ref={ref} level={level}>\n <span className={styles.headingText}>{children}</span>\n <span className={styles.headingContent}>\n <UiComponentTunnelExit id=\"headingContent\" component=\"Heading\" />\n </span>\n </Element>\n </PropsContextProvider>\n );\n});\n\nexport default Heading;\n"],"names":[],"mappings":";;;;;;;;;AAyBO,MAAM,OAAA,GAAU,aAAA,CAAc,SAAA,EAAW,CAAC,KAAA,KAAU;AACzD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA,GAAQ,CAAA;AAAA,IACR,KAAA,GAAQ,SAAA;AAAA,IACR,IAAA;AAAA,IACA,IAAA;AAAA,IACA,GAAA;AAAA,IACA,WAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,OAAA;AAAA,IACP,IAAA,IAAQ,MAAA,CAAO,CAAA,KAAA,EAAQ,IAAI,CAAA,CAAE,CAAA;AAAA,IAC7B,KAAA,KAAU,SAAA,IAAa,MAAA,CAAO,KAAK,CAAA;AAAA,IACnC,IAAA,IAAQ,MAAA,CAAO,CAAA,KAAA,EAAQ,IAAI,CAAA,CAAE,CAAA;AAAA,IAC7B,WAAA,IAAe,cAAA,CAAe,MAAA,EAAQ,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE,CAAA;AAAA,IACjD;AAAA,GACF;AAEA,EAAA,MAAM,OAAA,GAAU,eAAe,IAAA,CAAK,OAAA;AAEpC,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,IAAA,EAAM;AAAA,MACJ,aAAA,EAAe,IAAA;AAAA,MACf,WAAW,MAAA,CAAO;AAAA,KACpB;AAAA,IACA,UAAA,EAAY;AAAA,MACV,MAAA,EAAQ;AAAA,QACN,EAAA,EAAI,gBAAA;AAAA,QACJ,SAAA,EAAW;AAAA;AACb,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL,MAAA,EAAQ;AAAA,QACN,EAAA,EAAI,gBAAA;AAAA,QACJ,SAAA,EAAW;AAAA;AACb,KACF;AAAA,IACA,qBAAA,EAAuB;AAAA,MACrB,MAAA,EAAQ;AAAA,QACN,EAAA,EAAI,gBAAA;AAAA,QACJ,SAAA,EAAW;AAAA,OACb;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,MAAA,EAAQ;AAAA;AACV,KACF;AAAA,IACA,SAAA,EAAW;AAAA,MACT,IAAA,EAAM;AAAA,QACJ,WAAW,MAAA,CAAO;AAAA;AACpB;AACF,GACF;AAEA,EAAA,uBACE,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,QAAA,kBAAA,IAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAW,aAAA,EAAgB,GAAG,IAAA,EAAM,GAAA,EAAU,KAAA,EACrD,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,MAAA,CAAO,WAAA,EAAc,QAAA,EAAS,CAAA;AAAA,oBAC/C,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,MAAA,CAAO,cAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EAAsB,EAAA,EAAG,gBAAA,EAAiB,SAAA,EAAU,SAAA,EAAU,CAAA,EACjE;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import styles from './IllustratedMessage.module.scss.mjs';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
7
6
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
7
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
9
8
|
import { isAlphaColor } from '../../lib/types/props.mjs';
|
package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllustratedMessage.mjs","sources":["../../../../../../../src/components/IllustratedMessage/IllustratedMessage.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./IllustratedMessage.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type AlphaColor, isAlphaColor } from \"@/lib/types/props\";\n\nexport interface IllustratedMessageProps\n extends PropsWithChildren<ComponentProps<\"div\">>, FlowComponentProps {\n /** The color of the illustrated message. @default \"default\" */\n color?: \"default\" | \"danger\" | \"unavailable\" | AlphaColor;\n}\n\n/** @flr-generate all */\nexport const IllustratedMessage = flowComponent(\n \"IllustratedMessage\",\n (props) => {\n const { className, children, color = \"default\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.illustratedMessage,\n color !== \"default\" && styles[color],\n className,\n );\n\n const alphaColor = isAlphaColor(color) ? color : undefined;\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n size: \"l\",\n },\n Heading: {\n className: styles.heading,\n color,\n },\n Text: {\n className: styles.text,\n color: alphaColor,\n },\n Button: {\n color: alphaColor,\n },\n ActionGroup: {\n preserveOrder: true,\n className: styles.actionGroup,\n },\n ProgressBar: { className: styles.progressBar },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </div>\n );\n },\n);\n\nexport default IllustratedMessage;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IllustratedMessage.mjs","sources":["../../../../../../../src/components/IllustratedMessage/IllustratedMessage.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./IllustratedMessage.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type AlphaColor, isAlphaColor } from \"@/lib/types/props\";\n\nexport interface IllustratedMessageProps\n extends PropsWithChildren<ComponentProps<\"div\">>, FlowComponentProps {\n /** The color of the illustrated message. @default \"default\" */\n color?: \"default\" | \"danger\" | \"unavailable\" | AlphaColor;\n}\n\n/** @flr-generate all */\nexport const IllustratedMessage = flowComponent(\n \"IllustratedMessage\",\n (props) => {\n const { className, children, color = \"default\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.illustratedMessage,\n color !== \"default\" && styles[color],\n className,\n );\n\n const alphaColor = isAlphaColor(color) ? color : undefined;\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n size: \"l\",\n },\n Heading: {\n className: styles.heading,\n color,\n },\n Text: {\n className: styles.text,\n color: alphaColor,\n },\n Button: {\n color: alphaColor,\n },\n ActionGroup: {\n preserveOrder: true,\n className: styles.actionGroup,\n },\n ProgressBar: { className: styles.progressBar },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </div>\n );\n },\n);\n\nexport default IllustratedMessage;\n"],"names":[],"mappings":";;;;;;;AAkBO,MAAM,kBAAA,GAAqB,aAAA;AAAA,EAChC,oBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,QAAQ,SAAA,EAAW,GAAG,MAAK,GAAI,KAAA;AAE5D,IAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,MACpB,MAAA,CAAO,kBAAA;AAAA,MACP,KAAA,KAAU,SAAA,IAAa,MAAA,CAAO,KAAK,CAAA;AAAA,MACnC;AAAA,KACF;AAEA,IAAA,MAAM,UAAA,GAAa,YAAA,CAAa,KAAK,CAAA,GAAI,KAAA,GAAQ,MAAA;AAEjD,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,IAAA,EAAM;AAAA,QACJ,WAAW,MAAA,CAAO,IAAA;AAAA,QAClB,IAAA,EAAM;AAAA,OACR;AAAA,MACA,OAAA,EAAS;AAAA,QACP,WAAW,MAAA,CAAO,OAAA;AAAA,QAClB;AAAA,OACF;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,WAAW,MAAA,CAAO,IAAA;AAAA,QAClB,KAAA,EAAO;AAAA,OACT;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,KAAA,EAAO;AAAA,OACT;AAAA,MACA,WAAA,EAAa;AAAA,QACX,aAAA,EAAe,IAAA;AAAA,QACf,WAAW,MAAA,CAAO;AAAA,OACpB;AAAA,MACA,WAAA,EAAa,EAAE,SAAA,EAAW,MAAA,CAAO,WAAA;AAAY,KAC/C;AAEA,IAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAK,GAAG,IAAA,EAAM,SAAA,EAAW,aAAA,EACxB,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;;;;"}
|
|
@@ -5,7 +5,6 @@ import React from 'react';
|
|
|
5
5
|
import styles from './Label.module.scss.mjs';
|
|
6
6
|
import * as Aria from 'react-aria-components';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
9
8
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
10
9
|
import { useLocalizedStringFormatter } from '../TranslationProvider/useLocalizedStringFormatter.mjs';
|
|
11
10
|
import locales from '../../../../../_virtual/_.locale.json@3b9d9e153ad753f427f375d1275fbcad.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.mjs","sources":["../../../../../../../src/components/Label/Label.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport styles from \"./Label.module.scss\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface LabelProps\n extends\n PropsWithChildren<Omit<Aria.LabelProps, \"children\">>,\n FlowComponentProps<HTMLLabelElement> {\n /** Whether the label should show an \"optional\" indicator. */\n optional?: boolean;\n /** Whether the label should be displayed as disabled. */\n isDisabled?: boolean;\n
|
|
1
|
+
{"version":3,"file":"Label.mjs","sources":["../../../../../../../src/components/Label/Label.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport styles from \"./Label.module.scss\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface LabelProps\n extends\n PropsWithChildren<Omit<Aria.LabelProps, \"children\">>,\n FlowComponentProps<HTMLLabelElement> {\n /** Whether the label should show an \"optional\" indicator. */\n optional?: boolean;\n /** Whether the label should be displayed as disabled. */\n isDisabled?: boolean;\n /** @internal */\n unstyled?: boolean;\n}\n\n/** @flr-generate all */\nexport const Label = flowComponent(\"Label\", (props) => {\n const {\n children,\n className,\n optional,\n isDisabled,\n ref,\n unstyled = false,\n ...rest\n } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Label\");\n\n const rootClassName = unstyled\n ? className\n : clsx(styles.label, isDisabled && styles.disabled, className);\n\n const optionalMarker = (\n <span className={styles.optional}>\n {stringFormatter.format(\"optional\")}\n </span>\n );\n\n const propsContext: PropsContext = {\n ContextualHelpTrigger: {\n tunnel: {\n id: \"contextualHelp\",\n component: \"Label\",\n },\n Button: {\n tunnel: null,\n },\n },\n Button: {\n tunnel: {\n id: \"right\",\n component: \"Label\",\n },\n size: \"s\",\n },\n Action: {\n tunnel: {\n id: \"right\",\n component: \"Label\",\n },\n Button: {\n tunnel: null,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <Aria.Label {...rest} className={rootClassName} ref={ref}>\n {children}\n {optional && optionalMarker}\n <UiComponentTunnelExit id=\"contextualHelp\" component=\"Label\">\n {(children) => {\n if (React.Children.count(children) >= 1) {\n return children;\n }\n\n return undefined;\n }}\n </UiComponentTunnelExit>\n <UiComponentTunnelExit id=\"right\" component=\"Label\">\n {(children) => {\n if (React.Children.count(children) >= 1) {\n return <div className={styles.right}>{children}</div>;\n }\n\n return undefined;\n }}\n </UiComponentTunnelExit>\n </Aria.Label>\n </PropsContextProvider>\n );\n});\n\nexport default Label;\n"],"names":["children"],"mappings":";;;;;;;;;;;AAyBO,MAAM,KAAA,GAAQ,aAAA,CAAc,OAAA,EAAS,CAAC,KAAA,KAAU;AACrD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAA;AAAA,IACA,QAAA,GAAW,KAAA;AAAA,IACX,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,eA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,CAAS,KAAA,CAAMA,SAAQ,KAAK,CAAA,EAAG;AACvC,QAAA,OAAOA,SAAAA;AAAA,MACT;AAEA,MAAA,OAAO,MAAA;AAAA,IACT,CAAA,EACF,CAAA;AAAA,wBACC,qBAAA,EAAA,EAAsB,EAAA,EAAG,SAAQ,SAAA,EAAU,OAAA,EACzC,WAACA,SAAAA,KAAa;AACb,MAAA,IAAI,KAAA,CAAM,QAAA,CAAS,KAAA,CAAMA,SAAQ,KAAK,CAAA,EAAG;AACvC,QAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,KAAA,EAAQ,UAAAA,SAAAA,EAAS,CAAA;AAAA,MACjD;AAEA,MAAA,OAAO,MAAA;AAAA,IACT,CAAA,EACF;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -4,7 +4,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useId } from 'react';
|
|
5
5
|
import styles from './LabeledValue.module.scss.mjs';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
8
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
8
|
|
|
10
9
|
const LabeledValue = (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledValue.mjs","sources":["../../../../../../../src/components/LabeledValue/LabeledValue.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useId } from \"react\";\nimport styles from \"./LabeledValue.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\n\nexport interface LabeledValueProps\n extends PropsWithChildren, PropsWithClassName {}\n\n/** @flr-generate all */\nexport const LabeledValue: FC<LabeledValueProps> = (props) => {\n const { children, className } = props;\n\n const rootClassName = clsx(styles.labeledValue, className);\n\n const labelId = useId();\n\n const propsContext: PropsContext = {\n Label: {\n className: styles.label,\n elementType: \"span\",\n id: labelId,\n },\n CopyButton: {\n className: styles.button,\n variant: \"plain\",\n size: \"s\",\n },\n Button: {\n className: styles.button,\n size: \"s\",\n },\n Link: {\n inline: true,\n },\n };\n\n return (\n <div className={rootClassName} role=\"group\" aria-labelledby={labelId}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </div>\n );\n};\n\nexport default LabeledValue;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LabeledValue.mjs","sources":["../../../../../../../src/components/LabeledValue/LabeledValue.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useId } from \"react\";\nimport styles from \"./LabeledValue.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\n\nexport interface LabeledValueProps\n extends PropsWithChildren, PropsWithClassName {}\n\n/** @flr-generate all */\nexport const LabeledValue: FC<LabeledValueProps> = (props) => {\n const { children, className } = props;\n\n const rootClassName = clsx(styles.labeledValue, className);\n\n const labelId = useId();\n\n const propsContext: PropsContext = {\n Label: {\n className: styles.label,\n elementType: \"span\",\n id: labelId,\n },\n CopyButton: {\n className: styles.button,\n variant: \"plain\",\n size: \"s\",\n },\n Button: {\n className: styles.button,\n size: \"s\",\n },\n Link: {\n inline: true,\n },\n };\n\n return (\n <div className={rootClassName} role=\"group\" aria-labelledby={labelId}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </div>\n );\n};\n\nexport default LabeledValue;\n"],"names":[],"mappings":";;;;;;AAWO,MAAM,YAAA,GAAsC,CAAC,KAAA,KAAU;AAC5D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,KAAA;AAEhC,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,MAAA,CAAO,YAAA,EAAc,SAAS,CAAA;AAEzD,EAAA,MAAM,UAAU,KAAA,EAAM;AAEtB,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,KAAA,EAAO;AAAA,MACL,WAAW,MAAA,CAAO,KAAA;AAAA,MAClB,WAAA,EAAa,MAAA;AAAA,MACb,EAAA,EAAI;AAAA,KACN;AAAA,IACA,UAAA,EAAY;AAAA,MACV,WAAW,MAAA,CAAO,MAAA;AAAA,MAClB,OAAA,EAAS,OAAA;AAAA,MACT,IAAA,EAAM;AAAA,KACR;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,WAAW,MAAA,CAAO,MAAA;AAAA,MAClB,IAAA,EAAM;AAAA,KACR;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,MAAA,EAAQ;AAAA;AACV,GACF;AAEA,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,aAAA,EAAe,IAAA,EAAK,OAAA,EAAQ,iBAAA,EAAiB,OAAA,EAC3D,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,UACH,CAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -4,7 +4,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import styles from './LayoutCard.module.scss.mjs';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
7
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
8
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
8
|
|
|
10
9
|
const LayoutCard = flowComponent(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutCard.mjs","sources":["../../../../../../../src/components/LayoutCard/LayoutCard.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./LayoutCard.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsWithElementType } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\n\nexport interface LayoutCardProps\n extends\n PropsWithChildren,\n PropsWithElementType<\"div\" | \"main\" | \"footer\" | \"header\">,\n FlowComponentProps {}\n\n/** @flr-generate all */\nexport const LayoutCard = flowComponent(\n \"LayoutCard\",\n (props) => {\n const { children, className, elementType = \"div\", ref, ...rest } = props;\n\n const rootClassName = clsx(styles.layoutCard, className);\n\n const Element = elementType;\n\n const propsContext: PropsContext = {\n TabNavigation: {\n className: styles.tabNavigation,\n },\n AccentBox: { className: styles.accentBox },\n };\n\n return (\n <Element className={rootClassName} {...rest} ref={ref}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Element>\n );\n },\n { type: \"layout\" },\n);\n\nexport default LayoutCard;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LayoutCard.mjs","sources":["../../../../../../../src/components/LayoutCard/LayoutCard.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./LayoutCard.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsWithElementType } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\n\nexport interface LayoutCardProps\n extends\n PropsWithChildren,\n PropsWithElementType<\"div\" | \"main\" | \"footer\" | \"header\">,\n FlowComponentProps {}\n\n/** @flr-generate all */\nexport const LayoutCard = flowComponent(\n \"LayoutCard\",\n (props) => {\n const { children, className, elementType = \"div\", ref, ...rest } = props;\n\n const rootClassName = clsx(styles.layoutCard, className);\n\n const Element = elementType;\n\n const propsContext: PropsContext = {\n TabNavigation: {\n className: styles.tabNavigation,\n },\n AccentBox: { className: styles.accentBox },\n };\n\n return (\n <Element className={rootClassName} {...rest} ref={ref}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Element>\n );\n },\n { type: \"layout\" },\n);\n\nexport default LayoutCard;\n"],"names":[],"mappings":";;;;;;AAgBO,MAAM,UAAA,GAAa,aAAA;AAAA,EACxB,YAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,UAAU,SAAA,EAAW,WAAA,GAAc,OAAO,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAEnE,IAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,MAAA,CAAO,UAAA,EAAY,SAAS,CAAA;AAEvD,IAAA,MAAM,OAAA,GAAU,WAAA;AAEhB,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,aAAA,EAAe;AAAA,QACb,WAAW,MAAA,CAAO;AAAA,OACpB;AAAA,MACA,SAAA,EAAW,EAAE,SAAA,EAAW,MAAA,CAAO,SAAA;AAAU,KAC3C;AAEA,IAAA,uBACE,GAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAW,aAAA,EAAgB,GAAG,IAAA,EAAM,GAAA,EAC3C,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,CAAA,EACF,CAAA;AAAA,EAEJ,CAAA;AAAA,EACA,EAAE,MAAM,QAAA;AACV;;;;"}
|
|
@@ -4,7 +4,6 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
4
4
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
5
5
|
import { Overlay } from '../Overlay/Overlay.mjs';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
8
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
8
|
import { IconClose } from '../Icon/components/icons/IconClose.mjs';
|
|
10
9
|
import styles from './LightBox.module.scss.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightBox.mjs","sources":["../../../../../../../src/components/LightBox/LightBox.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { Overlay } from \"@/components/Overlay/Overlay\";\nimport clsx from \"clsx\";\nimport type { OverlayController } from \"@/lib/controller\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport styles from \"./LightBox.module.scss\";\nimport DivView from \"@/views/DivView\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\n\nexport interface LightBoxProps\n extends PropsWithChildren, FlowComponentProps, PropsWithClassName {\n /** An overlay controller to control the light box state. */\n controller?: OverlayController;\n /**\n * Whether content can be displayed larger than the available space in the\n * screen. @default true\n */\n fitScreen?: boolean;\n}\n\nexport const LightBox = flowComponent(\"LightBox\", (props) => {\n const {\n controller: controllerFromProps,\n children,\n ref: ignoredRef,\n className,\n fitScreen = true,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.lightBox,\n fitScreen && styles.fitScreen,\n className,\n );\n\n const propsContext: PropsContext = {\n ActionGroup: {\n preserveOrder: true,\n spacing: \"m\",\n className: styles.actionGroup,\n Button: { variant: \"solid\", color: \"light-static\" },\n tunnel: {\n id: \"actionGroup\",\n component: \"LightBox\",\n },\n },\n LightBoxGallery: {\n className: styles.gallery,\n },\n };\n\n const controllerFromContext = useOverlayController(\"LightBox\", {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"LightBox\");\n\n return (\n <Overlay\n overlayType=\"LightBox\"\n className={rootClassName}\n controller={controller}\n {...rest}\n >\n <PropsContextProvider props={propsContext}>\n <DivView className={styles.content}>{children}</DivView>\n <DivView className={styles.actions}>\n <ButtonView\n color=\"light-static\"\n variant=\"solid\"\n onPress={() => controller.close()}\n aria-label={stringFormatter.format(\"close\")}\n >\n <IconClose />\n </ButtonView>\n <UiComponentTunnelExit id=\"actionGroup\" component=\"LightBox\" />\n </DivView>\n </PropsContextProvider>\n </Overlay>\n );\n});\n\nexport default LightBox;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LightBox.mjs","sources":["../../../../../../../src/components/LightBox/LightBox.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { Overlay } from \"@/components/Overlay/Overlay\";\nimport clsx from \"clsx\";\nimport type { OverlayController } from \"@/lib/controller\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport styles from \"./LightBox.module.scss\";\nimport DivView from \"@/views/DivView\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\n\nexport interface LightBoxProps\n extends PropsWithChildren, FlowComponentProps, PropsWithClassName {\n /** An overlay controller to control the light box state. */\n controller?: OverlayController;\n /**\n * Whether content can be displayed larger than the available space in the\n * screen. @default true\n */\n fitScreen?: boolean;\n}\n\nexport const LightBox = flowComponent(\"LightBox\", (props) => {\n const {\n controller: controllerFromProps,\n children,\n ref: ignoredRef,\n className,\n fitScreen = true,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.lightBox,\n fitScreen && styles.fitScreen,\n className,\n );\n\n const propsContext: PropsContext = {\n ActionGroup: {\n preserveOrder: true,\n spacing: \"m\",\n className: styles.actionGroup,\n Button: { variant: \"solid\", color: \"light-static\" },\n tunnel: {\n id: \"actionGroup\",\n component: \"LightBox\",\n },\n },\n LightBoxGallery: {\n className: styles.gallery,\n },\n };\n\n const controllerFromContext = useOverlayController(\"LightBox\", {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"LightBox\");\n\n return (\n <Overlay\n overlayType=\"LightBox\"\n className={rootClassName}\n controller={controller}\n {...rest}\n >\n <PropsContextProvider props={propsContext}>\n <DivView className={styles.content}>{children}</DivView>\n <DivView className={styles.actions}>\n <ButtonView\n color=\"light-static\"\n variant=\"solid\"\n onPress={() => controller.close()}\n aria-label={stringFormatter.format(\"close\")}\n >\n <IconClose />\n </ButtonView>\n <UiComponentTunnelExit id=\"actionGroup\" component=\"LightBox\" />\n </DivView>\n </PropsContextProvider>\n </Overlay>\n );\n});\n\nexport default LightBox;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA+BO,MAAM,QAAA,GAAW,aAAA,CAAc,UAAA,EAAY,CAAC,KAAA,KAAU;AAC3D,EAAA,MAAM;AAAA,IACJ,UAAA,EAAY,mBAAA;AAAA,IACZ,QAAA;AAAA,IACA,GAAA,EAAK,UAAA;AAAA,IACL,SAAA;AAAA,IACA,SAAA,GAAY,IAAA;AAAA,IACZ,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,QAAA;AAAA,IACP,aAAa,MAAA,CAAO,SAAA;AAAA,IACpB;AAAA,GACF;AAEA,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,WAAA,EAAa;AAAA,MACX,aAAA,E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AAA;AAAA,WACb;AAAA,0BACA,GAAA,CAAC,qBAAA,EAAA,EAAsB,EAAA,EAAG,aAAA,EAAc,WAAU,UAAA,EAAW;AAAA,SAAA,EAC/D;AAAA,OAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { flowComponent } from '../../../../lib/componentFactory/flowComponent.mjs';
|
|
5
5
|
import styles from '../LightBoxGallery/LightBoxGallery.module.scss.mjs';
|
|
6
|
-
import '../../../../lib/propsContext/propsContext.mjs';
|
|
7
6
|
import { PropsContextProvider } from '../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
7
|
import { IconClose } from '../../../Icon/components/icons/IconClose.mjs';
|
|
9
8
|
import 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightBoxGalleryItem.mjs","sources":["../../../../../../../../../src/components/LightBox/components/LightBoxGalleryItem/LightBoxGalleryItem.tsx"],"sourcesContent":["import { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport styles from \"@/components/LightBox/components/LightBoxGallery/LightBoxGallery.module.scss\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport { useOverlayController } from \"@/lib/hooks\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../locales/*.locale.json\";\nimport { Button } from \"@/components/Button\";\nimport type { PropsWithChildren } from \"react\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport type LightBoxGalleryItemProps = PropsWithChildren;\n\n/** @flr-generate all */\nexport const LightBoxGalleryItem = flowComponent(\n \"LightBoxGalleryItem\",\n (props) => {\n const { children } = props;\n\n const controller = useOverlayController(\"Modal\");\n\n const propsContext: PropsContext = {\n ActionGroup: {\n spacing: \"m\",\n className: styles.actionGroup,\n Button: { color: \"light-static\" },\n tunnel: { id: \"actionGroup\", component: \"LightBoxGalleryItem\" },\n },\n Image: { className: styles.image },\n };\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n return (\n <PropsContextProvider props={propsContext}>\n {children}\n <div className={styles.actions}>\n <Button\n aria-label={stringFormatter.format(\"close\")}\n color=\"light-static\"\n onPress={() => controller.close()}\n >\n <IconClose />\n </Button>\n <UiComponentTunnelExit\n id=\"actionGroup\"\n component=\"LightBoxGalleryItem\"\n />\n </div>\n </PropsContextProvider>\n );\n },\n);\n\nexport default LightBoxGalleryItem;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LightBoxGalleryItem.mjs","sources":["../../../../../../../../../src/components/LightBox/components/LightBoxGalleryItem/LightBoxGalleryItem.tsx"],"sourcesContent":["import { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport styles from \"@/components/LightBox/components/LightBoxGallery/LightBoxGallery.module.scss\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport { useOverlayController } from \"@/lib/hooks\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../locales/*.locale.json\";\nimport { Button } from \"@/components/Button\";\nimport type { PropsWithChildren } from \"react\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport type LightBoxGalleryItemProps = PropsWithChildren;\n\n/** @flr-generate all */\nexport const LightBoxGalleryItem = flowComponent(\n \"LightBoxGalleryItem\",\n (props) => {\n const { children } = props;\n\n const controller = useOverlayController(\"Modal\");\n\n const propsContext: PropsContext = {\n ActionGroup: {\n spacing: \"m\",\n className: styles.actionGroup,\n Button: { color: \"light-static\" },\n tunnel: { id: \"actionGroup\", component: \"LightBoxGalleryItem\" },\n },\n Image: { className: styles.image },\n };\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n return (\n <PropsContextProvider props={propsContext}>\n {children}\n <div className={styles.actions}>\n <Button\n aria-label={stringFormatter.format(\"close\")}\n color=\"light-static\"\n onPress={() => controller.close()}\n >\n <IconClose />\n </Button>\n <UiComponentTunnelExit\n id=\"actionGroup\"\n component=\"LightBoxGalleryItem\"\n />\n </div>\n </PropsContextProvider>\n );\n },\n);\n\nexport default LightBoxGalleryItem;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAcO,MAAM,mBAAA,GAAsB,aAAA;AAAA,EACjC,qBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AAErB,IAAA,MAAM,UAAA,GAAa,qBAAqB,OAAO,CAAA;AAE/C,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,WAAA,EAAa;AAAA,QACX,OAAA,EAAS,GAAA;AAAA,QACT,WAAW,MAAA,CAAO,WAAA;AAAA,QAClB,MAAA,EAAQ,EAAE,KAAA,EAAO,cAAA,EAAe;AAAA,QAChC,MAAA,EAAQ,EAAE,EAAA,EAAI,aAAA,EAAe,WAAW,qBAAA;AAAsB,OAChE;AAAA,MACA,KAAA,EAAO,EAAE,SAAA,EAAW,MAAA,CAAO,KAAA;AAAM,KACnC;AAEA,IAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,IAAA,uBACE,IAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EAAA;AAAA,MAAA,QAAA;AAAA,sBACD,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,OAAA,EACrB,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,YAAA,EAAY,eAAA,CAAgB,MAAA,CAAO,OAAO,CAAA;AAAA,YAC1C,KAAA,EAAM,cAAA;AAAA,YACN,OAAA,EAAS,MAAM,UAAA,CAAW,KAAA,EAAM;AAAA,YAEhC,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA,SACb;AAAA,wBACA,GAAA;AAAA,UAAC,qBAAA;AAAA,UAAA;AAAA,YACC,EAAA,EAAG,aAAA;AAAA,YACH,SAAA,EAAU;AAAA;AAAA;AACZ,OAAA,EACF;AAAA,KAAA,EACF,CAAA;AAAA,EAEJ;AACF;;;;"}
|
|
@@ -4,7 +4,6 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useContext } from 'react';
|
|
5
5
|
import * as Aria from 'react-aria-components';
|
|
6
6
|
import { dynamic } from '../../lib/propsContext/dynamicProps/dynamic.mjs';
|
|
7
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
8
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
8
|
import styles from './Link.module.scss.mjs';
|
|
10
9
|
import clsx from 'clsx';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.mjs","sources":["../../../../../../../src/components/Link/Link.tsx"],"sourcesContent":["import type {\n ComponentProps,\n ComponentType,\n CSSProperties,\n MouseEvent,\n PropsWithChildren,\n} from \"react\";\nimport { useContext } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { dynamic, type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport styles from \"./Link.module.scss\";\nimport clsx from \"clsx\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport {\n type AlphaColor,\n isAlphaColor,\n type PropsWithClassName,\n} from \"@/lib/types/props\";\nimport { linkContext } from \"@/components/Link/context\";\nimport { Text } from \"@/components/Text\";\nimport { LinkIcon } from \"@/components/Link/components/LinkIcon\";\nimport { handleLinkClick, useRouter } from \"@react-aria/utils\";\n\nexport interface LinkProps\n extends\n PropsWithChildren<Omit<Aria.LinkProps, \"children\" | \"slot\" | \"className\">>,\n FlowComponentProps<HTMLAnchorElement>,\n PropsWithClassName {\n /** Whether the link should be styled for being displayed inside a text. */\n inline?: boolean;\n /** An alternative link component. */\n linkComponent?: ComponentType<Omit<ComponentProps<\"a\">, \"ref\">>;\n /** The color of the link. @default \"default\" */\n color?: \"default\" | AlphaColor;\n \"aria-current\"?: string;\n slot?: string;\n /** The whiteSpace css value of the element. */\n whiteSpace?: CSSProperties[\"whiteSpace\"];\n /** The size of the element. @default \"m\" */\n size?: \"s\" | \"m\";\n /** @internal */\n unstyled?: boolean;\n}\n\n/** @flr-generate all */\nexport const Link = flowComponent(\"Link\", (props) => {\n const {\n children,\n className,\n inline,\n linkComponent: linkComponentFromProps,\n color = \"default\",\n unstyled = false,\n \"aria-current\": ariaCurrent,\n ref,\n slot: ignoredSlotProp,\n style,\n whiteSpace,\n size = \"m\",\n onClickCapture: onClickCaptureFromProps,\n ...rest\n } = props;\n\n const { linkComponent: linkComponentFromContext } = useContext(linkContext);\n const Link = linkComponentFromProps\n ? (linkComponentFromProps as typeof Aria.Link)\n : props.href && linkComponentFromContext\n ? (linkComponentFromContext as typeof Aria.Link)\n : Aria.Link;\n\n const router = useRouter();\n\n /**\n * An interactive child (e.g. a Button) stops click propagation via React\n * Aria's `usePress`, so the anchor's own `onClick` never runs and navigation\n * falls back to a full page load. Handling it in the capture phase (top-down,\n * before the child) keeps navigation client-side. Only needed for React\n * Aria's `<a>`; custom link components handle navigation themselves.\n */\n const handleClickCapture =\n Link === Aria.Link && props.href\n ? (event: MouseEvent<HTMLAnchorElement>) => {\n onClickCaptureFromProps?.(event);\n if (event.target !== event.currentTarget) {\n handleLinkClick(event, router, props.href, props.routerOptions);\n }\n }\n : onClickCaptureFromProps;\n\n const rootClassName = unstyled\n ? className\n : clsx(\n styles.link,\n inline && styles.inline,\n isAlphaColor(color) && styles[color],\n size === \"s\" && styles[\"size-s\"],\n className,\n );\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n size: \"s\",\n },\n AlertText: {\n className: styles.alertText,\n },\n AccentBox: { className: styles.accentBox },\n LayoutCard: { className: styles.layoutCard },\n Button: {\n elementType: \"span\",\n className: styles.button,\n size: props.size,\n color: props.color === \"default\" ? undefined : props.color,\n isDisabled: props.isDisabled,\n children: dynamic((buttonProps) => (\n <>\n <Text>{buttonProps.children}</Text>\n <LinkIcon {...props} />\n </>\n )),\n },\n };\n\n const unsupportedTypingsLinkProps = ariaCurrent\n ? ({\n \"aria-current\": true,\n } as Record<string, unknown>)\n : {};\n\n return (\n <Link\n {...unsupportedTypingsLinkProps}\n {...rest}\n onClickCapture={handleClickCapture}\n className={rootClassName}\n ref={ref}\n style={{ ...style, whiteSpace }}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n <LinkIcon {...props} />\n </PropsContextProvider>\n </Link>\n );\n});\n\nexport default Link;\n"],"names":["Link"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Link.mjs","sources":["../../../../../../../src/components/Link/Link.tsx"],"sourcesContent":["import type {\n ComponentProps,\n ComponentType,\n CSSProperties,\n MouseEvent,\n PropsWithChildren,\n} from \"react\";\nimport { useContext } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { dynamic, type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport styles from \"./Link.module.scss\";\nimport clsx from \"clsx\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport {\n type AlphaColor,\n isAlphaColor,\n type PropsWithClassName,\n} from \"@/lib/types/props\";\nimport { linkContext } from \"@/components/Link/context\";\nimport { Text } from \"@/components/Text\";\nimport { LinkIcon } from \"@/components/Link/components/LinkIcon\";\nimport { handleLinkClick, useRouter } from \"@react-aria/utils\";\n\nexport interface LinkProps\n extends\n PropsWithChildren<Omit<Aria.LinkProps, \"children\" | \"slot\" | \"className\">>,\n FlowComponentProps<HTMLAnchorElement>,\n PropsWithClassName {\n /** Whether the link should be styled for being displayed inside a text. */\n inline?: boolean;\n /** An alternative link component. */\n linkComponent?: ComponentType<Omit<ComponentProps<\"a\">, \"ref\">>;\n /** The color of the link. @default \"default\" */\n color?: \"default\" | AlphaColor;\n /** Marks the link as the currently active one, e.g. in a navigation. */\n \"aria-current\"?: string;\n /** The name of the slot the link is placed in. */\n slot?: string;\n /** The whiteSpace css value of the element. */\n whiteSpace?: CSSProperties[\"whiteSpace\"];\n /** The size of the element. @default \"m\" */\n size?: \"s\" | \"m\";\n /** @internal */\n unstyled?: boolean;\n}\n\n/** @flr-generate all */\nexport const Link = flowComponent(\"Link\", (props) => {\n const {\n children,\n className,\n inline,\n linkComponent: linkComponentFromProps,\n color = \"default\",\n unstyled = false,\n \"aria-current\": ariaCurrent,\n ref,\n slot: ignoredSlotProp,\n style,\n whiteSpace,\n size = \"m\",\n onClickCapture: onClickCaptureFromProps,\n ...rest\n } = props;\n\n const { linkComponent: linkComponentFromContext } = useContext(linkContext);\n const Link = linkComponentFromProps\n ? (linkComponentFromProps as typeof Aria.Link)\n : props.href && linkComponentFromContext\n ? (linkComponentFromContext as typeof Aria.Link)\n : Aria.Link;\n\n const router = useRouter();\n\n /**\n * An interactive child (e.g. a Button) stops click propagation via React\n * Aria's `usePress`, so the anchor's own `onClick` never runs and navigation\n * falls back to a full page load. Handling it in the capture phase (top-down,\n * before the child) keeps navigation client-side. Only needed for React\n * Aria's `<a>`; custom link components handle navigation themselves.\n */\n const handleClickCapture =\n Link === Aria.Link && props.href\n ? (event: MouseEvent<HTMLAnchorElement>) => {\n onClickCaptureFromProps?.(event);\n if (event.target !== event.currentTarget) {\n handleLinkClick(event, router, props.href, props.routerOptions);\n }\n }\n : onClickCaptureFromProps;\n\n const rootClassName = unstyled\n ? className\n : clsx(\n styles.link,\n inline && styles.inline,\n isAlphaColor(color) && styles[color],\n size === \"s\" && styles[\"size-s\"],\n className,\n );\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n size: \"s\",\n },\n AlertText: {\n className: styles.alertText,\n },\n AccentBox: { className: styles.accentBox },\n LayoutCard: { className: styles.layoutCard },\n Button: {\n elementType: \"span\",\n className: styles.button,\n size: props.size,\n color: props.color === \"default\" ? undefined : props.color,\n isDisabled: props.isDisabled,\n children: dynamic((buttonProps) => (\n <>\n <Text>{buttonProps.children}</Text>\n <LinkIcon {...props} />\n </>\n )),\n },\n };\n\n const unsupportedTypingsLinkProps = ariaCurrent\n ? ({\n \"aria-current\": true,\n } as Record<string, unknown>)\n : {};\n\n return (\n <Link\n {...unsupportedTypingsLinkProps}\n {...rest}\n onClickCapture={handleClickCapture}\n className={rootClassName}\n ref={ref}\n style={{ ...style, whiteSpace }}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n <LinkIcon {...props} />\n </PropsContextProvider>\n </Link>\n );\n});\n\nexport default Link;\n"],"names":["Link"],"mappings":";;;;;;;;;;;;;;AAiDO,MAAM,IAAA,GAAO,aAAA,CAAc,MAAA,EAAQ,CAAC,KAAA,KAAU;AACnD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,aAAA,EAAe,sBAAA;AAAA,IACf,KAAA,GAAQ,SAAA;AAAA,IACR,QAAA,GAAW,KAAA;AAAA,IACX,cAAA,EAAgB,WAAA;AAAA,IAChB,GAAA;AAAA,IACA,IAAA,EAAM,eAAA;AAAA,IACN,KAAA;AAAA,IACA,UAAA;AAAA,IACA,IAAA,GAAO,GAAA;AAAA,IACP,cAAA,EAAgB,uBAAA;AAAA,IAChB,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,EAAE,aAAA,EAAe,wBAAA,EAAyB,GAAI,WAAW,WAAW,CAAA;AAC1E,EAAA,MAAMA,QAAO,sBAAA,GACR,sBAAA,GACD,MAAM,IAAA,IAAQ,wBAAA,GACX,2BACD,IAAA,CAAK,IAAA;AAEX,EAAA,MAAM,SAAS,SAAA,EAAU;AASzB,EAAA,MAAM,qBACJA,KAAAA,KAAS,IAAA,CAAK,QAAQ,KAAA,CAAM,IAAA,GAC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AA,EAAM,sBAAY,QAAA,EAAS,CAAA;AAAA,wBAC5B,GAAA,CAAC,QAAA,EAAA,EAAU,GAAG,KAAA,EAAO;AAAA,OAAA,EACvB,CACD;AAAA;AACH,GACF;AAEA,EAAA,MAAM,8BAA8B,WAAA,GAC/B;AAAA,IACC,cAAA,EAAgB;AAAA,MAElB,EAAC;AAEL,EAAA,uBACE,GAAA;AAAA,IAACA,KAAAA;AAAA,IAAA;AAAA,MACE,GAAG,2BAAA;AAAA,MACH,GAAG,IAAA;AAAA,MACJ,cAAA,EAAgB,kBAAA;AAAA,MAChB,SAAA,EAAW,aAAA;AAAA,MACX,GAAA;AAAA,MACA,KAAA,EAAO,EAAE,GAAG,KAAA,EAAO,UAAA,EAAW;AAAA,MAE9B,QAAA,kBAAA,IAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EAAA;AAAA,QAAA,QAAA;AAAA,wBACD,GAAA,CAAC,QAAA,EAAA,EAAU,GAAG,KAAA,EAAO;AAAA,OAAA,EACvB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -21,7 +21,6 @@ import { TableColumn } from './setupComponents/TableColumn.mjs';
|
|
|
21
21
|
import { TableHeader } from './setupComponents/TableHeader.mjs';
|
|
22
22
|
import { TableRow } from './setupComponents/TableRow.mjs';
|
|
23
23
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
24
|
-
import '../../lib/propsContext/propsContext.mjs';
|
|
25
24
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
26
25
|
import { deepFindOfType, deepFilterByType } from '../../lib/react/deepFindOfType.mjs';
|
|
27
26
|
import DivView from '../../views/DivView.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.mjs","sources":["../../../../../../../src/components/List/List.tsx"],"sourcesContent":["import { DataLoader } from \"@/components/List/components/DataLoader\";\nimport { Header } from \"@/components/List/components/Header/Header\";\nimport headerStyles from \"@/components/List/components/Header/Header.module.scss\";\nimport { Items } from \"@/components/List/components/Items/Items\";\nimport { Table } from \"@/components/List/components/Table\";\nimport ListModel from \"@/components/List/model/List\";\nimport type { IncrementalLoaderShape } from \"@/components/List/model/loading/types\";\nimport type { ListShape } from \"@/components/List/model/types\";\nimport { ListFilter } from \"@/components/List/setupComponents/ListFilter\";\nimport { ListItem } from \"@/components/List/setupComponents/ListItem\";\nimport { ListLoaderAsync } from \"@/components/List/setupComponents/ListLoaderAsync\";\nimport { ListLoaderAsyncResource } from \"@/components/List/setupComponents/ListLoaderAsyncResource\";\nimport { ListSearch } from \"@/components/List/setupComponents/ListSearch\";\nimport { ListSorting } from \"@/components/List/setupComponents/ListSorting\";\nimport { ListStaticData } from \"@/components/List/setupComponents/ListStaticData\";\nimport { Table as TableSetupComponent } from \"@/components/List/setupComponents/Table\";\nimport { TableBody } from \"@/components/List/setupComponents/TableBody\";\nimport { TableCell } from \"@/components/List/setupComponents/TableCell\";\nimport { TableColumn } from \"@/components/List/setupComponents/TableColumn\";\nimport { TableHeader } from \"@/components/List/setupComponents/TableHeader\";\nimport { TableRow } from \"@/components/List/setupComponents/TableRow\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { deepFilterByType, deepFindOfType } from \"@/lib/react/deepFindOfType\";\nimport DivView from \"@/views/DivView\";\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport Footer from \"./components/Footer\";\nimport styles from \"./List.module.scss\";\nimport { listContext } from \"./listContext\";\nimport { ListLoaderHooks } from \"@/components/List/setupComponents/ListLoaderHooks\";\nimport { UiComponentTunnelExit } from \"../UiComponentTunnel/UiComponentTunnelExit\";\nimport ListEmptyViewContainerView from \"@/views/ListEmptyViewContainerView\";\n\nexport interface ListProps<T, TMeta = unknown>\n extends\n PropsWithChildren,\n FlowComponentProps,\n Omit<\n ListShape<T, TMeta>,\n | \"search\"\n | \"loader\"\n | \"itemView\"\n | \"table\"\n | \"batchesController\"\n | \"filters\"\n | \"sorting\"\n > {\n /** The number of items to be displayed on one page. */\n batchSize?: number;\n /**\n * Automatically loads the next batch of items when the user scrolls to the\n * end of the list, instead of showing a \"Show more\" button.\n *\n * @default false\n */\n infiniteScroll?: boolean;\n hidePagination?: boolean;\n emptySearchResultView?: ReactNode;\n emptyView?: ReactNode;\n}\n\nexport const List = flowComponent(\"List\", (props) => {\n const {\n children,\n batchSize,\n loadingItemsCount = batchSize,\n onChange,\n ref,\n hidePagination,\n ...restProps\n } = props;\n\n const listLoaderAsync = deepFindOfType(\n children,\n ListLoaderAsync<never>,\n )?.props;\n const listLoaderHooks = deepFindOfType(\n children,\n ListLoaderHooks<never>,\n )?.props;\n const listLoaderAsyncResource = deepFindOfType(\n children,\n ListLoaderAsyncResource<never>,\n )?.props;\n const listStaticData = deepFindOfType(children, ListStaticData<never>)?.props;\n\n const loaderShape: IncrementalLoaderShape<never> = {\n source: listLoaderAsync\n ? {\n ...listLoaderAsync,\n asyncLoader: listLoaderAsync.children,\n }\n : listLoaderAsyncResource\n ? {\n ...listLoaderAsyncResource,\n asyncResourceFactory: listLoaderAsyncResource.children,\n }\n : listStaticData\n ? {\n staticData: listStaticData.data,\n }\n : listLoaderHooks\n ? {\n ...listLoaderHooks,\n useData: listLoaderHooks.children,\n }\n : undefined,\n };\n\n const searchProps = deepFindOfType(children, ListSearch)?.props;\n const itemViewProps = deepFindOfType(children, ListItem<never>)?.props;\n\n const tableProps = deepFindOfType(children, TableSetupComponent)?.props;\n const tableColumnProps = deepFilterByType(children, TableColumn<never>).map(\n (c) => ({\n ...c.props,\n name: c.props.children,\n }),\n );\n const tableCellProps = deepFilterByType(children, TableCell<never>).map(\n (c) => ({\n ...c.props,\n renderFn: c.props.children,\n }),\n );\n\n const tableRowProps = deepFindOfType(children, TableRow)?.props;\n const tableHeaderProps = deepFindOfType(children, TableHeader)?.props;\n const tableBodyProps = deepFindOfType(children, TableBody)?.props;\n\n const listModel = ListModel.useNew<never>({\n onChange,\n loader: loaderShape,\n filters: deepFilterByType(children, ListFilter<never, never, never>).map(\n (f) => ({\n ...f.props,\n renderItem: f.props.children,\n }),\n ),\n search: searchProps\n ? {\n render: searchProps.children,\n textFieldProps: searchProps,\n defaultValue: searchProps.defaultValue,\n autosave: searchProps.autosave,\n }\n : undefined,\n sorting: deepFilterByType(children, ListSorting<never>).map((s) => s.props),\n\n itemView: itemViewProps\n ? {\n ...itemViewProps,\n renderFn: itemViewProps.children,\n }\n : undefined,\n\n table:\n tableColumnProps.length > 0\n ? {\n header: {\n ...tableHeaderProps,\n columns: tableColumnProps,\n },\n body: {\n ...tableBodyProps,\n row: {\n ...tableRowProps,\n cells: tableCellProps,\n },\n },\n ...tableProps,\n }\n : undefined,\n\n batchesController: {\n batchSize,\n },\n loadingItemsCount,\n ...restProps,\n });\n\n const propsContext: PropsContext = {\n ActionGroup: {\n preserveOrder: true,\n tunnel: {\n id: \"actions\",\n component: \"List\",\n },\n className: headerStyles.actions,\n Button: {\n className: headerStyles.action,\n },\n },\n ListSummary: {\n tunnel: {\n id: \"listSummary\",\n component: \"List\",\n },\n },\n };\n\n const isEmpty = listModel.useIsEmpty();\n\n // IMPORTANT: we always render the emptyView to the dom.\n // otherwise we will lose e.g. modalState when switching from noItems to itemsAvailable and vise versa.\n const emptyView = (\n <DivView\n aria-hidden={!isEmpty}\n className={!isEmpty ? styles.hideVisuallyEmptyView : undefined}\n >\n <ListEmptyViewContainerView\n viewType={listModel.getEmptyViewType()}\n emptySearchResultView={listModel.emptySearchResultView}\n emptyView={listModel.emptyView}\n />\n </DivView>\n );\n\n return (\n <PropsContextProvider props={propsContext}>\n <listContext.Provider\n value={{\n list: listModel,\n }}\n >\n <DataLoader />\n <DivView className={styles.list} ref={ref}>\n {children}\n <Header />\n\n <DivView className={styles.listWrapper}>\n {emptyView}\n {listModel.items.entries.length > 0 && (\n <UiComponentTunnelExit id=\"listSummary\" component=\"List\" />\n )}\n {(listModel.viewMode.isList || listModel.viewMode.isTiles) && (\n <Items />\n )}\n {listModel.viewMode.isTable && <Table />}\n </DivView>\n {!hidePagination && <Footer />}\n </DivView>\n </listContext.Provider>\n </PropsContextProvider>\n );\n});\n\nexport default List;\n"],"names":["TableSetupComponent","ListModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEO,MAAM,IAAA,GAAO,aAAA,CAAc,MAAA,EAAQ,CAAC,KAAA,KAAU;AACnD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,iBAAA,GAAoB,SAAA;AAAA,IACpB,QAAA;AAAA,IACA,GAAA;AAAA,IACA,cAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,eAAA,GAAkB,cAAA;AAAA,IACtB,QAAA;AAAA,IACA;AAAA,GACF,EAAG,KAAA;AACH,EAAA,MAAM,eAAA,GAAkB,cAAA;AAAA,IACtB,QAAA;AAAA,IACA;AAAA,GACF,EAAG,KAAA;AACH,EAAA,MAAM,uBAAA,GAA0B,cAAA;AAAA,IAC9B,QAAA;AAAA,IACA;AAAA,GACF,EAAG,KAAA;AACH,EAAA,MAAM,cAAA,GAAiB,cAAA,CAAe,QAAA,EAAU,cAAqB,CAAA,EAAG,KAAA;AAExE,EAAA,MAAM,WAAA,GAA6C;AAAA,IACjD,QAAQ,eAAA,GACJ;AAAA,MACE,GAAG,eAAA;AAAA,MACH,aAAa,eAAA,CAAgB;AAAA,QAE/B,uBAAA,GACE;AAAA,MACE,GAAG,uBAAA;AAAA,MACH,sBAAsB,uBAAA,CAAwB;AAAA,QAEhD,cAAA,GACE;AAAA,MACE,YAAY,cAAA,CAAe;AAAA,QAE7B,eAAA,GACE;AAAA,MACE,GAAG,eAAA;AAAA,MACH,SAAS,eAAA,CAAgB;AAAA,KAC3B,GACA;AAAA,GACZ;AAEA,EAAA,MAAM,WAAA,GAAc,c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,EACxC,CAAA;AAAA,UACC,CAAC,cAAA,oBAAkB,GAAA,CAAC,MAAA,EAAA,EAAO;AAAA,SAAA,EAC9B;AAAA;AAAA;AAAA,GACF,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"List.mjs","sources":["../../../../../../../src/components/List/List.tsx"],"sourcesContent":["import { DataLoader } from \"@/components/List/components/DataLoader\";\nimport { Header } from \"@/components/List/components/Header/Header\";\nimport headerStyles from \"@/components/List/components/Header/Header.module.scss\";\nimport { Items } from \"@/components/List/components/Items/Items\";\nimport { Table } from \"@/components/List/components/Table\";\nimport ListModel from \"@/components/List/model/List\";\nimport type { IncrementalLoaderShape } from \"@/components/List/model/loading/types\";\nimport type { ListShape } from \"@/components/List/model/types\";\nimport { ListFilter } from \"@/components/List/setupComponents/ListFilter\";\nimport { ListItem } from \"@/components/List/setupComponents/ListItem\";\nimport { ListLoaderAsync } from \"@/components/List/setupComponents/ListLoaderAsync\";\nimport { ListLoaderAsyncResource } from \"@/components/List/setupComponents/ListLoaderAsyncResource\";\nimport { ListSearch } from \"@/components/List/setupComponents/ListSearch\";\nimport { ListSorting } from \"@/components/List/setupComponents/ListSorting\";\nimport { ListStaticData } from \"@/components/List/setupComponents/ListStaticData\";\nimport { Table as TableSetupComponent } from \"@/components/List/setupComponents/Table\";\nimport { TableBody } from \"@/components/List/setupComponents/TableBody\";\nimport { TableCell } from \"@/components/List/setupComponents/TableCell\";\nimport { TableColumn } from \"@/components/List/setupComponents/TableColumn\";\nimport { TableHeader } from \"@/components/List/setupComponents/TableHeader\";\nimport { TableRow } from \"@/components/List/setupComponents/TableRow\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { deepFilterByType, deepFindOfType } from \"@/lib/react/deepFindOfType\";\nimport DivView from \"@/views/DivView\";\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport Footer from \"./components/Footer\";\nimport styles from \"./List.module.scss\";\nimport { listContext } from \"./listContext\";\nimport { ListLoaderHooks } from \"@/components/List/setupComponents/ListLoaderHooks\";\nimport { UiComponentTunnelExit } from \"../UiComponentTunnel/UiComponentTunnelExit\";\nimport ListEmptyViewContainerView from \"@/views/ListEmptyViewContainerView\";\n\nexport interface ListProps<T, TMeta = unknown>\n extends\n PropsWithChildren,\n FlowComponentProps,\n Omit<\n ListShape<T, TMeta>,\n | \"search\"\n | \"loader\"\n | \"itemView\"\n | \"table\"\n | \"batchesController\"\n | \"filters\"\n | \"sorting\"\n > {\n /** The number of items to be displayed on one page. */\n batchSize?: number;\n /**\n * Automatically loads the next batch of items when the user scrolls to the\n * end of the list, instead of showing a \"Show more\" button.\n *\n * @default false\n */\n infiniteScroll?: boolean;\n /**\n * Hides the pagination controls below the list.\n *\n * @default false\n */\n hidePagination?: boolean;\n /** The view rendered when a search or filter returns no results. */\n emptySearchResultView?: ReactNode;\n /** The view rendered when the list contains no items. */\n emptyView?: ReactNode;\n}\n\nexport const List = flowComponent(\"List\", (props) => {\n const {\n children,\n batchSize,\n loadingItemsCount = batchSize,\n onChange,\n ref,\n hidePagination,\n ...restProps\n } = props;\n\n const listLoaderAsync = deepFindOfType(\n children,\n ListLoaderAsync<never>,\n )?.props;\n const listLoaderHooks = deepFindOfType(\n children,\n ListLoaderHooks<never>,\n )?.props;\n const listLoaderAsyncResource = deepFindOfType(\n children,\n ListLoaderAsyncResource<never>,\n )?.props;\n const listStaticData = deepFindOfType(children, ListStaticData<never>)?.props;\n\n const loaderShape: IncrementalLoaderShape<never> = {\n source: listLoaderAsync\n ? {\n ...listLoaderAsync,\n asyncLoader: listLoaderAsync.children,\n }\n : listLoaderAsyncResource\n ? {\n ...listLoaderAsyncResource,\n asyncResourceFactory: listLoaderAsyncResource.children,\n }\n : listStaticData\n ? {\n staticData: listStaticData.data,\n }\n : listLoaderHooks\n ? {\n ...listLoaderHooks,\n useData: listLoaderHooks.children,\n }\n : undefined,\n };\n\n const searchProps = deepFindOfType(children, ListSearch)?.props;\n const itemViewProps = deepFindOfType(children, ListItem<never>)?.props;\n\n const tableProps = deepFindOfType(children, TableSetupComponent)?.props;\n const tableColumnProps = deepFilterByType(children, TableColumn<never>).map(\n (c) => ({\n ...c.props,\n name: c.props.children,\n }),\n );\n const tableCellProps = deepFilterByType(children, TableCell<never>).map(\n (c) => ({\n ...c.props,\n renderFn: c.props.children,\n }),\n );\n\n const tableRowProps = deepFindOfType(children, TableRow)?.props;\n const tableHeaderProps = deepFindOfType(children, TableHeader)?.props;\n const tableBodyProps = deepFindOfType(children, TableBody)?.props;\n\n const listModel = ListModel.useNew<never>({\n onChange,\n loader: loaderShape,\n filters: deepFilterByType(children, ListFilter<never, never, never>).map(\n (f) => ({\n ...f.props,\n renderItem: f.props.children,\n }),\n ),\n search: searchProps\n ? {\n render: searchProps.children,\n textFieldProps: searchProps,\n defaultValue: searchProps.defaultValue,\n autosave: searchProps.autosave,\n }\n : undefined,\n sorting: deepFilterByType(children, ListSorting<never>).map((s) => s.props),\n\n itemView: itemViewProps\n ? {\n ...itemViewProps,\n renderFn: itemViewProps.children,\n }\n : undefined,\n\n table:\n tableColumnProps.length > 0\n ? {\n header: {\n ...tableHeaderProps,\n columns: tableColumnProps,\n },\n body: {\n ...tableBodyProps,\n row: {\n ...tableRowProps,\n cells: tableCellProps,\n },\n },\n ...tableProps,\n }\n : undefined,\n\n batchesController: {\n batchSize,\n },\n loadingItemsCount,\n ...restProps,\n });\n\n const propsContext: PropsContext = {\n ActionGroup: {\n preserveOrder: true,\n tunnel: {\n id: \"actions\",\n component: \"List\",\n },\n className: headerStyles.actions,\n Button: {\n className: headerStyles.action,\n },\n },\n ListSummary: {\n tunnel: {\n id: \"listSummary\",\n component: \"List\",\n },\n },\n };\n\n const isEmpty = listModel.useIsEmpty();\n\n // IMPORTANT: we always render the emptyView to the dom.\n // otherwise we will lose e.g. modalState when switching from noItems to itemsAvailable and vise versa.\n const emptyView = (\n <DivView\n aria-hidden={!isEmpty}\n className={!isEmpty ? styles.hideVisuallyEmptyView : undefined}\n >\n <ListEmptyViewContainerView\n viewType={listModel.getEmptyViewType()}\n emptySearchResultView={listModel.emptySearchResultView}\n emptyView={listModel.emptyView}\n />\n </DivView>\n );\n\n return (\n <PropsContextProvider props={propsContext}>\n <listContext.Provider\n value={{\n list: listModel,\n }}\n >\n <DataLoader />\n <DivView className={styles.list} ref={ref}>\n {children}\n <Header />\n\n <DivView className={styles.listWrapper}>\n {emptyView}\n {listModel.items.entries.length > 0 && (\n <UiComponentTunnelExit id=\"listSummary\" component=\"List\" />\n )}\n {(listModel.viewMode.isList || listModel.viewMode.isTiles) && (\n <Items />\n )}\n {listModel.viewMode.isTable && <Table />}\n </DivView>\n {!hidePagination && <Footer />}\n </DivView>\n </listContext.Provider>\n </PropsContextProvider>\n );\n});\n\nexport default List;\n"],"names":["TableSetupComponent","ListModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEO,MAAM,IAAA,GAAO,aAAA,CAAc,MAAA,EAAQ,CAAC,KAAA,KAAU;AACnD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,iBAAA,GAAoB,SAAA;AAAA,IACpB,QAAA;AAAA,IACA,GAAA;AAAA,IACA,cAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,eAAA,GAAkB,cAAA;AAAA,IACtB,QAAA;AAAA,IACA;AAAA,GACF,EAAG,KAAA;AACH,EAAA,MAAM,eAAA,GAAkB,cAAA;AAAA,IACtB,QAAA;AAAA,IACA;AAAA,GACF,EAAG,KAAA;AACH,EAAA,MAAM,uBAAA,GAA0B,cAAA;AAAA,IAC9B,QAAA;AAAA,IACA;AAAA,GACF,EAAG,KAAA;AACH,EAAA,MAAM,cAAA,GAAiB,cAAA,CAAe,QAAA,EAAU,cAAqB,CAAA,EAAG,KAAA;AAExE,EAAA,MAAM,WAAA,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AA;AAAA,YAAA,SAAA;AAAA,YACA,SAAA,CAAU,KAAA,CAAM,OAAA,CAAQ,MAAA,GAAS,CAAA,wBAC/B,qBAAA,EAAA,EAAsB,EAAA,EAAG,aAAA,EAAc,SAAA,EAAU,MAAA,EAAO,CAAA;AAAA,YAAA,CAEzD,UAAU,QAAA,CAAS,MAAA,IAAU,UAAU,QAAA,CAAS,OAAA,yBAC/C,KAAA,EAAA,EAAM,CAAA;AAAA,YAER,SAAA,CAAU,QAAA,CAAS,OAAA,oBAAW,GAAA,CAAC,KAAA,EAAA,EAAM;AAAA,WAAA,EACxC,CAAA;AAAA,UACC,CAAC,cAAA,oBAAkB,GAAA,CAAC,MAAA,EAAA,EAAO;AAAA,SAAA,EAC9B;AAAA;AAAA;AAAA,GACF,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { createElement, useState, useEffect } from 'react';
|
|
5
5
|
import { useOnChange } from '../../../../../../lib/hooks/useOnChange.mjs';
|
|
6
|
-
import '../../../../../../lib/propsContext/propsContext.mjs';
|
|
7
6
|
import 'remeda';
|
|
8
7
|
import '@react-aria/utils';
|
|
9
8
|
import 'dot-prop';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/SearchField/SearchField.tsx"],"sourcesContent":["import type { FC, KeyboardEvent } from \"react\";\nimport { createElement, useEffect, useState } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport type { Search } from \"@/components/List/model/search/Search\";\nimport type { SearchFieldRenderComponent } from \"@/components/List/model/search/types\";\nimport { useOnChange } from \"@/lib/hooks\";\nimport SearchFieldView from \"@/views/SearchFieldView\";\nimport styles from \"./SearchField.module.scss\";\nimport { useAriaAnnounceSearchState } from \"@/components/List/hooks/useAriaAnnounceSearchState\";\n\ninterface Props extends PropsWithClassName {\n search: Search<never>;\n isDisabled?: boolean;\n}\n\nconst autoSubmitTimeout = 500;\n\nconst DefaultSearchFieldRender: SearchFieldRenderComponent = (props) => {\n const { onChange, value, autoSubmit = true, ...searchFieldProps } = props;\n\n const [searchString, setSearchString] = useState(value ?? \"\");\n const [previousSearchString, setPreviousSearchString] = useState(\"\");\n\n const submitSearch = () => {\n if (searchString.trim() === \"\") {\n onChange(undefined);\n } else if (previousSearchString !== searchString) {\n setPreviousSearchString(searchString);\n onChange(searchString);\n }\n };\n\n useEffect(() => {\n if (autoSubmit) {\n const timeout = setTimeout(() => submitSearch(), autoSubmitTimeout);\n return () => clearTimeout(timeout);\n }\n }, [searchString, autoSubmit]);\n\n useAriaAnnounceSearchState();\n\n useOnChange(value, () => {\n setSearchString(value ?? \"\");\n }, [searchString]);\n\n const clearSearch = () => {\n onChange(undefined);\n setSearchString(\"\");\n };\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && !autoSubmit) {\n submitSearch();\n } else if (e.key === \"Escape\") {\n clearSearch();\n }\n };\n\n return (\n <SearchFieldView\n className={styles.searchField}\n value={searchString}\n onKeyUp={handleKeyPress}\n onChange={(value) => setSearchString(value)}\n onClear={clearSearch}\n {...searchFieldProps}\n />\n );\n};\n\nexport const SearchField: FC<Props> = (props) => {\n const { search, isDisabled } = props;\n\n const render = search.render ?? DefaultSearchFieldRender;\n\n return createElement(render, {\n value: search.value,\n onChange: search.setValue.bind(search),\n isDisabled,\n ...search.textFieldProps,\n });\n};\n\nexport default SearchField;\n"],"names":["value"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchField.mjs","sources":["../../../../../../../../../../../src/components/List/components/Header/components/SearchField/SearchField.tsx"],"sourcesContent":["import type { FC, KeyboardEvent } from \"react\";\nimport { createElement, useEffect, useState } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport type { Search } from \"@/components/List/model/search/Search\";\nimport type { SearchFieldRenderComponent } from \"@/components/List/model/search/types\";\nimport { useOnChange } from \"@/lib/hooks\";\nimport SearchFieldView from \"@/views/SearchFieldView\";\nimport styles from \"./SearchField.module.scss\";\nimport { useAriaAnnounceSearchState } from \"@/components/List/hooks/useAriaAnnounceSearchState\";\n\ninterface Props extends PropsWithClassName {\n search: Search<never>;\n isDisabled?: boolean;\n}\n\nconst autoSubmitTimeout = 500;\n\nconst DefaultSearchFieldRender: SearchFieldRenderComponent = (props) => {\n const { onChange, value, autoSubmit = true, ...searchFieldProps } = props;\n\n const [searchString, setSearchString] = useState(value ?? \"\");\n const [previousSearchString, setPreviousSearchString] = useState(\"\");\n\n const submitSearch = () => {\n if (searchString.trim() === \"\") {\n onChange(undefined);\n } else if (previousSearchString !== searchString) {\n setPreviousSearchString(searchString);\n onChange(searchString);\n }\n };\n\n useEffect(() => {\n if (autoSubmit) {\n const timeout = setTimeout(() => submitSearch(), autoSubmitTimeout);\n return () => clearTimeout(timeout);\n }\n }, [searchString, autoSubmit]);\n\n useAriaAnnounceSearchState();\n\n useOnChange(value, () => {\n setSearchString(value ?? \"\");\n }, [searchString]);\n\n const clearSearch = () => {\n onChange(undefined);\n setSearchString(\"\");\n };\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && !autoSubmit) {\n submitSearch();\n } else if (e.key === \"Escape\") {\n clearSearch();\n }\n };\n\n return (\n <SearchFieldView\n className={styles.searchField}\n value={searchString}\n onKeyUp={handleKeyPress}\n onChange={(value) => setSearchString(value)}\n onClear={clearSearch}\n {...searchFieldProps}\n />\n );\n};\n\nexport const SearchField: FC<Props> = (props) => {\n const { search, isDisabled } = props;\n\n const render = search.render ?? DefaultSearchFieldRender;\n\n return createElement(render, {\n value: search.value,\n onChange: search.setValue.bind(search),\n isDisabled,\n ...search.textFieldProps,\n });\n};\n\nexport default SearchField;\n"],"names":["value"],"mappings":";;;;;;;;;;AAeA,MAAM,iBAAA,GAAoB,GAAA;AAE1B,MAAM,wBAAA,GAAuD,CAAC,KAAA,KAAU;AACtE,E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