@mittwald/flow-react-components 0.2.0-alpha.995 → 0.2.0-alpha.997
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 +12 -0
- package/dist/assets/doc-properties.json +9655 -9647
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +2 -1
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +1 -0
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Action/Action.mjs +1 -0
- package/dist/js/packages/components/src/components/Action/Action.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs +1 -0
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Alert/Alert.mjs +1 -0
- package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AlertIcon/AlertIcon.mjs +1 -1
- package/dist/js/packages/components/src/components/AlertIcon/AlertIcon.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AlertText/AlertText.mjs +1 -0
- package/dist/js/packages/components/src/components/AlertText/AlertText.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Align/Align.mjs +2 -1
- package/dist/js/packages/components/src/components/Align/Align.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Autocomplete/Autocomplete.mjs +1 -0
- package/dist/js/packages/components/src/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Avatar/Avatar.mjs +1 -0
- package/dist/js/packages/components/src/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs +1 -0
- package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Badge/Badge.mjs +1 -0
- package/dist/js/packages/components/src/components/Badge/Badge.mjs.map +1 -1
- package/dist/js/packages/components/src/components/BigNumber/BigNumber.mjs +1 -0
- package/dist/js/packages/components/src/components/BigNumber/BigNumber.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Breadcrumb/Breadcrumb.mjs +1 -0
- package/dist/js/packages/components/src/components/Breadcrumb/Breadcrumb.mjs.map +1 -1
- package/dist/js/packages/components/src/components/BrowserOnly/BrowserOnly.mjs +1 -0
- package/dist/js/packages/components/src/components/BrowserOnly/BrowserOnly.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Button/Button.mjs +2 -9
- package/dist/js/packages/components/src/components/Button/Button.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Chat/Chat.mjs +1 -0
- package/dist/js/packages/components/src/components/Chat/Chat.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs +1 -0
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.mjs +1 -0
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxGroup/CheckboxGroup.mjs +1 -0
- package/dist/js/packages/components/src/components/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs +1 -0
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ColumnLayout/ColumnLayout.mjs +1 -0
- package/dist/js/packages/components/src/components/ColumnLayout/ColumnLayout.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +1 -0
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +1 -0
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileCard/FileCard.mjs +1 -0
- package/dist/js/packages/components/src/components/FileCard/FileCard.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileCardList/FileCardList.mjs +1 -0
- package/dist/js/packages/components/src/components/FileCardList/FileCardList.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs +1 -0
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileField/FileField.mjs +1 -0
- package/dist/js/packages/components/src/components/FileField/FileField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileField/components/FileInput.mjs +1 -0
- package/dist/js/packages/components/src/components/FileField/components/FileInput.mjs.map +1 -1
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs +1 -0
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs +1 -0
- package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Icon/Icon.mjs +28 -1
- package/dist/js/packages/components/src/components/Icon/Icon.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Icon/Icon.module.scss.mjs +18 -2
- package/dist/js/packages/components/src/components/Icon/Icon.module.scss.mjs.map +1 -1
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +1 -0
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Label/Label.mjs +1 -0
- package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LabeledValue/LabeledValue.mjs +1 -0
- package/dist/js/packages/components/src/components/LabeledValue/LabeledValue.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LayoutCard/LayoutCard.mjs +1 -0
- package/dist/js/packages/components/src/components/LayoutCard/LayoutCard.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/LightBox.mjs +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/js/packages/components/src/components/Link/Link.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/List.mjs +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/js/packages/components/src/components/List/components/ListItemView/components/ListItemViewContent/ListItemViewContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs +2 -7
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MenuItem/components/MenuItemContent/MenuItemContent.mjs +1 -0
- 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 +1 -0
- package/dist/js/packages/components/src/components/Message/Message.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs +1 -0
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.mjs +1 -0
- package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.mjs +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/js/packages/components/src/components/Notification/Notification.mjs.map +1 -1
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs +1 -0
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/OverlayTrigger/OverlayTrigger.mjs +1 -0
- package/dist/js/packages/components/src/components/OverlayTrigger/OverlayTrigger.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs +1 -0
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/Section.mjs +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Select/Select.mjs +1 -0
- package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Slider/Slider.mjs +1 -0
- package/dist/js/packages/components/src/components/Slider/Slider.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Switch/Switch.mjs +1 -0
- package/dist/js/packages/components/src/components/Switch/Switch.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs +1 -0
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs +1 -0
- package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/components/Tab/Tab.mjs +1 -0
- 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 +1 -0
- package/dist/js/packages/components/src/components/Text/Text.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +1 -0
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextField/TextField.mjs +1 -0
- package/dist/js/packages/components/src/components/TextField/TextField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs +1 -0
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -0
- 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/FormAction/FormResetAction.mjs +1 -0
- 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 +1 -0
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormSubmitAction.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/useModalController.mjs +1 -0
- package/dist/js/packages/components/src/lib/controller/overlay/useModalController.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/hooks/useFieldComponent.mjs +1 -0
- package/dist/js/packages/components/src/lib/hooks/useFieldComponent.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/hooks/useFieldError.mjs +1 -0
- package/dist/js/packages/components/src/lib/hooks/useFieldError.mjs.map +1 -1
- package/dist/js/packages/design-tokens/dist/json/all-dark.json.mjs +1 -1
- package/dist/js/packages/design-tokens/dist/json/all-light.json.mjs +1 -1
- package/dist/types/components/AlertIcon/AlertIcon.d.ts +2 -1
- package/dist/types/components/AlertIcon/AlertIcon.d.ts.map +1 -1
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/Icon/Icon.d.ts +16 -2
- package/dist/types/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/components/Icon/stories/Default.stories.d.ts +2 -0
- package/dist/types/components/Icon/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/List/typedList.d.ts +23 -23
- package/dist/types/components/MenuItem/MenuItem.d.ts.map +1 -1
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts +128 -0
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts.map +1 -1
- package/dist/types/lib/tokens/getCategoricalColorByIndex.d.ts +1 -1
- package/package.json +6 -6
|
@@ -4,6 +4,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import styles from './AccentBox.module.scss.mjs';
|
|
6
6
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
7
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
7
8
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
9
|
|
|
9
10
|
const accentBoxBackgroundColors = [
|
|
@@ -31,7 +32,7 @@ const AccentBox = flowComponent("AccentBox", (props) => {
|
|
|
31
32
|
style: styleFromProps,
|
|
32
33
|
aspectRatio
|
|
33
34
|
} = props;
|
|
34
|
-
const defaultColor = colorFromProps === "gradient" || backgroundColor === "gradient" ? "dark
|
|
35
|
+
const defaultColor = colorFromProps === "gradient" || backgroundColor === "gradient" ? "dark" : "default";
|
|
35
36
|
const color = colorFromProps ?? defaultColor;
|
|
36
37
|
const isAFlowColor = isFlowColor(backgroundColor);
|
|
37
38
|
const backgroundColorFromColor = colorFromProps === "neutral" || colorFromProps === "gradient" || colorFromProps === "green" ? colorFromProps : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccentBox.mjs","sources":["../../../../../../../src/components/AccentBox/AccentBox.tsx"],"sourcesContent":["import type { CSSProperties, PropsWithChildren } from \"react\";\nimport type {\n AlphaColor,\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./AccentBox.module.scss\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\n\nconst accentBoxBackgroundColors = [\n \"neutral\",\n \"blue\",\n \"violet\",\n \"teal\",\n \"lilac\",\n \"green\",\n \"navy\",\n \"gradient\",\n] as const;\n\ntype AccentBoxBackgroundColor = (typeof accentBoxBackgroundColors)[number];\ntype AccentBoxWithCustomBackgroundColor =\n | AccentBoxBackgroundColor\n | (string & {});\n\nfunction isFlowColor(\n something: unknown,\n): something is AccentBoxBackgroundColor {\n const anyAccentBoxBackgroundColors =\n accentBoxBackgroundColors as readonly string[];\n return (\n typeof something === \"string\" &&\n anyAccentBoxBackgroundColors.includes(something)\n );\n}\n\nexport interface AccentBoxProps\n extends\n PropsWithChildren,\n PropsWithElementType<\"div\" | \"section\" | \"article\">,\n PropsWithClassName,\n FlowComponentProps {\n /** The background color of the accent box. @default \"neutral\" */\n backgroundColor?: AccentBoxWithCustomBackgroundColor;\n /** The content color of the accent box. @default \"default\" */\n color?: \"default\" | AlphaColor;\n /** The background image of the accent box. */\n backgroundImage?: string;\n /** The aspect ratio of the accent box. */\n aspectRatio?: CSSProperties[\"aspectRatio\"];\n}\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const AccentBox = flowComponent(\"AccentBox\", (props) => {\n const {\n color: colorFromProps,\n backgroundColor = \"neutral\",\n backgroundImage,\n children,\n elementType = \"div\",\n className,\n style: styleFromProps,\n aspectRatio,\n } = props;\n\n const defaultColor =\n (colorFromProps as unknown as string) === \"gradient\" ||\n backgroundColor === \"gradient\"\n ? \"dark
|
|
1
|
+
{"version":3,"file":"AccentBox.mjs","sources":["../../../../../../../src/components/AccentBox/AccentBox.tsx"],"sourcesContent":["import type { CSSProperties, PropsWithChildren } from \"react\";\nimport type {\n AlphaColor,\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./AccentBox.module.scss\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\n\nconst accentBoxBackgroundColors = [\n \"neutral\",\n \"blue\",\n \"violet\",\n \"teal\",\n \"lilac\",\n \"green\",\n \"navy\",\n \"gradient\",\n] as const;\n\ntype AccentBoxBackgroundColor = (typeof accentBoxBackgroundColors)[number];\ntype AccentBoxWithCustomBackgroundColor =\n | AccentBoxBackgroundColor\n | (string & {});\n\nfunction isFlowColor(\n something: unknown,\n): something is AccentBoxBackgroundColor {\n const anyAccentBoxBackgroundColors =\n accentBoxBackgroundColors as readonly string[];\n return (\n typeof something === \"string\" &&\n anyAccentBoxBackgroundColors.includes(something)\n );\n}\n\nexport interface AccentBoxProps\n extends\n PropsWithChildren,\n PropsWithElementType<\"div\" | \"section\" | \"article\">,\n PropsWithClassName,\n FlowComponentProps {\n /** The background color of the accent box. @default \"neutral\" */\n backgroundColor?: AccentBoxWithCustomBackgroundColor;\n /** The content color of the accent box. @default \"default\" */\n color?: \"default\" | AlphaColor;\n /** The background image of the accent box. */\n backgroundImage?: string;\n /** The aspect ratio of the accent box. */\n aspectRatio?: CSSProperties[\"aspectRatio\"];\n}\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const AccentBox = flowComponent(\"AccentBox\", (props) => {\n const {\n color: colorFromProps,\n backgroundColor = \"neutral\",\n backgroundImage,\n children,\n elementType = \"div\",\n className,\n style: styleFromProps,\n aspectRatio,\n } = props;\n\n const defaultColor =\n (colorFromProps as unknown as string) === \"gradient\" ||\n backgroundColor === \"gradient\"\n ? \"dark\"\n : \"default\";\n\n const color = colorFromProps ?? defaultColor;\n\n const isAFlowColor = isFlowColor(backgroundColor);\n\n // backwards compatibility\n const backgroundColorFromColor =\n (colorFromProps as unknown as string) === \"neutral\" ||\n (colorFromProps as unknown as string) === \"gradient\" ||\n (colorFromProps as unknown as string) === \"green\"\n ? (colorFromProps as unknown as AccentBoxBackgroundColor)\n : undefined;\n\n const style = {\n backgroundColor: isAFlowColor ? undefined : backgroundColor,\n backgroundImage: backgroundImage ? `url(${backgroundImage})` : undefined,\n aspectRatio,\n ...styleFromProps,\n };\n\n const rootClassName = clsx(\n styles.accentBox,\n backgroundColorFromColor\n ? styles[backgroundColorFromColor]\n : isAFlowColor\n ? styles[backgroundColor]\n : undefined,\n className,\n );\n\n const Element = elementType;\n\n const contentColor = color === \"default\" ? undefined : color;\n\n const propsContext: PropsContext = {\n Link: {\n color: contentColor,\n },\n Text: {\n color: contentColor,\n },\n Heading: {\n color: contentColor,\n },\n Icon: {\n className: styles.icon,\n },\n };\n\n return (\n <Element className={rootClassName} style={style}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Element>\n );\n});\n\nexport default AccentBox;\n"],"names":[],"mappings":";;;;;;;AAcA,MAAM,yBAAA,GAA4B;AAAA,EAChC,SAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA;AAOA,SAAS,YACP,SAAA,EACuC;AACvC,EAAA,MAAM,4BAAA,GACJ,yBAAA;AACF,EAAA,OACE,OAAO,SAAA,KAAc,QAAA,IACrB,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IACA,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO;AAAA,KACT;AAAA,IACA,OAAA,EAAS;AAAA,MACP,KAAA,EAAO;AAAA,KACT;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,WAAW,MAAA,CAAO;AAAA;AACpB,GACF;AAEA,EAAA,uBACE,GAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAW,aAAA,EAAe,KAAA,EACjC,8BAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -5,6 +5,7 @@ import { useState, useId } from 'react';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import styles from './Accordion.module.scss.mjs';
|
|
7
7
|
import { dynamic } from '../../lib/propsContext/dynamicProps/dynamic.mjs';
|
|
8
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
8
9
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
10
|
import { Button } from '../Button/Button.mjs';
|
|
10
11
|
import { IconChevronDown } from '../Icon/components/icons/IconChevronDown.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.mjs","sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport { useId, useState } from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./Accordion.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Activity } from \"@/components/Activity\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface AccordionProps extends PropsWithChildren<\n ComponentProps<\"div\">\n> {\n /** Whether the accordion should be initially expanded. */\n defaultExpanded?: boolean;\n /** The visual variant of the accordion. @default \"default\" */\n variant?: \"default\" | \"outline\";\n}\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const Accordion: FC<AccordionProps> = flowComponent(\n \"Accordion\",\n (props) => {\n const {\n children,\n className,\n defaultExpanded = false,\n variant = \"default\",\n ...rest\n } = props;\n const [expanded, setExpanded] = useState(defaultExpanded);\n\n const rootClassName = clsx(\n styles.accordion,\n expanded && styles.expanded,\n variant === \"outline\" && styles.outline,\n className,\n );\n\n const headerId = useId();\n\n const contentId = useId();\n\n const HeaderButton: FC<PropsWithChildren> = (props) => {\n const { children } = props;\n return (\n <Button\n tunnel={null}\n unstyled\n aria-expanded={expanded}\n className={styles.headerButton}\n onPress={() => setExpanded((expanded) => !expanded)}\n aria-controls={contentId}\n >\n {children}\n <IconChevronDown className={styles.chevron} />\n </Button>\n );\n };\n\n const propsContext: PropsContext = {\n Content: {\n className: styles.contentInner,\n tunnel: {\n id: \"content\",\n component: \"Accordion\",\n },\n },\n Heading: {\n className: styles.header,\n level: 4,\n size: \"xs\",\n children: dynamic((props) => (\n <HeaderButton>{props.children}</HeaderButton>\n )),\n },\n Label: {\n className: styles.header,\n children: dynamic((props) => (\n <HeaderButton>{props.children}</HeaderButton>\n )),\n },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n <div\n aria-labelledby={headerId}\n id={contentId}\n role=\"region\"\n hidden={!expanded}\n className={styles.content}\n >\n <Activity isActive={expanded} inactiveDelay={1000}>\n <UiComponentTunnelExit id=\"content\" component=\"Accordion\" />\n </Activity>\n </div>\n </PropsContextProvider>\n </div>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Accordion;\n"],"names":["props","children","expanded"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Accordion.mjs","sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport { useId, useState } from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./Accordion.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Activity } from \"@/components/Activity\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface AccordionProps extends PropsWithChildren<\n ComponentProps<\"div\">\n> {\n /** Whether the accordion should be initially expanded. */\n defaultExpanded?: boolean;\n /** The visual variant of the accordion. @default \"default\" */\n variant?: \"default\" | \"outline\";\n}\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const Accordion: FC<AccordionProps> = flowComponent(\n \"Accordion\",\n (props) => {\n const {\n children,\n className,\n defaultExpanded = false,\n variant = \"default\",\n ...rest\n } = props;\n const [expanded, setExpanded] = useState(defaultExpanded);\n\n const rootClassName = clsx(\n styles.accordion,\n expanded && styles.expanded,\n variant === \"outline\" && styles.outline,\n className,\n );\n\n const headerId = useId();\n\n const contentId = useId();\n\n const HeaderButton: FC<PropsWithChildren> = (props) => {\n const { children } = props;\n return (\n <Button\n tunnel={null}\n unstyled\n aria-expanded={expanded}\n className={styles.headerButton}\n onPress={() => setExpanded((expanded) => !expanded)}\n aria-controls={contentId}\n >\n {children}\n <IconChevronDown className={styles.chevron} />\n </Button>\n );\n };\n\n const propsContext: PropsContext = {\n Content: {\n className: styles.contentInner,\n tunnel: {\n id: \"content\",\n component: \"Accordion\",\n },\n },\n Heading: {\n className: styles.header,\n level: 4,\n size: \"xs\",\n children: dynamic((props) => (\n <HeaderButton>{props.children}</HeaderButton>\n )),\n },\n Label: {\n className: styles.header,\n children: dynamic((props) => (\n <HeaderButton>{props.children}</HeaderButton>\n )),\n },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n <div\n aria-labelledby={headerId}\n id={contentId}\n role=\"region\"\n hidden={!expanded}\n className={styles.content}\n >\n <Activity isActive={expanded} inactiveDelay={1000}>\n <UiComponentTunnelExit id=\"content\" component=\"Accordion\" />\n </Activity>\n </div>\n </PropsContextProvider>\n </div>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Accordion;\n"],"names":["props","children","expanded"],"mappings":";;;;;;;;;;;;;AAyBO,MAAM,SAAA,GAAgC,aAAA;AAAA,EAC3C,WAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,SAAA;AAAA,MACA,eAAA,GAAkB,KAAA;AAAA,MAClB,OAAA,GAAU,SAAA;AAAA,MACV,GAAG;AAAA,KACL,GAAI,KAAA;AACJ,IAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,eAAe,CAAA;AAExD,IAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,MACpB,MAAA,CAAO,SAAA;AAAA,MACP,YAAY,MAAA,CAAO,QAAA;AAAA,MACnB,OAAA,KAAY,aAAa,MAAA,CAAO,OAAA;AAAA,MAChC;AAAA,KACF;AAEA,IAAA,MAAM,WAAW,KAAA,EAAM;AAEvB,IAAA,MAAM,YAAY,KAAA,EAAM;AAExB,IAAA,MAAM,YAAA,GAAsC,CAACA,MAAAA,KAAU;AACrD,MAAA,MAAM,EAAE,QAAA,EAAAC,SAAAA,EAAS,GAAID,MAAAA;AACrB,MAAA,uBACE,IAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,MAAA,EAAQ,IAAA;AAAA,UACR,QAAA,EAAQ,IAAA;AAAA,UACR,eAAA,EAAe,QAAA;AAAA,UACf,WAAW,MAAA,CAAO,YAAA;AAAA,UAClB,SAAS,MAAM,WAAA,CAAY,CAACE,SAAAA,KAAa,CAACA,SAAQ,CAAA;AAAA,UAClD,eAAA,EAAe,SAAA;AAAA,UAEd,QAA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AAe,GAAA,EAC3C,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EAAsB,EAAA,EAAG,SAAA,EAAU,SAAA,EAAU,WAAA,EAAY,CAAA,EAC5D;AAAA;AAAA;AACF,KAAA,EACF,CAAA,EACF,CAAA;AAAA,EAEJ,CAAA;AAAA,EACA;AAAA,IACE,IAAA,EAAM;AAAA;AAEV;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { ActionModel } from './models/ActionModel.mjs';
|
|
5
5
|
import { dynamic } from '../../lib/propsContext/dynamicProps/dynamic.mjs';
|
|
6
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
import { ActionContextProvider } from './context.mjs';
|
|
8
9
|
import { useActionStateContext } from './models/ActionStateContext.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.mjs","sources":["../../../../../../../src/components/Action/Action.tsx"],"sourcesContent":["import { ActionModel as ActionModel } from \"@/components/Action/models/ActionModel\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { ActionContextProvider } from \"@/components/Action/context\";\nimport { useActionStateContext } from \"@/components/Action/models/ActionStateContext\";\nimport { useConfirmationModalButtonSlot } from \"@/components/Action/hooks/useConfirmationModalButtonSlot\";\nimport { useActionButtonState } from \"@/components/Action/hooks/useActionButtonState\";\nimport type { ComponentPropsContext } from \"@/lib/propsContext/types\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { ActionFn } from \"@/components/Action/types\";\nimport { useActionState } from \"@/components/Action/hooks/useActionState\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\n\nconst actionButtonContext: ComponentPropsContext<\"Button\"> = {\n onPress: dynamic((props) => {\n const action = ActionModel.use();\n const confirmAction = ActionModel.useConfirmationAction();\n const isConfirmationButton =\n useConfirmationModalButtonSlot(props) === \"primary\";\n const isAbortButton = useConfirmationModalButtonSlot(props) === \"abort\";\n if (isAbortButton) {\n return () => action.confirmationModalController.close();\n }\n return isConfirmationButton ? confirmAction.execute : action.execute;\n }),\n\n isPending: dynamic((props) => {\n const actionState = useActionButtonState(props);\n return props.isPending ?? actionState === \"isPending\";\n }),\n\n isSucceeded: dynamic((props) => {\n const actionState = useActionButtonState(props);\n return props.isSucceeded ?? actionState === \"isSucceeded\";\n }),\n\n isFailed: dynamic((props) => {\n const actionState = useActionButtonState(props);\n return props.isFailed ?? actionState === \"isFailed\";\n }),\n\n \"aria-disabled\": dynamic((props) => {\n const state = useActionButtonState(props);\n const someActionInContextIsBusy = useActionStateContext().useIsBusy();\n return (\n props[\"aria-disabled\"] ??\n (state === \"isExecuting\" || someActionInContextIsBusy)\n );\n }),\n};\n\nexport const Action = flowComponent(\n \"Action\",\n (props) => {\n const {\n children,\n actionModel: actionModelFromProps,\n ...actionProps\n } = props;\n\n const warnDeprecation = useWarnDeprecation();\n const usesDeprecatedActionProp =\n \"action\" in actionProps && typeof actionProps.action === \"function\";\n\n if (usesDeprecatedActionProp) {\n warnDeprecation(\n \"The 'action' prop is now deprecated. Use 'onAction' instead.\",\n );\n\n if (\"onAction\" in actionProps === false) {\n actionProps.onAction = actionProps.action as ActionFn;\n }\n }\n\n const newActionModel = ActionModel.useNew(actionProps);\n const actionModel = actionModelFromProps ?? newActionModel;\n\n const propsContext: PropsContext = {\n Button: actionButtonContext,\n\n Link: {\n onPress: dynamic(() => ActionModel.use().execute),\n },\n\n MenuItem: {\n onAction: dynamic(() => ActionModel.use().execute),\n isPending: dynamic((props) => {\n const actionState = useActionState();\n return props.isPending ?? actionState === \"isPending\";\n }),\n isSucceeded: dynamic((props) => {\n const actionState = useActionState();\n return props.isSucceeded ?? actionState === \"isSucceeded\";\n }),\n isFailed: dynamic((props) => {\n const actionState = useActionState();\n return props.isFailed ?? actionState === \"isFailed\";\n }),\n \"aria-disabled\": dynamic((props) => {\n const state = useActionState();\n const someActionInContextIsBusy = useActionStateContext().useIsBusy();\n return (\n props[\"aria-disabled\"] ??\n (state === \"isExecuting\" || someActionInContextIsBusy)\n );\n }),\n },\n\n Modal: {\n slot: dynamic((props) => {\n const { slot } = props;\n const action = ActionModel.use();\n action.needsConfirmation = slot === \"actionConfirm\";\n return slot;\n }),\n isDismissable: dynamic((props) => {\n const action = ActionModel.use();\n const actionState = action.state.useValue();\n return actionState === \"isExecuting\" || actionState === \"isPending\"\n ? false\n : props.isDismissable;\n }),\n controller: dynamic(() => {\n const action = ActionModel.use();\n return action.needsConfirmation\n ? action.confirmationModalController\n : action.getOverlayController(\"Modal\");\n }),\n ActionGroup: {\n Button: actionButtonContext,\n },\n },\n };\n\n return (\n <ActionContextProvider value={actionModel}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ActionContextProvider>\n );\n },\n {\n type: \"provider\",\n },\n);\n\nexport default Action;\n"],"names":["props"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Action.mjs","sources":["../../../../../../../src/components/Action/Action.tsx"],"sourcesContent":["import { ActionModel as ActionModel } from \"@/components/Action/models/ActionModel\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { ActionContextProvider } from \"@/components/Action/context\";\nimport { useActionStateContext } from \"@/components/Action/models/ActionStateContext\";\nimport { useConfirmationModalButtonSlot } from \"@/components/Action/hooks/useConfirmationModalButtonSlot\";\nimport { useActionButtonState } from \"@/components/Action/hooks/useActionButtonState\";\nimport type { ComponentPropsContext } from \"@/lib/propsContext/types\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { ActionFn } from \"@/components/Action/types\";\nimport { useActionState } from \"@/components/Action/hooks/useActionState\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\n\nconst actionButtonContext: ComponentPropsContext<\"Button\"> = {\n onPress: dynamic((props) => {\n const action = ActionModel.use();\n const confirmAction = ActionModel.useConfirmationAction();\n const isConfirmationButton =\n useConfirmationModalButtonSlot(props) === \"primary\";\n const isAbortButton = useConfirmationModalButtonSlot(props) === \"abort\";\n if (isAbortButton) {\n return () => action.confirmationModalController.close();\n }\n return isConfirmationButton ? confirmAction.execute : action.execute;\n }),\n\n isPending: dynamic((props) => {\n const actionState = useActionButtonState(props);\n return props.isPending ?? actionState === \"isPending\";\n }),\n\n isSucceeded: dynamic((props) => {\n const actionState = useActionButtonState(props);\n return props.isSucceeded ?? actionState === \"isSucceeded\";\n }),\n\n isFailed: dynamic((props) => {\n const actionState = useActionButtonState(props);\n return props.isFailed ?? actionState === \"isFailed\";\n }),\n\n \"aria-disabled\": dynamic((props) => {\n const state = useActionButtonState(props);\n const someActionInContextIsBusy = useActionStateContext().useIsBusy();\n return (\n props[\"aria-disabled\"] ??\n (state === \"isExecuting\" || someActionInContextIsBusy)\n );\n }),\n};\n\nexport const Action = flowComponent(\n \"Action\",\n (props) => {\n const {\n children,\n actionModel: actionModelFromProps,\n ...actionProps\n } = props;\n\n const warnDeprecation = useWarnDeprecation();\n const usesDeprecatedActionProp =\n \"action\" in actionProps && typeof actionProps.action === \"function\";\n\n if (usesDeprecatedActionProp) {\n warnDeprecation(\n \"The 'action' prop is now deprecated. Use 'onAction' instead.\",\n );\n\n if (\"onAction\" in actionProps === false) {\n actionProps.onAction = actionProps.action as ActionFn;\n }\n }\n\n const newActionModel = ActionModel.useNew(actionProps);\n const actionModel = actionModelFromProps ?? newActionModel;\n\n const propsContext: PropsContext = {\n Button: actionButtonContext,\n\n Link: {\n onPress: dynamic(() => ActionModel.use().execute),\n },\n\n MenuItem: {\n onAction: dynamic(() => ActionModel.use().execute),\n isPending: dynamic((props) => {\n const actionState = useActionState();\n return props.isPending ?? actionState === \"isPending\";\n }),\n isSucceeded: dynamic((props) => {\n const actionState = useActionState();\n return props.isSucceeded ?? actionState === \"isSucceeded\";\n }),\n isFailed: dynamic((props) => {\n const actionState = useActionState();\n return props.isFailed ?? actionState === \"isFailed\";\n }),\n \"aria-disabled\": dynamic((props) => {\n const state = useActionState();\n const someActionInContextIsBusy = useActionStateContext().useIsBusy();\n return (\n props[\"aria-disabled\"] ??\n (state === \"isExecuting\" || someActionInContextIsBusy)\n );\n }),\n },\n\n Modal: {\n slot: dynamic((props) => {\n const { slot } = props;\n const action = ActionModel.use();\n action.needsConfirmation = slot === \"actionConfirm\";\n return slot;\n }),\n isDismissable: dynamic((props) => {\n const action = ActionModel.use();\n const actionState = action.state.useValue();\n return actionState === \"isExecuting\" || actionState === \"isPending\"\n ? false\n : props.isDismissable;\n }),\n controller: dynamic(() => {\n const action = ActionModel.use();\n return action.needsConfirmation\n ? action.confirmationModalController\n : action.getOverlayController(\"Modal\");\n }),\n ActionGroup: {\n Button: actionButtonContext,\n },\n },\n };\n\n return (\n <ActionContextProvider value={actionModel}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </ActionContextProvider>\n );\n },\n {\n type: \"provider\",\n },\n);\n\nexport default Action;\n"],"names":["props"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,mBAAA,GAAuD;AAAA,EAC3D,OAAA,EAAS,OAAA,CAAQ,CAAC,KAAA,KAAU;AAC1B,IAAA,MAAM,MAAA,GAAS,YAAY,GAAA,EAAI;AAC/B,IAAA,MAAM,aAAA,GAAgB,YAAY,qBAAA,EAAsB;AACxD,IAAA,MAAM,oBAAA,GACJ,8BAAA,CAA+B,KAAK,CAAA,KAAM,SAAA;AAC5C,IAAA,MAAM,aAAA,GAAgB,8BAAA,CAA+B,KAAK,CAAA,KAAM,OAAA;AAChE,IAAA,IAAI,aAAA,EAAe;AACjB,MAAA,OAAO,MAAM,MAAA,CAAO,2BAAA,CAA4B,KAAA,EAAM;AAAA,IACxD;AACA,IAAA,OAAO,oBAAA,GAAuB,aAAA,CAAc,OAAA,GAAU,MAAA,CAAO,OAAA;AAAA,EAC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.mjs';
|
|
5
5
|
import { dynamic } from '../../lib/propsContext/dynamicProps/dynamic.mjs';
|
|
6
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
import clsx from 'clsx';
|
|
8
9
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionGroup.mjs","sources":["../../../../../../../src/components/ActionGroup/ActionGroup.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ActionGroup.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { ActionStateContextProvider } from \"@/components/Action/models/ActionStateContext\";\nimport { getActionGroupSlot } from \"@/components/ActionGroup/lib/getActionGroupSlot\";\nimport type { ButtonProps } from \"@/components/Button\";\n\nexport interface ActionGroupProps\n extends\n PropsWithChildren,\n FlowComponentProps<HTMLDivElement>,\n PropsWithClassName {\n /** The spacing between the buttons inside the action group. @default \"s\" */\n spacing?: \"s\" | \"m\";\n /** The size of the buttons and links inside the action group. @default \"m\" */\n size?: ButtonProps[\"size\"];\n /**\n * When set, the buttons are not sorted automatically but stay in source\n * order. @default false\n */\n preserveOrder?: boolean;\n}\n\n/** @flr-generate all */\nexport const ActionGroup = flowComponent(\n \"ActionGroup\",\n (props) => {\n const {\n children,\n className,\n ref,\n spacing = \"s\",\n size,\n preserveOrder = false,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.actionGroup,\n styles[spacing],\n !preserveOrder && styles.sorted,\n className,\n );\n\n const propsContext: PropsContext = preserveOrder\n ? {\n Button: { size },\n Switch: {\n labelPosition: \"leading\",\n },\n Link: { size },\n }\n : {\n Button: {\n size,\n slot: dynamic((props) => getActionGroupSlot(props)),\n className: dynamic((props) => {\n const slot = getActionGroupSlot(props);\n return clsx(props.className, styles[slot]);\n }),\n },\n Switch: {\n labelPosition: \"leading\",\n className: dynamic((props) => {\n return clsx(props.className, props.slot && styles[props.slot]);\n }),\n },\n Link: {\n size,\n className: dynamic((props) => {\n return clsx(props.className, props.slot && styles[props.slot]);\n }),\n },\n };\n\n return (\n <ActionStateContextProvider>\n <PropsContextProvider\n props={propsContext}\n dependencies={[preserveOrder, size]}\n >\n <div {...rest} className={rootClassName} ref={ref} role=\"group\">\n {children}\n </div>\n </PropsContextProvider>\n </ActionStateContextProvider>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default ActionGroup;\n"],"names":["props"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActionGroup.mjs","sources":["../../../../../../../src/components/ActionGroup/ActionGroup.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ActionGroup.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { ActionStateContextProvider } from \"@/components/Action/models/ActionStateContext\";\nimport { getActionGroupSlot } from \"@/components/ActionGroup/lib/getActionGroupSlot\";\nimport type { ButtonProps } from \"@/components/Button\";\n\nexport interface ActionGroupProps\n extends\n PropsWithChildren,\n FlowComponentProps<HTMLDivElement>,\n PropsWithClassName {\n /** The spacing between the buttons inside the action group. @default \"s\" */\n spacing?: \"s\" | \"m\";\n /** The size of the buttons and links inside the action group. @default \"m\" */\n size?: ButtonProps[\"size\"];\n /**\n * When set, the buttons are not sorted automatically but stay in source\n * order. @default false\n */\n preserveOrder?: boolean;\n}\n\n/** @flr-generate all */\nexport const ActionGroup = flowComponent(\n \"ActionGroup\",\n (props) => {\n const {\n children,\n className,\n ref,\n spacing = \"s\",\n size,\n preserveOrder = false,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.actionGroup,\n styles[spacing],\n !preserveOrder && styles.sorted,\n className,\n );\n\n const propsContext: PropsContext = preserveOrder\n ? {\n Button: { size },\n Switch: {\n labelPosition: \"leading\",\n },\n Link: { size },\n }\n : {\n Button: {\n size,\n slot: dynamic((props) => getActionGroupSlot(props)),\n className: dynamic((props) => {\n const slot = getActionGroupSlot(props);\n return clsx(props.className, styles[slot]);\n }),\n },\n Switch: {\n labelPosition: \"leading\",\n className: dynamic((props) => {\n return clsx(props.className, props.slot && styles[props.slot]);\n }),\n },\n Link: {\n size,\n className: dynamic((props) => {\n return clsx(props.className, props.slot && styles[props.slot]);\n }),\n },\n };\n\n return (\n <ActionStateContextProvider>\n <PropsContextProvider\n props={propsContext}\n dependencies={[preserveOrder, size]}\n >\n <div {...rest} className={rootClassName} ref={ref} role=\"group\">\n {children}\n </div>\n </PropsContextProvider>\n </ActionStateContextProvider>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default ActionGroup;\n"],"names":["props"],"mappings":";;;;;;;;;;AA6BO,MAAM,WAAA,GAAc,aAAA;AAAA,EACzB,aAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,SAAA;AAAA,MACA,GAAA;AAAA,MACA,OAAA,GAAU,GAAA;AAAA,MACV,IAAA;AAAA,MACA,aAAA,GAAgB,KAAA;AAAA,MAChB,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,MACpB,MAAA,CAAO,WAAA;AAAA,MACP,OAAO,OAAO,CAAA;AAAA,MACd,CAAC,iBAAiB,MAAA,CAAO,MAAA;AAAA,MACzB;AAAA,KACF;AAEA,IAAA,MAAM,eAA6B,a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AG,IAAA,EAAM,WAAW,aAAA,EAAe,GAAA,EAAU,IAAA,EAAK,OAAA,EACrD,QAAA,EACH;AAAA;AAAA,KACF,EACF,CAAA;AAAA,EAEJ,CAAA;AAAA,EACA;AAAA,IACE,IAAA,EAAM;AAAA;AAEV;;;;"}
|
|
@@ -4,6 +4,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
4
4
|
import { AlertIcon } from '../AlertIcon/AlertIcon.mjs';
|
|
5
5
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
6
6
|
import { dynamic } from '../../lib/propsContext/dynamicProps/dynamic.mjs';
|
|
7
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
7
8
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
9
|
import clsx from 'clsx';
|
|
9
10
|
import styles from './Alert.module.scss.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.mjs","sources":["../../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./Alert.module.scss\";\n\nexport interface AlertProps\n extends\n PropsWithChildren<ComponentProps<\"aside\">>,\n PropsWithStatus,\n FlowComponentProps<HTMLElement> {}\n\n/** @flr-generate all */\nexport const Alert = flowComponent(\"Alert\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const rootClassName = clsx(styles.alert, styles[status], className);\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 3,\n size: \"s\",\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} className={styles.icon} />\n {props.children}\n </>\n )),\n },\n Content: {\n className: styles.content,\n Button: {\n size: \"s\",\n },\n ActionGroup: {\n preserveOrder: true,\n size: \"s\",\n },\n },\n };\n\n return (\n <aside {...rest} className={rootClassName} ref={ref}>\n <PropsContextProvider props={propsContext} dependencies={[status]}>\n {children}\n </PropsContextProvider>\n </aside>\n );\n});\n\nexport default Alert;\n"],"names":["props"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Alert.mjs","sources":["../../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./Alert.module.scss\";\n\nexport interface AlertProps\n extends\n PropsWithChildren<ComponentProps<\"aside\">>,\n PropsWithStatus,\n FlowComponentProps<HTMLElement> {}\n\n/** @flr-generate all */\nexport const Alert = flowComponent(\"Alert\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const rootClassName = clsx(styles.alert, styles[status], className);\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 3,\n size: \"s\",\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} className={styles.icon} />\n {props.children}\n </>\n )),\n },\n Content: {\n className: styles.content,\n Button: {\n size: \"s\",\n },\n ActionGroup: {\n preserveOrder: true,\n size: \"s\",\n },\n },\n };\n\n return (\n <aside {...rest} className={rootClassName} ref={ref}>\n <PropsContextProvider props={propsContext} dependencies={[status]}>\n {children}\n </PropsContextProvider>\n </aside>\n );\n});\n\nexport default Alert;\n"],"names":["props"],"mappings":";;;;;;;;;AAiBO,MAAM,KAAA,GAAQ,aAAA,CAAc,OAAA,EAAS,CAAC,KAAA,KAAU;AACrD,EAAA,MAAM,EAAE,UAAU,SAAA,EAAW,MAAA,GAAS,QAAQ,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAE/D,EAAA,MAAM,gBAAgB,IAAA,CAAK,MAAA,CAAO,OAAO,MAAA,CAAO,MAAM,GAAG,SAAS,CAAA;AAElE,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,OAAA,EAAS;AAAA,MACP,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,KAAA,EAAO,CAAA;AAAA,MACP,IAAA,EAAM,GAAA;AAAA,MACN,QAAA,EAAU,OAAA,CAAQ,CAACA,MAAAA,qBACjB,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,MAAA,EAAgB,SAAA,EAAW,MAAA,CAAO,IAAA,EAAM,CAAA;AAAA,QAClDA,MAAAA,CAAM;AAAA,OAAA,EACT,CACD;AAAA,KACH;AAAA,IACA,OAAA,EAAS;AAAA,MACP,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,MAAA,EAAQ;AAAA,QACN,IAAA,EAAM;AAAA,OACR;AAAA,MACA,WAAA,EAAa;AAAA,QACX,aAAA,EAAe,IAAA;AAAA,QACf,IAAA,EAAM;AAAA;AACR;AACF,GACF;AAEA,EAAA,2BACG,OAAA,EAAA,EAAO,GAAG,IAAA,EAAM,SAAA,EAAW,eAAe,GAAA,EACzC,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,cAAc,YAAA,EAAc,CAAC,MAAM,CAAA,EAC7D,UACH,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -21,7 +21,7 @@ const AlertIcon = (props) => {
|
|
|
21
21
|
const stringFormatter = useLocalizedStringFormatter(locales, "AlertIcon");
|
|
22
22
|
const Icon = icons[status];
|
|
23
23
|
const iconProps = {
|
|
24
|
-
status,
|
|
24
|
+
color: status,
|
|
25
25
|
"aria-label": stringFormatter.format(`status.${status}`),
|
|
26
26
|
...rest
|
|
27
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertIcon.mjs","sources":["../../../../../../../src/components/AlertIcon/AlertIcon.tsx"],"sourcesContent":["import type { ComponentType, FC } from \"react\";\nimport {\n IconDanger,\n IconInfo,\n IconSuccess,\n IconUnavailable,\n IconWarning,\n} from \"@/components/Icon/components/icons\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport type { Status } from \"@/lib/types/props\";\nimport type { IconProps } from \"@/components/Icon\";\n\nexport type AlertIconProps = IconProps;\n\nconst icons: Record<Status, ComponentType> = {\n danger: IconDanger,\n info: IconInfo,\n success: IconSuccess,\n warning: IconWarning,\n unavailable: IconUnavailable,\n};\n\n/** @flr-generate all */\nexport const AlertIcon: FC<AlertIconProps> = (props) => {\n const { status = \"info\", ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"AlertIcon\");\n\n const Icon = icons[status];\n\n const iconProps: IconProps = {\n status,\n \"aria-label\": stringFormatter.format(`status.${status}`),\n ...rest,\n };\n\n return <Icon {...iconProps} />;\n};\n\nexport default AlertIcon;\n"],"names":[],"mappings":";;;;;;;;;AAeA,MAAM,KAAA,GAAuC;AAAA,EAC3C,MAAA,EAAQ,UAAA;AAAA,EACR,IAAA,EAAM,QAAA;AAAA,EACN,OAAA,EAAS,WAAA;AAAA,EACT,OAAA,EAAS,WAAA;AAAA,EACT,WAAA,EAAa;AACf,CAAA;AAGO,MAAM,SAAA,GAAgC,CAAC,KAAA,KAAU;AACtD,EAAA,MAAM,EAAE,MAAA,GAAS,MAAA,EAAQ,GAAG,MAAK,GAAI,KAAA;AAErC,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,WAAW,CAAA;AAExE,EAAA,MAAM,IAAA,GAAO,MAAM,MAAM,CAAA;AAEzB,EAAA,MAAM,SAAA,GAAuB;AAAA,IAC3B,MAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"AlertIcon.mjs","sources":["../../../../../../../src/components/AlertIcon/AlertIcon.tsx"],"sourcesContent":["import type { ComponentType, FC } from \"react\";\nimport {\n IconDanger,\n IconInfo,\n IconSuccess,\n IconUnavailable,\n IconWarning,\n} from \"@/components/Icon/components/icons\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport type { PropsWithStatus, Status } from \"@/lib/types/props\";\nimport type { IconProps } from \"@/components/Icon\";\n\nexport type AlertIconProps = Omit<IconProps, \"status\"> & PropsWithStatus;\n\nconst icons: Record<Status, ComponentType> = {\n danger: IconDanger,\n info: IconInfo,\n success: IconSuccess,\n warning: IconWarning,\n unavailable: IconUnavailable,\n};\n\n/** @flr-generate all */\nexport const AlertIcon: FC<AlertIconProps> = (props) => {\n const { status = \"info\", ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"AlertIcon\");\n\n const Icon = icons[status];\n\n const iconProps: IconProps = {\n color: status,\n \"aria-label\": stringFormatter.format(`status.${status}`),\n ...rest,\n };\n\n return <Icon {...iconProps} />;\n};\n\nexport default AlertIcon;\n"],"names":[],"mappings":";;;;;;;;;AAeA,MAAM,KAAA,GAAuC;AAAA,EAC3C,MAAA,EAAQ,UAAA;AAAA,EACR,IAAA,EAAM,QAAA;AAAA,EACN,OAAA,EAAS,WAAA;AAAA,EACT,OAAA,EAAS,WAAA;AAAA,EACT,WAAA,EAAa;AACf,CAAA;AAGO,MAAM,SAAA,GAAgC,CAAC,KAAA,KAAU;AACtD,EAAA,MAAM,EAAE,MAAA,GAAS,MAAA,EAAQ,GAAG,MAAK,GAAI,KAAA;AAErC,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,WAAW,CAAA;AAExE,EAAA,MAAM,IAAA,GAAO,MAAM,MAAM,CAAA;AAEzB,EAAA,MAAM,SAAA,GAAuB;AAAA,IAC3B,KAAA,EAAO,MAAA;AAAA,IACP,YAAA,EAAc,eAAA,CAAgB,MAAA,CAAO,CAAA,OAAA,EAAU,MAAM,CAAA,CAAE,CAAA;AAAA,IACvD,GAAG;AAAA,GACL;AAEA,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAM,GAAG,SAAA,EAAW,CAAA;AAC9B;;;;"}
|
|
@@ -5,6 +5,7 @@ import clsx from 'clsx';
|
|
|
5
5
|
import styles from './AlertText.module.scss.mjs';
|
|
6
6
|
import { AlertIcon } from '../AlertIcon/AlertIcon.mjs';
|
|
7
7
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
8
9
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
10
|
|
|
10
11
|
const AlertText = flowComponent("AlertText", (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertText.mjs","sources":["../../../../../../../src/components/AlertText/AlertText.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport type { PropsWithClassName, PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./AlertText.module.scss\";\nimport { AlertIcon } from \"@/components/AlertIcon\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\n\nexport interface AlertTextProps\n extends\n PropsWithClassName,\n PropsWithChildren,\n FlowComponentProps,\n PropsWithStatus {}\n\n/** @flr-generate all */\nexport const AlertText = flowComponent(\"AlertText\", (props) => {\n const { className, children, status = \"info\" } = props;\n\n const rootClassName = clsx(styles.alertText, styles[status], className);\n\n return (\n <span className={rootClassName}>\n <PropsContextProvider props={{ Icon: { size: \"s\" } }}>\n <AlertIcon status={status} className={styles.icon} />\n </PropsContextProvider>\n\n <>{children}</>\n </span>\n );\n});\n\nexport default AlertText;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlertText.mjs","sources":["../../../../../../../src/components/AlertText/AlertText.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport type { PropsWithClassName, PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./AlertText.module.scss\";\nimport { AlertIcon } from \"@/components/AlertIcon\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\n\nexport interface AlertTextProps\n extends\n PropsWithClassName,\n PropsWithChildren,\n FlowComponentProps,\n PropsWithStatus {}\n\n/** @flr-generate all */\nexport const AlertText = flowComponent(\"AlertText\", (props) => {\n const { className, children, status = \"info\" } = props;\n\n const rootClassName = clsx(styles.alertText, styles[status], className);\n\n return (\n <span className={rootClassName}>\n <PropsContextProvider props={{ Icon: { size: \"s\" } }}>\n <AlertIcon status={status} className={styles.icon} />\n </PropsContextProvider>\n\n <>{children}</>\n </span>\n );\n});\n\nexport default AlertText;\n"],"names":[],"mappings":";;;;;;;;AAmBO,MAAM,SAAA,GAAY,aAAA,CAAc,WAAA,EAAa,CAAC,KAAA,KAAU;AAC7D,EAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,MAAA,GAAS,QAAO,GAAI,KAAA;AAEjD,EAAA,MAAM,gBAAgB,IAAA,CAAK,MAAA,CAAO,WAAW,MAAA,CAAO,MAAM,GAAG,SAAS,CAAA;AAEtE,EAAA,uBACE,IAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,aAAA,EACf,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,EAAE,IAAA,EAAM,EAAE,IAAA,EAAM,GAAA,EAAI,EAAE,EACjD,8BAAC,SAAA,EAAA,EAAU,MAAA,EAAgB,SAAA,EAAW,MAAA,CAAO,MAAM,CAAA,EACrD,CAAA;AAAA,oCAEG,QAAA,EAAS;AAAA,GAAA,EACd,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import styles from './Align.module.scss.mjs';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
9
|
|
|
@@ -16,7 +17,7 @@ const Align = flowComponent(
|
|
|
16
17
|
Button: { className: styles.button },
|
|
17
18
|
Avatar: { className: styles.avatar, size: "m" },
|
|
18
19
|
CopyButton: { size: "s", className: styles.copyButton },
|
|
19
|
-
Icon: { size: "s", className: styles.icon },
|
|
20
|
+
Icon: { size: "s", className: styles.icon, color: "neutral" },
|
|
20
21
|
ContextualHelpTrigger: {
|
|
21
22
|
Button: {
|
|
22
23
|
className: styles.contextualHelpTriggerButton
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Align.mjs","sources":["../../../../../../../src/components/Align/Align.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./Align.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\n\nexport interface AlignProps\n extends PropsWithChildren, PropsWithClassName, FlowComponentProps {}\n\n/** @flr-generate all */\nexport const Align = flowComponent(\n \"Align\",\n (props) => {\n const { children, className } = props;\n\n const rootClassName = clsx(styles.align, className);\n\n const propsContext: PropsContext = {\n Text: { className: styles.text },\n Button: { className: styles.button },\n Avatar: { className: styles.avatar, size: \"m\" },\n CopyButton: { size: \"s\", className: styles.copyButton },\n Icon: { size: \"s\", className: styles.icon },\n ContextualHelpTrigger: {\n Button: {\n className: styles.contextualHelpTriggerButton,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div className={rootClassName}>{children}</div>\n </PropsContextProvider>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Align;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Align.mjs","sources":["../../../../../../../src/components/Align/Align.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./Align.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\n\nexport interface AlignProps\n extends PropsWithChildren, PropsWithClassName, FlowComponentProps {}\n\n/** @flr-generate all */\nexport const Align = flowComponent(\n \"Align\",\n (props) => {\n const { children, className } = props;\n\n const rootClassName = clsx(styles.align, className);\n\n const propsContext: PropsContext = {\n Text: { className: styles.text },\n Button: { className: styles.button },\n Avatar: { className: styles.avatar, size: \"m\" },\n CopyButton: { size: \"s\", className: styles.copyButton },\n Icon: { size: \"s\", className: styles.icon, color: \"neutral\" },\n ContextualHelpTrigger: {\n Button: {\n className: styles.contextualHelpTriggerButton,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div className={rootClassName}>{children}</div>\n </PropsContextProvider>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Align;\n"],"names":[],"mappings":";;;;;;;AAaO,MAAM,KAAA,GAAQ,aAAA;AAAA,EACnB,OAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,KAAA;AAEhC,IAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,MAAA,CAAO,KAAA,EAAO,SAAS,CAAA;AAElD,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,IAAA,EAAM,EAAE,SAAA,EAAW,MAAA,CAAO,IAAA,EAAK;AAAA,MAC/B,MAAA,EAAQ,EAAE,SAAA,EAAW,MAAA,CAAO,MAAA,EAAO;AAAA,MACnC,QAAQ,EAAE,SAAA,EAAW,MAAA,CAAO,MAAA,EAAQ,MAAM,GAAA,EAAI;AAAA,MAC9C,YAAY,EAAE,IAAA,EAAM,GAAA,EAAK,SAAA,EAAW,OAAO,UAAA,EAAW;AAAA,MACtD,IAAA,EAAM,EAAE,IAAA,EAAM,GAAA,EAAK,WAAW,MAAA,CAAO,IAAA,EAAM,OAAO,SAAA,EAAU;AAAA,MAC5D,qBAAA,EAAuB;AAAA,QACrB,MAAA,EAAQ;AAAA,UACN,WAAW,MAAA,CAAO;AAAA;AACpB;AACF,KACF;AAEA,IAAA,uBACE,GAAA,CAAC,wBAAqB,KAAA,EAAO,YAAA,EAC3B,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,aAAA,EAAgB,QAAA,EAAS,CAAA,EAC3C,CAAA;AAAA,EAEJ,CAAA;AAAA,EACA;AAAA,IACE,IAAA,EAAM;AAAA;AAEV;;;;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useRef } from 'react';
|
|
5
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
5
6
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
6
7
|
import * as Aria from 'react-aria-components';
|
|
7
8
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.mjs","sources":["../../../../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import { useRef, type PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport Options from \"@/components/Options\";\nimport locales from \"./locales/*.locale.json\";\nimport Text from \"@/components/Text\";\nimport styles from \"./Autocomplete.module.scss\";\nimport {\n UNSAFE_PortalProvider,\n useFocusWithin,\n useLocalizedStringFormatter,\n useObjectRef,\n} from \"react-aria\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { isFocused } from \"@/lib/form/isFocused\";\nimport { emitElementValueChange } from \"@/lib/react/emitElementValueChange\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface AutocompleteProps\n extends\n PropsWithChildren,\n PropsWithClassName,\n FlowComponentProps<HTMLInputElement>,\n Omit<\n Aria.AutocompleteProps,\n \"children\" | \"onInputChange\" | \"inputValue\" | \"defaultInputValue\" | \"ref\"\n > {}\n\n/** @flr-generate all */\nexport const Autocomplete = flowComponent(\"Autocomplete\", (props) => {\n const { children, ref, ...rest } = props;\n\n const inputRef = useObjectRef(ref);\n\n const { contains } = Aria.useFilter({ sensitivity: \"base\" });\n const stringFormatter = useLocalizedStringFormatter(locales);\n const container = useRef(null);\n\n const optionsOverlayController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n\n const focusWithin = useFocusWithin({\n onBlurWithin: () => optionsOverlayController.close(),\n });\n\n const renderEmptyState = () => (\n <Text className={styles.empty}>\n {stringFormatter.format(\"autocomplete.empty\")}\n </Text>\n );\n\n const handleInputChange = (value: string) => {\n if (value === \"\") {\n optionsOverlayController.close();\n } else if (isFocused(inputRef.current)) {\n optionsOverlayController.open();\n }\n };\n\n const handleOptionAction = (key: Aria.Key) => {\n const value = String(key);\n if (inputRef.current) {\n emitElementValueChange(inputRef.current, value);\n }\n optionsOverlayController.close();\n };\n\n const inputProps: SearchFieldProps & TextFieldProps = {\n onKeyDown: (e) => {\n if (e.key === \"Enter\" && optionsOverlayController.isOpen) {\n e.preventDefault();\n }\n },\n ref: inputRef,\n onChange: handleInputChange,\n };\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props, \"Autocomplete\");\n\n const propsContext: PropsContext = {\n SearchField: inputProps,\n TextField: inputProps,\n Option: {\n tunnel: {\n id: \"options\",\n component: \"Autocomplete\",\n },\n },\n Popover: {\n className: styles.popover,\n },\n ...fieldPropsContext,\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorCaptureContext>\n <PropsContextProvider\n props={propsContext}\n dependencies={[optionsOverlayController]}\n >\n <div {...focusWithin.focusWithinProps} ref={container}>\n <UNSAFE_PortalProvider getContainer={() => container.current}>\n <Aria.Autocomplete\n filter={contains}\n disableAutoFocusFirst\n {...rest}\n >\n {children}\n <Options\n onAction={handleOptionAction}\n triggerRef={inputRef}\n controller={optionsOverlayController}\n renderEmptyState={renderEmptyState}\n isNonModal\n placement=\"bottom start\"\n >\n <UiComponentTunnelExit\n id=\"options\"\n component=\"Autocomplete\"\n />\n </Options>\n </Aria.Autocomplete>\n </UNSAFE_PortalProvider>\n </div>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Autocomplete;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Autocomplete.mjs","sources":["../../../../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import { useRef, type PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport Options from \"@/components/Options\";\nimport locales from \"./locales/*.locale.json\";\nimport Text from \"@/components/Text\";\nimport styles from \"./Autocomplete.module.scss\";\nimport {\n UNSAFE_PortalProvider,\n useFocusWithin,\n useLocalizedStringFormatter,\n useObjectRef,\n} from \"react-aria\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { isFocused } from \"@/lib/form/isFocused\";\nimport { emitElementValueChange } from \"@/lib/react/emitElementValueChange\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface AutocompleteProps\n extends\n PropsWithChildren,\n PropsWithClassName,\n FlowComponentProps<HTMLInputElement>,\n Omit<\n Aria.AutocompleteProps,\n \"children\" | \"onInputChange\" | \"inputValue\" | \"defaultInputValue\" | \"ref\"\n > {}\n\n/** @flr-generate all */\nexport const Autocomplete = flowComponent(\"Autocomplete\", (props) => {\n const { children, ref, ...rest } = props;\n\n const inputRef = useObjectRef(ref);\n\n const { contains } = Aria.useFilter({ sensitivity: \"base\" });\n const stringFormatter = useLocalizedStringFormatter(locales);\n const container = useRef(null);\n\n const optionsOverlayController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n\n const focusWithin = useFocusWithin({\n onBlurWithin: () => optionsOverlayController.close(),\n });\n\n const renderEmptyState = () => (\n <Text className={styles.empty}>\n {stringFormatter.format(\"autocomplete.empty\")}\n </Text>\n );\n\n const handleInputChange = (value: string) => {\n if (value === \"\") {\n optionsOverlayController.close();\n } else if (isFocused(inputRef.current)) {\n optionsOverlayController.open();\n }\n };\n\n const handleOptionAction = (key: Aria.Key) => {\n const value = String(key);\n if (inputRef.current) {\n emitElementValueChange(inputRef.current, value);\n }\n optionsOverlayController.close();\n };\n\n const inputProps: SearchFieldProps & TextFieldProps = {\n onKeyDown: (e) => {\n if (e.key === \"Enter\" && optionsOverlayController.isOpen) {\n e.preventDefault();\n }\n },\n ref: inputRef,\n onChange: handleInputChange,\n };\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props, \"Autocomplete\");\n\n const propsContext: PropsContext = {\n SearchField: inputProps,\n TextField: inputProps,\n Option: {\n tunnel: {\n id: \"options\",\n component: \"Autocomplete\",\n },\n },\n Popover: {\n className: styles.popover,\n },\n ...fieldPropsContext,\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorCaptureContext>\n <PropsContextProvider\n props={propsContext}\n dependencies={[optionsOverlayController]}\n >\n <div {...focusWithin.focusWithinProps} ref={container}>\n <UNSAFE_PortalProvider getContainer={() => container.current}>\n <Aria.Autocomplete\n filter={contains}\n disableAutoFocusFirst\n {...rest}\n >\n {children}\n <Options\n onAction={handleOptionAction}\n triggerRef={inputRef}\n controller={optionsOverlayController}\n renderEmptyState={renderEmptyState}\n isNonModal\n placement=\"bottom start\"\n >\n <UiComponentTunnelExit\n id=\"options\"\n component=\"Autocomplete\"\n />\n </Options>\n </Aria.Autocomplete>\n </UNSAFE_PortalProvider>\n </div>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Autocomplete;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqCO,MAAM,YAAA,GAAe,aAAA,CAAc,cAAA,EAAgB,CAAC,KAAA,KAAU;AACnE,EAAA,MAAM,EAAE,QAAA,EAAU,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAEnC,EAAA,MAAM,QAAA,GAAW,aAAa,GAAG,CAAA;AAEjC,EAAA,MAAM,EAAE,UAAS,GAAI,IAAA,CAAK,UAAU,EAAE,WAAA,EAAa,QAAQ,CAAA;AAC3D,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,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Z,gBAAA;AAAA,kBACA,UAAA,EAAU,IAAA;AAAA,kBACV,SAAA,EAAU,cAAA;AAAA,kBAEV,QAAA,kBAAA,GAAA;AAAA,oBAAC,qBAAA;AAAA,oBAAA;AAAA,sBACC,EAAA,EAAG,SAAA;AAAA,sBACH,SAAA,EAAU;AAAA;AAAA;AACZ;AAAA;AACF;AAAA;AAAA,WAEJ,CAAA,EACF;AAAA;AAAA,KACF,EACF,CAAA;AAAA,wBACC,cAAA,EAAA,EAAe;AAAA,GAAA,EAClB,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import styles from './Avatar.module.scss.mjs';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
9
|
import { AlertIcon } from '../AlertIcon/AlertIcon.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.mjs","sources":["../../../../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./Avatar.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithClassName, Status } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { AlertIcon } from \"@/components/AlertIcon\";\nimport type { avatarColors } from \"@/components/Avatar/avatarColors\";\n\nexport type AvatarColors = (typeof avatarColors)[number];\n\nexport interface AvatarProps\n extends PropsWithChildren, PropsWithClassName, FlowComponentProps {\n /** The size of the avatar. @default \"m\" */\n size?: \"xs\" | \"s\" | \"m\" | \"l\";\n /** The color of icons and initials inside the avatar. */\n color?: AvatarColors;\n /**\n * Adds status icon and color to the avatar. May only be used if the status is\n * explained by an element (like text or label) nearby.\n */\n status?: Status;\n /**\n * A descriptive label that assistive technology announces for the avatar\n * (e.g. the name of the represented person or entity). When set, the avatar\n * is exposed as a single image with this label. When omitted, the avatar is\n * treated as purely decorative and hidden from assistive technology.\n */\n label?: string;\n}\n\n/** @flr-generate all */\nexport const Avatar = flowComponent(\"Avatar\", (props) => {\n const { children, className, color, size = \"m\", status, label, ref } = props;\n\n const rootClassName = clsx(\n styles.avatar,\n styles[`size-${size}`],\n !status && styles[color ?? \"blue\"],\n status && styles[status],\n className,\n );\n\n const useDynamicColor = color === undefined && status === undefined;\n\n const propsContext: PropsContext = {\n Initials: {\n className: styles.initials,\n useDynamicColor,\n \"aria-hidden\": true,\n },\n Icon: {\n className: styles.icon,\n },\n Image: {\n \"aria-hidden\": true,\n },\n };\n\n const isMeaningful = label !== undefined;\n const isDecorative = !isMeaningful && !status;\n\n return (\n <div\n className={rootClassName}\n role={isMeaningful ? \"img\" : undefined}\n aria-label={label}\n aria-hidden={isDecorative || undefined}\n ref={ref}\n >\n <PropsContextProvider props={propsContext}>\n {!status && children}\n {status && <AlertIcon className={styles.icon} status={status} />}\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default Avatar;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Avatar.mjs","sources":["../../../../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./Avatar.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithClassName, Status } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { AlertIcon } from \"@/components/AlertIcon\";\nimport type { avatarColors } from \"@/components/Avatar/avatarColors\";\n\nexport type AvatarColors = (typeof avatarColors)[number];\n\nexport interface AvatarProps\n extends PropsWithChildren, PropsWithClassName, FlowComponentProps {\n /** The size of the avatar. @default \"m\" */\n size?: \"xs\" | \"s\" | \"m\" | \"l\";\n /** The color of icons and initials inside the avatar. */\n color?: AvatarColors;\n /**\n * Adds status icon and color to the avatar. May only be used if the status is\n * explained by an element (like text or label) nearby.\n */\n status?: Status;\n /**\n * A descriptive label that assistive technology announces for the avatar\n * (e.g. the name of the represented person or entity). When set, the avatar\n * is exposed as a single image with this label. When omitted, the avatar is\n * treated as purely decorative and hidden from assistive technology.\n */\n label?: string;\n}\n\n/** @flr-generate all */\nexport const Avatar = flowComponent(\"Avatar\", (props) => {\n const { children, className, color, size = \"m\", status, label, ref } = props;\n\n const rootClassName = clsx(\n styles.avatar,\n styles[`size-${size}`],\n !status && styles[color ?? \"blue\"],\n status && styles[status],\n className,\n );\n\n const useDynamicColor = color === undefined && status === undefined;\n\n const propsContext: PropsContext = {\n Initials: {\n className: styles.initials,\n useDynamicColor,\n \"aria-hidden\": true,\n },\n Icon: {\n className: styles.icon,\n },\n Image: {\n \"aria-hidden\": true,\n },\n };\n\n const isMeaningful = label !== undefined;\n const isDecorative = !isMeaningful && !status;\n\n return (\n <div\n className={rootClassName}\n role={isMeaningful ? \"img\" : undefined}\n aria-label={label}\n aria-hidden={isDecorative || undefined}\n ref={ref}\n >\n <PropsContextProvider props={propsContext}>\n {!status && children}\n {status && <AlertIcon className={styles.icon} status={status} />}\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default Avatar;\n"],"names":[],"mappings":";;;;;;;;AAkCO,MAAM,MAAA,GAAS,aAAA,CAAc,QAAA,EAAU,CAAC,KAAA,KAAU;AACvD,EAAA,MAAM,EAAE,UAAU,SAAA,EAAW,KAAA,EAAO,OAAO,GAAA,EAAK,MAAA,EAAQ,KAAA,EAAO,GAAA,EAAI,GAAI,KAAA;AAEvE,EAAA,MAAM,a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 'react/jsx-runtime';
|
|
|
4
4
|
import { Children } from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import styles from './AvatarStack.module.scss.mjs';
|
|
7
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
7
8
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
9
|
import { Button } from '../Button/Button.mjs';
|
|
9
10
|
import { Avatar } from '../Avatar/Avatar.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarStack.mjs","sources":["../../../../../../../src/components/AvatarStack/AvatarStack.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { Children } from \"react\";\nimport clsx from \"clsx\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./AvatarStack.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button } from \"@/components/Button\";\nimport { Avatar } from \"@/components/Avatar\";\nimport { Wrap } from \"@/components/Wrap\";\n\nexport interface AvatarStackProps\n extends PropsWithClassName, PropsWithChildren {\n /**\n * The total count of items, as avatars should only be displayed for the first\n * view\n */\n totalCount?: number;\n /** The onPress action of the additional items count element */\n onCountPress?: () => void;\n /** The size of the avatars inside the stack. @default \"m\" */\n size?: \"xs\" | \"s\" | \"m\" | \"l\";\n}\n\n/** @flr-generate all */\nexport const AvatarStack: FC<AvatarStackProps> = (props) => {\n const {\n className,\n children,\n totalCount = 0,\n size = \"m\",\n onCountPress,\n } = props;\n\n const avatarCount = Children.count(children);\n\n const additionalItemsCount = totalCount - avatarCount;\n\n const rootClassName = clsx(\n styles.avatarStack,\n styles[`size-${size}`],\n className,\n );\n\n const propsContext: PropsContext = {\n Avatar: { className: styles.avatar, size },\n Button: {\n className: styles.avatar,\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div className={rootClassName}>\n {children}\n {additionalItemsCount > 0 && (\n <Wrap if={onCountPress}>\n <Button onPress={onCountPress}>\n <Avatar size={size}>+{additionalItemsCount}</Avatar>\n </Button>\n </Wrap>\n )}\n </div>\n </PropsContextProvider>\n );\n};\n\nexport default AvatarStack;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AvatarStack.mjs","sources":["../../../../../../../src/components/AvatarStack/AvatarStack.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { Children } from \"react\";\nimport clsx from \"clsx\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./AvatarStack.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button } from \"@/components/Button\";\nimport { Avatar } from \"@/components/Avatar\";\nimport { Wrap } from \"@/components/Wrap\";\n\nexport interface AvatarStackProps\n extends PropsWithClassName, PropsWithChildren {\n /**\n * The total count of items, as avatars should only be displayed for the first\n * view\n */\n totalCount?: number;\n /** The onPress action of the additional items count element */\n onCountPress?: () => void;\n /** The size of the avatars inside the stack. @default \"m\" */\n size?: \"xs\" | \"s\" | \"m\" | \"l\";\n}\n\n/** @flr-generate all */\nexport const AvatarStack: FC<AvatarStackProps> = (props) => {\n const {\n className,\n children,\n totalCount = 0,\n size = \"m\",\n onCountPress,\n } = props;\n\n const avatarCount = Children.count(children);\n\n const additionalItemsCount = totalCount - avatarCount;\n\n const rootClassName = clsx(\n styles.avatarStack,\n styles[`size-${size}`],\n className,\n );\n\n const propsContext: PropsContext = {\n Avatar: { className: styles.avatar, size },\n Button: {\n className: styles.avatar,\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div className={rootClassName}>\n {children}\n {additionalItemsCount > 0 && (\n <Wrap if={onCountPress}>\n <Button onPress={onCountPress}>\n <Avatar size={size}>+{additionalItemsCount}</Avatar>\n </Button>\n </Wrap>\n )}\n </div>\n </PropsContextProvider>\n );\n};\n\nexport default AvatarStack;\n"],"names":[],"mappings":";;;;;;;;;;AAyBO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from 'clsx';
|
|
6
6
|
import { alphaColors, isAlphaColor } from '../../lib/types/props.mjs';
|
|
7
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
7
8
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
9
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
9
10
|
import { Button } from '../Button/Button.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.mjs","sources":["../../../../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./Badge.module.scss\";\nimport clsx from \"clsx\";\nimport {\n alphaColors,\n isAlphaColor,\n type PropsWithClassName,\n} from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PressEvent } from \"@react-types/shared\";\nimport { Button } from \"@/components/Button\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\n\nexport const badgeColors = [\n \"neutral\",\n \"blue\",\n \"navy\",\n \"violet\",\n \"teal\",\n \"lilac\",\n \"green\",\n \"orange\",\n \"red\",\n ...alphaColors,\n] as const;\nexport type BadgeColors = (typeof badgeColors)[number];\n\nexport interface BadgeProps\n extends PropsWithChildren, FlowComponentProps, PropsWithClassName {\n /** Handler that is called when the badge is pressed. */\n onPress?: (e: PressEvent) => void;\n /** Handler that is called when the badges close icon is pressed. */\n onClose?: (e: PressEvent) => void;\n /** The color of the badge. @default \"neutral\" */\n color?: BadgeColors;\n /** Whether the badge is disabled. */\n isDisabled?: boolean;\n}\n\n/** @flr-generate all */\nexport const Badge = flowComponent(\"Badge\", (props) => {\n const {\n children,\n className,\n color = \"neutral\",\n ref,\n onPress,\n onClose,\n isDisabled,\n ...rest\n } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Badge\");\n\n const rootClassName = clsx(\n styles.badge,\n styles[color],\n isDisabled && styles.disabled,\n className,\n );\n\n const propsContext: PropsContext = {\n Label: {\n elementType: \"span\",\n className: styles.scope,\n unstyled: true,\n },\n Text: {\n elementType: \"span\",\n className: styles.value,\n },\n Button: {\n Label: {\n elementType: \"span\",\n className: styles.scope,\n unstyled: true,\n },\n Text: {\n elementType: \"span\",\n className: styles.value,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div className={rootClassName} {...rest} ref={ref}>\n {!onPress && <div className={styles.content}>{children}</div>}\n {onPress && (\n <Button\n isDisabled={isDisabled}\n unstyled\n className={styles.button}\n onPress={onPress}\n >\n {children}\n </Button>\n )}\n\n {onClose && (\n <Button\n className={styles.close}\n size=\"s\"\n color={isAlphaColor(color) ? color : \"dark\"}\n variant=\"plain\"\n onPress={onClose}\n isDisabled={isDisabled}\n aria-label={stringFormatter.format(\"remove\")}\n >\n <IconClose />\n </Button>\n )}\n </div>\n </PropsContextProvider>\n );\n});\n\nexport default Badge;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Badge.mjs","sources":["../../../../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./Badge.module.scss\";\nimport clsx from \"clsx\";\nimport {\n alphaColors,\n isAlphaColor,\n type PropsWithClassName,\n} from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PressEvent } from \"@react-types/shared\";\nimport { Button } from \"@/components/Button\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\n\nexport const badgeColors = [\n \"neutral\",\n \"blue\",\n \"navy\",\n \"violet\",\n \"teal\",\n \"lilac\",\n \"green\",\n \"orange\",\n \"red\",\n ...alphaColors,\n] as const;\nexport type BadgeColors = (typeof badgeColors)[number];\n\nexport interface BadgeProps\n extends PropsWithChildren, FlowComponentProps, PropsWithClassName {\n /** Handler that is called when the badge is pressed. */\n onPress?: (e: PressEvent) => void;\n /** Handler that is called when the badges close icon is pressed. */\n onClose?: (e: PressEvent) => void;\n /** The color of the badge. @default \"neutral\" */\n color?: BadgeColors;\n /** Whether the badge is disabled. */\n isDisabled?: boolean;\n}\n\n/** @flr-generate all */\nexport const Badge = flowComponent(\"Badge\", (props) => {\n const {\n children,\n className,\n color = \"neutral\",\n ref,\n onPress,\n onClose,\n isDisabled,\n ...rest\n } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Badge\");\n\n const rootClassName = clsx(\n styles.badge,\n styles[color],\n isDisabled && styles.disabled,\n className,\n );\n\n const propsContext: PropsContext = {\n Label: {\n elementType: \"span\",\n className: styles.scope,\n unstyled: true,\n },\n Text: {\n elementType: \"span\",\n className: styles.value,\n },\n Button: {\n Label: {\n elementType: \"span\",\n className: styles.scope,\n unstyled: true,\n },\n Text: {\n elementType: \"span\",\n className: styles.value,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div className={rootClassName} {...rest} ref={ref}>\n {!onPress && <div className={styles.content}>{children}</div>}\n {onPress && (\n <Button\n isDisabled={isDisabled}\n unstyled\n className={styles.button}\n onPress={onPress}\n >\n {children}\n </Button>\n )}\n\n {onClose && (\n <Button\n className={styles.close}\n size=\"s\"\n color={isAlphaColor(color) ? color : \"dark\"}\n variant=\"plain\"\n onPress={onClose}\n isDisabled={isDisabled}\n aria-label={stringFormatter.format(\"remove\")}\n >\n <IconClose />\n </Button>\n )}\n </div>\n </PropsContextProvider>\n );\n});\n\nexport default Badge;\n"],"names":[],"mappings":";;;;;;;;;;;;AAiB2B;AAAA,EACzB,S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AA,IAAA,CAAC,SAAI,SAAA,EAAW,aAAA,EAAgB,GAAG,IAAA,EAAM,GAAA,EACtC,QAAA,EAAA;AAAA,IAAA,CAAC,2BAAW,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,SAAU,QAAA,EAAS,CAAA;AAAA,IACtD,OAAA,oBACC,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,UAAA;AAAA,QACA,QAAA,EAAQ,IAAA;AAAA,QACR,WAAW,MAAA,CAAO,MAAA;AAAA,QAClB,OAAA;AAAA,QAEC;AAAA;AAAA,KACH;AAAA,IAGD,OAAA,oBACC,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,WAAW,MAAA,CAAO,KAAA;AAAA,QAClB,IAAA,EAAK,GAAA;AAAA,QACL,KAAA,EAAO,YAAA,CAAa,KAAK,CAAA,GAAI,KAAA,GAAQ,MAAA;AAAA,QACrC,OAAA,EAAQ,OAAA;AAAA,QACR,OAAA,EAAS,OAAA;AAAA,QACT,UAAA;AAAA,QACA,YAAA,EAAY,eAAA,CAAgB,MAAA,CAAO,QAAQ,CAAA;AAAA,QAE3C,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA;AACb,GAAA,EAEJ,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import styles from './BigNumber.module.scss.mjs';
|
|
6
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
|
|
8
9
|
const BigNumber = (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BigNumber.mjs","sources":["../../../../../../../src/components/BigNumber/BigNumber.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./BigNumber.module.scss\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\n\nexport type BigNumberProps = PropsWithChildren & PropsWithClassName;\n\n/** @flr-generate all */\nexport const BigNumber: FC<BigNumberProps> = (props) => {\n const { children, className } = props;\n\n const rootClassName = clsx(styles.bigNumber, className);\n\n const propsContext: PropsContext = {\n Text: {\n className: styles.text,\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <span className={rootClassName}>{children}</span>\n </PropsContextProvider>\n );\n};\n\nexport default BigNumber;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BigNumber.mjs","sources":["../../../../../../../src/components/BigNumber/BigNumber.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./BigNumber.module.scss\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\n\nexport type BigNumberProps = PropsWithChildren & PropsWithClassName;\n\n/** @flr-generate all */\nexport const BigNumber: FC<BigNumberProps> = (props) => {\n const { children, className } = props;\n\n const rootClassName = clsx(styles.bigNumber, className);\n\n const propsContext: PropsContext = {\n Text: {\n className: styles.text,\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <span className={rootClassName}>{children}</span>\n </PropsContextProvider>\n );\n};\n\nexport default BigNumber;\n"],"names":[],"mappings":";;;;;;AASO,MAAM,SAAA,GAAgC,CAAC,KAAA,KAAU;AACtD,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,KAAA;AAEhC,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,MAAA,CAAO,SAAA,EAAW,SAAS,CAAA;AAEtD,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,IAAA,EAAM;AAAA,MACJ,WAAW,MAAA,CAAO;AAAA;AACpB,GACF;AAEA,EAAA,uBACE,GAAA,CAAC,wBAAqB,KAAA,EAAO,YAAA,EAC3B,8BAAC,MAAA,EAAA,EAAK,SAAA,EAAW,aAAA,EAAgB,QAAA,EAAS,CAAA,EAC5C,CAAA;AAEJ;;;;"}
|
|
@@ -4,6 +4,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import * as Aria from 'react-aria-components';
|
|
5
5
|
import styles from './Breadcrumb.module.scss.mjs';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
7
8
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
9
|
import { isAlphaColor } from '../../lib/types/props.mjs';
|
|
9
10
|
import { BreadcrumbItem } from './components/BreadcrumbItem/BreadcrumbItem.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.mjs","sources":["../../../../../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Breadcrumb.module.scss\";\nimport clsx from \"clsx\";\nimport type { BreadcrumbItemProps } from \"./components/BreadcrumbItem\";\nimport { BreadcrumbItem } from \"./components/BreadcrumbItem\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { type AlphaColor, isAlphaColor } from \"@/lib/types/props\";\n\nexport interface BreadcrumbProps\n extends\n Omit<Aria.BreadcrumbsProps<BreadcrumbItemProps>, \"children\">,\n PropsWithChildren {\n /** The color of the breadcrumb. @default \"default\" */\n color?: \"default\" | AlphaColor;\n /** The size of the element. @default \"m\" */\n size?: \"s\" | \"m\";\n}\n\n/** @flr-generate all */\nexport const Breadcrumb: FC<BreadcrumbProps> = (props) => {\n const { children, className, color = \"default\", size = \"m\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.breadcrumb,\n isAlphaColor(color) && styles[color],\n size === \"s\" && styles[\"size-s\"],\n className,\n );\n\n const propsContext: PropsContext = {\n Link: {\n unstyled: true,\n className: styles.link,\n wrapWith: <BreadcrumbItem />,\n },\n };\n\n return (\n <Aria.Breadcrumbs {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Aria.Breadcrumbs>\n );\n};\n\nexport default Breadcrumb;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Breadcrumb.mjs","sources":["../../../../../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Breadcrumb.module.scss\";\nimport clsx from \"clsx\";\nimport type { BreadcrumbItemProps } from \"./components/BreadcrumbItem\";\nimport { BreadcrumbItem } from \"./components/BreadcrumbItem\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { type AlphaColor, isAlphaColor } from \"@/lib/types/props\";\n\nexport interface BreadcrumbProps\n extends\n Omit<Aria.BreadcrumbsProps<BreadcrumbItemProps>, \"children\">,\n PropsWithChildren {\n /** The color of the breadcrumb. @default \"default\" */\n color?: \"default\" | AlphaColor;\n /** The size of the element. @default \"m\" */\n size?: \"s\" | \"m\";\n}\n\n/** @flr-generate all */\nexport const Breadcrumb: FC<BreadcrumbProps> = (props) => {\n const { children, className, color = \"default\", size = \"m\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.breadcrumb,\n isAlphaColor(color) && styles[color],\n size === \"s\" && styles[\"size-s\"],\n className,\n );\n\n const propsContext: PropsContext = {\n Link: {\n unstyled: true,\n className: styles.link,\n wrapWith: <BreadcrumbItem />,\n },\n };\n\n return (\n <Aria.Breadcrumbs {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Aria.Breadcrumbs>\n );\n};\n\nexport default Breadcrumb;\n"],"names":[],"mappings":";;;;;;;;;AAqBO,MAAM,UAAA,GAAkC,CAAC,KAAA,KAAU;AACxD,EAAA,MAAM,EAAE,UAAU,SAAA,EAAW,KAAA,GAAQ,WAAW,IAAA,GAAO,GAAA,EAAK,GAAG,IAAA,EAAK,GAAI,KAAA;AAExE,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,UAAA;AAAA,IACP,YAAA,CAAa,KAAK,CAAA,IAAK,MAAA,CAAO,KAAK,CAAA;AAAA,IACnC,IAAA,KAAS,GAAA,IAAO,MAAA,CAAO,QAAQ,CAAA;AAAA,IAC/B;AAAA,GACF;AAEA,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,IAAA,EAAM;AAAA,MACJ,QAAA,EAAU,IAAA;AAAA,MACV,WAAW,MAAA,CAAO,IAAA;AAAA,MAClB,QAAA,sBAAW,cAAA,EAAA,EAAe;AAAA;AAC5B,GACF;AAEA,EAAA,uBACE,GAAA,CAAC,IAAA,CAAK,WAAA,EAAL,EAAkB,GAAG,IAAA,EAAM,SAAA,EAAW,aAAA,EACrC,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,UACH,CAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserOnly.mjs","sources":["../../../../../../../src/components/BrowserOnly/BrowserOnly.tsx"],"sourcesContent":["import { useIsMounted } from \"@/lib/hooks\";\nimport type { PropsWithChildren } from \"react\";\n\nexport type BrowserOnlyProps = PropsWithChildren;\n\nexport const BrowserOnly = (props: PropsWithChildren) => {\n if (useIsMounted()) {\n return props.children;\n }\n};\n\nexport default BrowserOnly;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BrowserOnly.mjs","sources":["../../../../../../../src/components/BrowserOnly/BrowserOnly.tsx"],"sourcesContent":["import { useIsMounted } from \"@/lib/hooks\";\nimport type { PropsWithChildren } from \"react\";\n\nexport type BrowserOnlyProps = PropsWithChildren;\n\nexport const BrowserOnly = (props: PropsWithChildren) => {\n if (useIsMounted()) {\n return props.children;\n }\n};\n\nexport default BrowserOnly;\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,WAAA,GAAc,CAAC,KAAA,KAA6B;AACvD,EAAA,IAAI,cAAa,EAAG;AAClB,IAAA,OAAO,KAAA,CAAM,QAAA;AAAA,EACf;AACF;;;;"}
|
|
@@ -4,6 +4,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import styles from './Button.module.scss.mjs';
|
|
5
5
|
import * as Aria from 'react-aria-components';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
7
8
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
9
|
import { IconFailed } from '../Icon/components/icons/IconFailed.mjs';
|
|
9
10
|
import { IconSucceeded } from '../Icon/components/icons/IconSucceeded.mjs';
|
|
@@ -96,15 +97,7 @@ const Button = flowComponent("Button", (props) => {
|
|
|
96
97
|
className: styles.image
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
|
-
const
|
|
100
|
-
const stateIcon = StateIconComponent && /* @__PURE__ */ jsx(
|
|
101
|
-
StateIconComponent,
|
|
102
|
-
{
|
|
103
|
-
size,
|
|
104
|
-
className: styles.stateIcon,
|
|
105
|
-
status: isFailed ? "danger" : isSucceeded ? "success" : void 0
|
|
106
|
-
}
|
|
107
|
-
);
|
|
100
|
+
const stateIcon = isSucceeded ? /* @__PURE__ */ jsx(IconSucceeded, { size, className: styles.stateIcon, color: "success" }) : isFailed ? /* @__PURE__ */ jsx(IconFailed, { size, className: styles.stateIcon, color: "danger" }) : isPending ? /* @__PURE__ */ jsx(LoadingSpinner, { size, className: styles.stateIcon }) : void 0;
|
|
108
101
|
const isStringContent = extractTextFromFirstChild(children) !== void 0;
|
|
109
102
|
return /* @__PURE__ */ jsxs(
|
|
110
103
|
Aria.Button,
|