@mittwald/flow-react-components 0.2.0-alpha.677 → 0.2.0-alpha.679
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 +4390 -4138
- package/dist/js/components/src/components/Action/ActionBatch.mjs +12 -0
- package/dist/js/components/src/components/Action/ActionBatch.mjs.map +1 -0
- package/dist/js/components/src/components/Action/models/ActionModel.mjs +15 -3
- package/dist/js/components/src/components/Action/models/ActionModel.mjs.map +1 -1
- package/dist/js/components/src/components/Action/models/getExecutionFunction.mjs +16 -8
- package/dist/js/components/src/components/Action/models/getExecutionFunction.mjs.map +1 -1
- package/dist/js/components/src/components/Autocomplete/Autocomplete.mjs +3 -0
- package/dist/js/components/src/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/js/components/src/components/ComboBox/ComboBox.mjs +3 -0
- package/dist/js/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
- package/dist/js/components/src/components/ContextMenu/ContextMenu.mjs +4 -1
- package/dist/js/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
- package/dist/js/components/src/components/ContextualHelp/ContextualHelp.mjs +3 -0
- package/dist/js/components/src/components/ContextualHelp/ContextualHelp.mjs.map +1 -1
- package/dist/js/components/src/components/DatePicker/DatePicker.mjs +3 -0
- package/dist/js/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
- package/dist/js/components/src/components/DateRangePicker/DateRangePicker.mjs +3 -0
- package/dist/js/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
- package/dist/js/components/src/components/LightBox/LightBox.mjs +3 -0
- package/dist/js/components/src/components/LightBox/LightBox.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +3 -0
- package/dist/js/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs.map +1 -1
- package/dist/js/components/src/components/Modal/Modal.mjs +1 -9
- package/dist/js/components/src/components/Modal/Modal.mjs.map +1 -1
- package/dist/js/components/src/components/Overlay/Overlay.mjs +14 -2
- package/dist/js/components/src/components/Overlay/Overlay.mjs.map +1 -1
- package/dist/js/components/src/components/OverlayTrigger/OverlayTrigger.mjs +3 -0
- package/dist/js/components/src/components/OverlayTrigger/OverlayTrigger.mjs.map +1 -1
- package/dist/js/components/src/components/Popover/Popover.mjs +4 -0
- package/dist/js/components/src/components/Popover/Popover.mjs.map +1 -1
- package/dist/js/components/src/components/Select/Select.mjs +3 -0
- package/dist/js/components/src/components/Select/Select.mjs.map +1 -1
- package/dist/js/components/src/lib/controller/overlay/OverlayController.mjs +57 -29
- package/dist/js/components/src/lib/controller/overlay/OverlayController.mjs.map +1 -1
- package/dist/js/components/src/lib/controller/overlay/useModalController.mjs +14 -0
- package/dist/js/components/src/lib/controller/overlay/useModalController.mjs.map +1 -0
- package/dist/js/components/src/lib/controller/overlay/useOverlayController.mjs +7 -15
- package/dist/js/components/src/lib/controller/overlay/useOverlayController.mjs.map +1 -1
- package/dist/js/default.mjs +2 -0
- package/dist/js/default.mjs.map +1 -1
- package/dist/js/flr-universal.mjs +2 -0
- package/dist/js/flr-universal.mjs.map +1 -1
- package/dist/types/components/Action/ActionBatch.d.ts +13 -0
- package/dist/types/components/Action/ActionBatch.d.ts.map +1 -0
- package/dist/types/components/Action/index.d.ts +1 -0
- package/dist/types/components/Action/index.d.ts.map +1 -1
- package/dist/types/components/Action/models/ActionModel.d.ts +1 -1
- package/dist/types/components/Action/models/ActionModel.d.ts.map +1 -1
- package/dist/types/components/Action/models/getExecutionFunction.d.ts.map +1 -1
- package/dist/types/components/Action/types.d.ts +3 -0
- package/dist/types/components/Action/types.d.ts.map +1 -1
- package/dist/types/components/Modal/Modal.browser.test.d.ts +2 -0
- package/dist/types/components/Modal/Modal.browser.test.d.ts.map +1 -0
- package/dist/types/components/Modal/Modal.d.ts +3 -1
- package/dist/types/components/Modal/Modal.d.ts.map +1 -1
- package/dist/types/components/Modal/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/Modal/stories/EdgeCases.stories.d.ts.map +1 -1
- package/dist/types/components/Overlay/Overlay.d.ts +5 -0
- package/dist/types/components/Overlay/Overlay.d.ts.map +1 -1
- package/dist/types/index/flr-universal.d.ts +1 -1
- package/dist/types/index/flr-universal.d.ts.map +1 -1
- package/dist/types/lib/controller/overlay/OverlayController.d.ts +17 -5
- package/dist/types/lib/controller/overlay/OverlayController.d.ts.map +1 -1
- package/dist/types/lib/controller/overlay/index.d.ts +2 -1
- package/dist/types/lib/controller/overlay/index.d.ts.map +1 -1
- package/dist/types/lib/controller/overlay/useModalController.d.ts +5 -0
- package/dist/types/lib/controller/overlay/useModalController.d.ts.map +1 -0
- package/dist/types/lib/controller/overlay/useOverlayController.d.ts +2 -3
- package/dist/types/lib/controller/overlay/useOverlayController.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Action } from './Action.mjs';
|
|
5
|
+
|
|
6
|
+
const ActionBatch = (props) => {
|
|
7
|
+
const { children } = props;
|
|
8
|
+
return /* @__PURE__ */ jsx(Action, { children });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { ActionBatch };
|
|
12
|
+
//# sourceMappingURL=ActionBatch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionBatch.mjs","sources":["../../../../../../src/components/Action/ActionBatch.tsx"],"sourcesContent":["import Action from \"@/components/Action/Action\";\nimport type { FC, PropsWithChildren } from \"react\";\n\nexport type ActionBatchProps = PropsWithChildren;\n\n/**\n * Batches multiple actions together and shows feedback when all actions have\n * completed.\n *\n * By default function actions are automatically batched. You can use this\n * component to split function actions into multiple batches with separate\n * feedback.\n */\nexport const ActionBatch: FC<ActionBatchProps> = (props) => {\n const { children } = props;\n\n return <Action>{children}</Action>;\n};\n\nexport default ActionBatch;\n"],"names":[],"mappings":";;;AAaO,MAAM,WAAA,GAAoC,CAAC,KAAA,KAAU;AAC1D,EAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AAErB,EAAA,uBAAO,GAAA,CAAC,UAAQ,QAAA,EAAS,CAAA;AAC3B;;;;"}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
import { useContext } from 'react';
|
|
4
4
|
import { OverlayController } from '../../../lib/controller/overlay/OverlayController.mjs';
|
|
5
5
|
import { useOverlayContext } from '../../../lib/controller/overlay/context.mjs';
|
|
6
|
+
import '../../../lib/propsContext/propsContext.mjs';
|
|
7
|
+
import 'remeda';
|
|
8
|
+
import '@react-aria/utils';
|
|
9
|
+
import 'dot-prop';
|
|
6
10
|
import invariant from 'invariant';
|
|
7
11
|
import { actionContext } from '../context.mjs';
|
|
8
12
|
import { ActionState } from './ActionState.mjs';
|
|
@@ -71,11 +75,19 @@ class ActionModel {
|
|
|
71
75
|
)
|
|
72
76
|
});
|
|
73
77
|
}
|
|
74
|
-
getOverlayController(
|
|
78
|
+
getOverlayController(from) {
|
|
75
79
|
const getController = (controller) => {
|
|
76
|
-
|
|
80
|
+
if (controller === void 0) {
|
|
81
|
+
return void 0;
|
|
82
|
+
}
|
|
83
|
+
if (from instanceof OverlayController) {
|
|
84
|
+
return from;
|
|
85
|
+
}
|
|
86
|
+
if (typeof from === "string") {
|
|
87
|
+
return this.overlayContext[from];
|
|
88
|
+
}
|
|
77
89
|
};
|
|
78
|
-
return getController(this.actionProps.openOverlay) ?? getController(this.actionProps.closeOverlay) ?? getController(this.actionProps.toggleOverlay);
|
|
90
|
+
return getController(this.actionProps.openOverlay) ?? getController(this.actionProps.closeOverlay) ?? getController(this.actionProps.toggleOverlay) ?? getController(this.actionProps.openModal ? "Modal" : void 0) ?? getController(this.actionProps.closeModal ? "Modal" : void 0) ?? getController(this.actionProps.toggleModal ? "Modal" : void 0);
|
|
79
91
|
}
|
|
80
92
|
execute = (...args) => {
|
|
81
93
|
new ActionExecution(this).execute(...args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionModel.mjs","sources":["../../../../../../../src/components/Action/models/ActionModel.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { OverlayController } from \"@/lib/controller\";\nimport invariant from \"invariant\";\nimport type
|
|
1
|
+
{"version":3,"file":"ActionModel.mjs","sources":["../../../../../../../src/components/Action/models/ActionModel.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { OverlayController } from \"@/lib/controller\";\nimport invariant from \"invariant\";\nimport { type ActionProps } from \"@/components/Action/types\";\nimport { actionContext } from \"@/components/Action/context\";\nimport { ActionState } from \"@/components/Action/models/ActionState\";\nimport { ActionExecution } from \"@/components/Action/models/ActionExecution\";\nimport { ActionStateContext } from \"@/components/Action/models/ActionStateContext\";\nimport type { OverlayContext } from \"@/lib/controller/overlay/context\";\nimport { useOverlayContext } from \"@/lib/controller/overlay/context\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\n\ninterface InitObject {\n actionProps: ActionProps;\n parentAction?: ActionModel;\n confirmationModalController: OverlayController;\n needsConfirmation: boolean;\n overlayContext: OverlayContext;\n state: ActionState;\n}\n\nexport class ActionModel {\n public state: ActionState;\n public needsConfirmation: boolean;\n public readonly actionProps: ActionProps;\n public readonly parentAction?: ActionModel;\n public readonly confirmationModalController: OverlayController;\n public readonly overlayContext: OverlayContext;\n\n private constructor(init: InitObject) {\n const {\n actionProps,\n needsConfirmation,\n parentAction,\n overlayContext,\n confirmationModalController,\n state,\n } = init;\n\n this.actionProps = actionProps;\n this.parentAction = parentAction;\n this.confirmationModalController = confirmationModalController;\n this.needsConfirmation = needsConfirmation;\n this.overlayContext = overlayContext;\n this.state = state;\n }\n\n public static useNew(\n actionProps: ActionProps,\n init: Partial<InitObject> = {},\n ): ActionModel {\n const parentAction = useContext(actionContext);\n const overlayContext = useOverlayContext();\n const confirmationModalController = OverlayController.useNew();\n const state = ActionState.useNew();\n\n return new ActionModel({\n parentAction,\n overlayContext,\n confirmationModalController,\n needsConfirmation: false,\n actionProps,\n state,\n ...init,\n });\n }\n\n public static use(): ActionModel {\n const c = useContext(actionContext);\n invariant(!!c, \"Action context is not defined\");\n ActionStateContext.useRegisterState(c.state);\n return c;\n }\n\n public static useConfirmationAction(): ActionModel {\n const action = ActionModel.use();\n\n return new ActionModel({\n actionProps: action.actionProps,\n confirmationModalController: action.confirmationModalController,\n overlayContext: action.overlayContext,\n state: action.state,\n needsConfirmation: false,\n parentAction: ActionModel.useNew(\n {\n closeOverlay: action.confirmationModalController,\n },\n {\n parentAction: action.parentAction,\n },\n ),\n });\n }\n\n public getOverlayController(\n from: FlowComponentName | OverlayController,\n ): OverlayController | undefined {\n const getController = (\n controller?: OverlayController | FlowComponentName,\n ): OverlayController | undefined => {\n if (controller === undefined) {\n return undefined;\n }\n if (from instanceof OverlayController) {\n return from;\n }\n if (typeof from === \"string\") {\n return this.overlayContext[from];\n }\n };\n\n return (\n getController(this.actionProps.openOverlay) ??\n getController(this.actionProps.closeOverlay) ??\n getController(this.actionProps.toggleOverlay) ??\n getController(this.actionProps.openModal ? \"Modal\" : undefined) ??\n getController(this.actionProps.closeModal ? \"Modal\" : undefined) ??\n getController(this.actionProps.toggleModal ? \"Modal\" : undefined)\n );\n }\n\n public execute = (...args: unknown[]): void => {\n new ActionExecution(this).execute(...args);\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAqBO,MAAM,WAAA,CAAY;AAAA,EAChB,KAAA;AAAA,EACA,iBAAA;AAAA,EACS,WAAA;AAAA,EACA,YAAA;AAAA,EACA,2BAAA;AAAA,EACA,cAAA;AAAA,EAER,YAAY,IAAA,EAAkB;AACpC,IAAA,MAAM;AAAA,MACJ,WAAA;AAAA,MACA,iBAAA;AAAA,MACA,YAAA;AAAA,MACA,cAAA;AAAA,MACA,2BAAA;AAAA,MACA;AAAA,KACF,GAAI,IAAA;AAEJ,IAAA,IAAA,CAAK,WAAA,GAAc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
|
+
import '@react-aria/live-announcer';
|
|
8
|
+
|
|
3
9
|
const voidAction = () => {
|
|
4
10
|
};
|
|
5
11
|
function getExecutionFunction(action) {
|
|
6
12
|
if (action.needsConfirmation) {
|
|
7
13
|
return action.confirmationModalController.open;
|
|
8
14
|
}
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const {
|
|
16
|
+
onAction,
|
|
17
|
+
toggleOverlay,
|
|
18
|
+
closeOverlay,
|
|
19
|
+
openOverlay,
|
|
20
|
+
openModal,
|
|
21
|
+
closeModal,
|
|
22
|
+
toggleModal
|
|
23
|
+
} = action.actionProps;
|
|
24
|
+
const maybeAction = onAction ? onAction : openOverlay ? () => action.getOverlayController(openOverlay)?.open() : closeOverlay ? () => action.getOverlayController(closeOverlay)?.close() : toggleOverlay ? () => action.getOverlayController(toggleOverlay)?.toggle() : openModal ? () => action.getOverlayController("Modal")?.open() : toggleModal ? () => action.getOverlayController("Modal")?.toggle() : closeModal ? () => action.getOverlayController("Modal")?.close() : voidAction;
|
|
17
25
|
return maybeAction ?? voidAction;
|
|
18
26
|
}
|
|
19
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExecutionFunction.mjs","sources":["../../../../../../../src/components/Action/models/getExecutionFunction.ts"],"sourcesContent":["import type { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport type
|
|
1
|
+
{"version":3,"file":"getExecutionFunction.mjs","sources":["../../../../../../../src/components/Action/models/getExecutionFunction.ts"],"sourcesContent":["import type { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport { type ActionFn } from \"@/components/Action\";\n\nconst voidAction = () => {\n // do nothing\n};\n\nexport function getExecutionFunction(action: ActionModel): ActionFn {\n if (action.needsConfirmation) {\n return action.confirmationModalController.open;\n }\n\n const {\n onAction,\n toggleOverlay,\n closeOverlay,\n openOverlay,\n openModal,\n closeModal,\n toggleModal,\n } = action.actionProps;\n\n const maybeAction = onAction\n ? onAction\n : openOverlay\n ? () => action.getOverlayController(openOverlay)?.open()\n : closeOverlay\n ? () => action.getOverlayController(closeOverlay)?.close()\n : toggleOverlay\n ? () => action.getOverlayController(toggleOverlay)?.toggle()\n : openModal\n ? () => action.getOverlayController(\"Modal\")?.open()\n : toggleModal\n ? () => action.getOverlayController(\"Modal\")?.toggle()\n : closeModal\n ? () => action.getOverlayController(\"Modal\")?.close()\n : voidAction;\n\n return maybeAction ?? voidAction;\n}\n"],"names":[],"mappings":";;;;;;AAGA,MAAM,aAAa,MAAM;AAEzB,CAAA;AAEO,SAAS,qBAAqB,MAAA,EAA+B;AAClE,EAAA,IAAI,OAAO,iBAAA,EAAmB;AAC5B,IAAA,OAAO,OAAO,2BAAA,CAA4B,IAAA;AAAA,EAC5C;AAEA,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,aAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,MACE,MAAA,CAAO,WAAA;AAEX,EAAA,MAAM,WAAA,GAAc,WAChB,QAAA,GACA,WAAA,GACE,MAAM,MAAA,CAAO,oBAAA,CAAqB,WAAW,CAAA,EAAG,IAAA,EAAK,GACrD,eACE,MAAM,MAAA,CAAO,oBAAA,CAAqB,YAAY,CAAA,EAAG,KAAA,KACjD,aAAA,GACE,MAAM,MAAA,CAAO,oBAAA,CAAqB,aAAa,CAAA,EAAG,QAAO,GACzD,SAAA,GACE,MAAM,MAAA,CAAO,oBAAA,CAAqB,OAAO,CAAA,EAAG,IAAA,EAAK,GACjD,WAAA,GACE,MAAM,MAAA,CAAO,qBAAqB,OAAO,CAAA,EAAG,MAAA,EAAO,GACnD,UAAA,GACE,MAAM,OAAO,oBAAA,CAAqB,OAAO,CAAA,EAAG,KAAA,EAAM,GAClD,UAAA;AAEhB,EAAA,OAAO,WAAA,IAAe,UAAA;AACxB;;;;"}
|
|
@@ -7,6 +7,9 @@ import { PropsContextProvider } from '../../lib/propsContext/components/PropsCon
|
|
|
7
7
|
import * as Aria from 'react-aria-components';
|
|
8
8
|
import 'mobx';
|
|
9
9
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
10
|
+
import 'remeda';
|
|
11
|
+
import '@react-aria/utils';
|
|
12
|
+
import 'dot-prop';
|
|
10
13
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
11
14
|
import { Options } from '../Options/Options.mjs';
|
|
12
15
|
import { TunnelExit } from '@mittwald/react-tunnel';
|
|
@@ -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 { TunnelExit } from \"@mittwald/react-tunnel\";\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\";\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);\n\n const propsContext: PropsContext = {\n SearchField: inputProps,\n TextField: inputProps,\n Option: {\n tunnelId: \"options\",\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 <TunnelExit id=\"options\" />\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 { TunnelExit } from \"@mittwald/react-tunnel\";\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\";\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);\n\n const propsContext: PropsContext = {\n SearchField: inputProps,\n TextField: inputProps,\n Option: {\n tunnelId: \"options\",\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 <TunnelExit id=\"options\" />\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,a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,IAAA;AAAA,YAEH,QAAA,EAAA;AAAA,cAAA,QAAA;AAAA,8BACD,GAAA;AAAA,gBAAC,OAAA;AAAA,gBAAA;AAAA,kBACC,QAAA,EAAU,kBAAA;AAAA,kBACV,UAAA,EAAY,QAAA;AAAA,kBACZ,UAAA,EAAY,wBAAA;AAAA,kBACZ,gBAAA;AAAA,kBACA,UAAA,EAAU,IAAA;AAAA,kBACV,SAAA,EAAU,cAAA;AAAA,kBAEV,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAG,SAAA,EAAU;AAAA;AAAA;AAC3B;AAAA;AAAA,WAEJ,CAAA,EACF;AAAA;AAAA,KACF,EACF,CAAA;AAAA,wBACC,cAAA,EAAA,EAAe;AAAA,GAAA,EAClB,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -19,6 +19,9 @@ import { useLocalizedStringFormatter } from 'react-aria';
|
|
|
19
19
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
20
20
|
import 'mobx';
|
|
21
21
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
22
|
+
import 'remeda';
|
|
23
|
+
import '@react-aria/utils';
|
|
24
|
+
import 'dot-prop';
|
|
22
25
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
23
26
|
|
|
24
27
|
const ComboBox = flowComponent("ComboBox", (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.mjs","sources":["../../../../../../src/components/ComboBox/ComboBox.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Options } from \"@/components/Options\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./ComboBox.module.scss\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface ComboBoxProps\n extends\n Omit<Aria.ComboBoxProps<never>, \"children\">,\n Pick<Aria.InputProps, \"placeholder\">,\n Pick<OptionsProps, \"renderEmptyState\">,\n PropsWithChildren,\n FlowComponentProps<HTMLInputElement> {\n onChange?: (value: string) => void;\n}\n\n/** @flr-generate all */\nexport const ComboBox = flowComponent(\"ComboBox\", (props) => {\n const {\n children,\n className,\n menuTrigger = \"focus\",\n onChange,\n onSelectionChange,\n placeholder,\n ref,\n renderEmptyState,\n ...rest\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const rootClassName = clsx(fieldProps.className, styles.comboBox, className);\n\n const propsContext: PropsContext = {\n Option: {\n tunnelId: \"options\",\n },\n ...fieldPropsContext,\n };\n\n const handleSelectionChange = (key: Key | null) => {\n if (key === null) {\n return;\n }\n onChange?.(String(key));\n onSelectionChange?.(key);\n };\n\n const controller = useOverlayController(\"ComboBox\", {\n reuseControllerFromContext: false,\n });\n\n return (\n <Aria.ComboBox\n {...fieldProps}\n menuTrigger={menuTrigger}\n className={rootClassName}\n {...rest}\n onSelectionChange={handleSelectionChange}\n onOpenChange={(isOpen) => {\n controller.setOpen(isOpen);\n }}\n >\n <PropsContextProvider props={propsContext}>\n <TunnelProvider>\n <FieldErrorCaptureContext>\n <div className={styles.input}>\n <Aria.Input placeholder={placeholder} ref={ref} />\n <Button\n className={styles.toggle}\n aria-label={stringFormatter.format(\"comboBox.showOptions\")}\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconChevronDown />\n </Button>\n </div>\n\n {children}\n\n <Options\n controller={controller}\n onOpenChange={() => {\n // cut-off to avoid double controller state changes\n }}\n renderEmptyState={renderEmptyState}\n >\n <TunnelExit id=\"options\" />\n </Options>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </TunnelProvider>\n </PropsContextProvider>\n </Aria.ComboBox>\n );\n});\n\nexport default ComboBox;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ComboBox.mjs","sources":["../../../../../../src/components/ComboBox/ComboBox.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Options } from \"@/components/Options\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./ComboBox.module.scss\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface ComboBoxProps\n extends\n Omit<Aria.ComboBoxProps<never>, \"children\">,\n Pick<Aria.InputProps, \"placeholder\">,\n Pick<OptionsProps, \"renderEmptyState\">,\n PropsWithChildren,\n FlowComponentProps<HTMLInputElement> {\n onChange?: (value: string) => void;\n}\n\n/** @flr-generate all */\nexport const ComboBox = flowComponent(\"ComboBox\", (props) => {\n const {\n children,\n className,\n menuTrigger = \"focus\",\n onChange,\n onSelectionChange,\n placeholder,\n ref,\n renderEmptyState,\n ...rest\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const rootClassName = clsx(fieldProps.className, styles.comboBox, className);\n\n const propsContext: PropsContext = {\n Option: {\n tunnelId: \"options\",\n },\n ...fieldPropsContext,\n };\n\n const handleSelectionChange = (key: Key | null) => {\n if (key === null) {\n return;\n }\n onChange?.(String(key));\n onSelectionChange?.(key);\n };\n\n const controller = useOverlayController(\"ComboBox\", {\n reuseControllerFromContext: false,\n });\n\n return (\n <Aria.ComboBox\n {...fieldProps}\n menuTrigger={menuTrigger}\n className={rootClassName}\n {...rest}\n onSelectionChange={handleSelectionChange}\n onOpenChange={(isOpen) => {\n controller.setOpen(isOpen);\n }}\n >\n <PropsContextProvider props={propsContext}>\n <TunnelProvider>\n <FieldErrorCaptureContext>\n <div className={styles.input}>\n <Aria.Input placeholder={placeholder} ref={ref} />\n <Button\n className={styles.toggle}\n aria-label={stringFormatter.format(\"comboBox.showOptions\")}\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconChevronDown />\n </Button>\n </div>\n\n {children}\n\n <Options\n controller={controller}\n onOpenChange={() => {\n // cut-off to avoid double controller state changes\n }}\n renderEmptyState={renderEmptyState}\n >\n <TunnelExit id=\"options\" />\n </Options>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </TunnelProvider>\n </PropsContextProvider>\n </Aria.ComboBox>\n );\n});\n\nexport default ComboBox;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAM,QAAA,GAAW,aAAA,CAAc,UAAA,EAAY,CAAC,KAAA,KAAU;AAC3D,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA,GAAc,OAAA;AAAA,IACd,QAAA;AAAA,IACA,iBAAA;AAAA,IACA,WAAA;AAAA,IACA,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,EAAA;AAAA,0BAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,KAAA,EACrB,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,CAAK,KAAA,EAAL,EAAW,WAAA,EAA0B,GAAA,EAAU,CAAA;AAAA,4BAChD,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,WAAW,MAAA,CAAO,MAAA;AAAA,gBAClB,YAAA,EAAY,eAAA,CAAgB,MAAA,CAAO,sBAAsB,CAAA;AAAA,gBACzD,OAAA,EAAQ,OAAA;AAAA,gBACR,KAAA,EAAM,WAAA;AAAA,gBAEN,8BAAC,eAAA,EAAA,EAAgB;AAAA;AAAA;AACnB,WAAA,EACF,CAAA;AAAA,UAEC,QAAA;AAAA,0BAED,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,UAAA;AAAA,cACA,cAAc,MAAM;AAAA,cAEpB,CAAA;AAAA,cACA,gBAAA;AAAA,cAEA,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAG,SAAA,EAAU;AAAA;AAAA;AAC3B,SAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB,CAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -10,8 +10,11 @@ import { Popover } from '../Popover/Popover.mjs';
|
|
|
10
10
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
11
11
|
import 'mobx';
|
|
12
12
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
13
|
-
import { OverlayContextProvider } from '../../lib/controller/overlay/OverlayContextProvider.mjs';
|
|
14
13
|
import '../../lib/propsContext/propsContext.mjs';
|
|
14
|
+
import 'remeda';
|
|
15
|
+
import '@react-aria/utils';
|
|
16
|
+
import 'dot-prop';
|
|
17
|
+
import { OverlayContextProvider } from '../../lib/controller/overlay/OverlayContextProvider.mjs';
|
|
15
18
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
16
19
|
import ContextMenuContentView from '../../views/ContextMenuContentView.mjs';
|
|
17
20
|
import styles from './ContextMenu.module.scss.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.mjs","sources":["../../../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import { Action } from \"@/components/Action\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\nimport {\n getAriaSelectionMode,\n getCloseOverlayType,\n getMenuItemSelectionVariant,\n} from \"@/components/ContextMenu/lib\";\nimport type { MenuItemProps } from \"@/components/MenuItem\";\nimport { Popover, type PopoverProps } from \"@/components/Popover/Popover\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport { OverlayContextProvider } from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport ContextMenuContentView from \"@/views/ContextMenuContentView\";\nimport type * as Aria from \"react-aria-components\";\nimport styles from \"./ContextMenu.module.scss\";\n\nexport interface ContextMenuProps\n extends\n Omit<PopoverProps, \"withTip\">,\n Pick<\n Aria.MenuProps<MenuItemProps>,\n | \"onAction\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"disabledKeys\"\n | \"renderEmptyState\"\n >,\n FlowComponentProps {\n /** The type of selection that is allowed in the context menu. */\n selectionMode?: ContextMenuSelectionMode;\n /** Sets the context menu to a fixed width. */\n width?: string | number;\n}\n\n/** @flr-generate all */\nexport const ContextMenu = flowComponent(\"ContextMenu\", (props) => {\n const {\n children,\n onAction,\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n renderEmptyState,\n ref,\n controller: overlayControllerFromProps,\n ...rest\n } = props;\n\n const overlayControllerFromContext = useOverlayController(\"ContextMenu\", {\n reuseControllerFromContext: true,\n });\n\n const overlayController =\n overlayControllerFromProps ?? overlayControllerFromContext;\n\n const selectionVariant = getMenuItemSelectionVariant(selectionMode);\n\n const propsContext: PropsContext = {\n MenuItem: {\n selectionVariant,\n Avatar: {\n size: \"l\",\n },\n },\n\n Section: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n renderContextMenuSection: true,\n },\n\n ContextMenuSection: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n },\n };\n\n return (\n <Popover\n {...rest}\n className={styles.popover}\n controller={overlayController}\n isDialogContent={false}\n >\n <OverlayContextProvider type=\"ContextMenu\" controller={overlayController}>\n <ContextMenuContentView\n className={styles.contextMenu}\n onAction={onAction}\n selectionMode={getAriaSelectionMode(selectionMode)}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n disabledKeys={disabledKeys}\n onSelectionChange={onSelectionChange}\n renderEmptyState={renderEmptyState}\n ref={ref}\n >\n <PropsContextProvider props={propsContext}>\n <Action closeOverlay={getCloseOverlayType(selectionMode)}>\n {children}\n </Action>\n </PropsContextProvider>\n </ContextMenuContentView>\n </OverlayContextProvider>\n </Popover>\n );\n});\n\nexport default ContextMenu;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextMenu.mjs","sources":["../../../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import { Action } from \"@/components/Action\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\nimport {\n getAriaSelectionMode,\n getCloseOverlayType,\n getMenuItemSelectionVariant,\n} from \"@/components/ContextMenu/lib\";\nimport type { MenuItemProps } from \"@/components/MenuItem\";\nimport { Popover, type PopoverProps } from \"@/components/Popover/Popover\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport { OverlayContextProvider } from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport ContextMenuContentView from \"@/views/ContextMenuContentView\";\nimport type * as Aria from \"react-aria-components\";\nimport styles from \"./ContextMenu.module.scss\";\n\nexport interface ContextMenuProps\n extends\n Omit<PopoverProps, \"withTip\">,\n Pick<\n Aria.MenuProps<MenuItemProps>,\n | \"onAction\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"disabledKeys\"\n | \"renderEmptyState\"\n >,\n FlowComponentProps {\n /** The type of selection that is allowed in the context menu. */\n selectionMode?: ContextMenuSelectionMode;\n /** Sets the context menu to a fixed width. */\n width?: string | number;\n}\n\n/** @flr-generate all */\nexport const ContextMenu = flowComponent(\"ContextMenu\", (props) => {\n const {\n children,\n onAction,\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n renderEmptyState,\n ref,\n controller: overlayControllerFromProps,\n ...rest\n } = props;\n\n const overlayControllerFromContext = useOverlayController(\"ContextMenu\", {\n reuseControllerFromContext: true,\n });\n\n const overlayController =\n overlayControllerFromProps ?? overlayControllerFromContext;\n\n const selectionVariant = getMenuItemSelectionVariant(selectionMode);\n\n const propsContext: PropsContext = {\n MenuItem: {\n selectionVariant,\n Avatar: {\n size: \"l\",\n },\n },\n\n Section: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n renderContextMenuSection: true,\n },\n\n ContextMenuSection: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n },\n };\n\n return (\n <Popover\n {...rest}\n className={styles.popover}\n controller={overlayController}\n isDialogContent={false}\n >\n <OverlayContextProvider type=\"ContextMenu\" controller={overlayController}>\n <ContextMenuContentView\n className={styles.contextMenu}\n onAction={onAction}\n selectionMode={getAriaSelectionMode(selectionMode)}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n disabledKeys={disabledKeys}\n onSelectionChange={onSelectionChange}\n renderEmptyState={renderEmptyState}\n ref={ref}\n >\n <PropsContextProvider props={propsContext}>\n <Action closeOverlay={getCloseOverlayType(selectionMode)}>\n {children}\n </Action>\n </PropsContextProvider>\n </ContextMenuContentView>\n </OverlayContextProvider>\n </Popover>\n );\n});\n\nexport default ContextMenu;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAuCO,MAAM,WAAA,GAAc,aAAA,CAAc,aAAA,EAAe,CAAC,KAAA,KAAU;AACjE,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,QAAA;AAAA,IACA,aAAA;AAAA,IACA,YAAA;AAAA,IACA,mBAAA;AAAA,IACA,YAAA;AAAA,IACA,iBAAA;AAAA,IACA,gBAAA;AAAA,IACA,GAAA;AAAA,IACA,UAAA,EAAY,0BAAA;AAAA,IACZ,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,4BAAA,GAA+B,qBAAqB,aAAA,EAAe;AAAA,IACvE,0BAAA,EAA4B;AAAA,GAC7B,CAAA;AAED,EAAA,MAAM,oBACJ,0BAAA,IAA8B,4BAAA;AAEhC,EAAA,MAAM,gBAAA,GAAmB,4BAA4B,aAAa,CAAA;AAElE,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,QAAA,EAAU;AAAA,MACR,gBAAA;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IAEA,OAAA,EAAS;AAAA,MACP,QAAA,EAAU;AAAA,QACR,MAAA,EAAQ;AAAA,UACN,IAAA,EAAM;AAAA;AACR,OACF;AAAA,MACA,wBAAA,EAA0B;AAAA,KAC5B;AAAA,IAEA,kBAAA,EAAoB;AAAA,MAClB,QAAA,EAAU;AAAA,QACR,MAAA,EAAQ;AAAA,UACN,IAAA,EAAM;AAAA;AACR;AACF;AACF,GACF;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,UAAA,EAAY,iBAAA;AAAA,MACZ,eAAA,EAAiB,KAAA;AAAA,MAEjB,QAAA,kBAAA,GAAA,CAAC,sBAAA,EAAA,EAAuB,IAAA,EAAK,aAAA,EAAc,YAAY,iBAAA,EACrD,QAAA,kBAAA,GAAA;AAAA,QAAC,sBAAA;AAAA,QAAA;AAAA,UACC,WAAW,MAAA,CAAO,WAAA;AAAA,UAClB,QAAA;AAAA,UACA,aAAA,EAAe,qBAAqB,aAAa,CAAA;AAAA,UACjD,YAAA;AAAA,UACA,mBAAA;AAAA,UACA,YAAA;AAAA,UACA,iBAAA;AAAA,UACA,gBAAA;AAAA,UACA,GAAA;AAAA,UAEA,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,YAAA,EAAc,mBAAA,CAAoB,aAAa,CAAA,EACpD,QAAA,EACH,CAAA,EACF;AAAA;AAAA,OACF,EACF;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -9,6 +9,9 @@ import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
|
9
9
|
import 'mobx';
|
|
10
10
|
import 'react';
|
|
11
11
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
12
|
+
import 'remeda';
|
|
13
|
+
import '@react-aria/utils';
|
|
14
|
+
import 'dot-prop';
|
|
12
15
|
|
|
13
16
|
const ContextualHelp = flowComponent("ContextualHelp", (props) => {
|
|
14
17
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextualHelp.mjs","sources":["../../../../../../src/components/ContextualHelp/ContextualHelp.tsx"],"sourcesContent":["import type { PopoverProps } from \"@/components/Popover/Popover\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport styles from \"./ContextualHelp.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\n\nexport type ContextualHelpProps = Omit<PopoverProps, \"withTip\">;\n\n/** @flr-generate all */\nexport const ContextualHelp = flowComponent(\"ContextualHelp\", (props) => {\n const {\n children,\n controller: controllerFromProps,\n ref: ignoredRef,\n ...rest\n } = props;\n\n const controllerFromContext = useOverlayController(\"ContextualHelp\", {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const propsContext: PropsContext = {\n Heading: {\n level: 5,\n },\n };\n\n return (\n <Popover withTip {...rest} controller={controller}>\n <PropsContextProvider props={propsContext}>\n <div className={styles.contextualHelp}>{children}</div>\n </PropsContextProvider>\n </Popover>\n );\n});\n\nexport default ContextualHelp;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextualHelp.mjs","sources":["../../../../../../src/components/ContextualHelp/ContextualHelp.tsx"],"sourcesContent":["import type { PopoverProps } from \"@/components/Popover/Popover\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport styles from \"./ContextualHelp.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\n\nexport type ContextualHelpProps = Omit<PopoverProps, \"withTip\">;\n\n/** @flr-generate all */\nexport const ContextualHelp = flowComponent(\"ContextualHelp\", (props) => {\n const {\n children,\n controller: controllerFromProps,\n ref: ignoredRef,\n ...rest\n } = props;\n\n const controllerFromContext = useOverlayController(\"ContextualHelp\", {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const propsContext: PropsContext = {\n Heading: {\n level: 5,\n },\n };\n\n return (\n <Popover withTip {...rest} controller={controller}>\n <PropsContextProvider props={propsContext}>\n <div className={styles.contextualHelp}>{children}</div>\n </PropsContextProvider>\n </Popover>\n );\n});\n\nexport default ContextualHelp;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAWO,MAAM,cAAA,GAAiB,aAAA,CAAc,gBAAA,EAAkB,CAAC,KAAA,KAAU;AACvE,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,UAAA,EAAY,mBAAA;AAAA,IACZ,GAAA,EAAK,UAAA;AAAA,IACL,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,qBAAA,GAAwB,qBAAqB,gBAAA,EAAkB;AAAA,IACnE,0BAAA,EAA4B;AAAA,GAC7B,CAAA;AAED,EAAA,MAAM,aAAa,mBAAA,IAAuB,qBAAA;AAE1C,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,OAAA,EAAS;AAAA,MACP,KAAA,EAAO;AAAA;AACT,GACF;AAEA,EAAA,2BACG,OAAA,EAAA,EAAQ,OAAA,EAAO,MAAE,GAAG,IAAA,EAAM,YACzB,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAO,cAAA,EAAiB,QAAA,EAAS,GACnD,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -11,6 +11,9 @@ import formFieldStyles from '../FormField/FormField.module.scss.mjs';
|
|
|
11
11
|
import { Popover } from '../Popover/Popover.mjs';
|
|
12
12
|
import 'mobx';
|
|
13
13
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
14
|
+
import 'remeda';
|
|
15
|
+
import '@react-aria/utils';
|
|
16
|
+
import 'dot-prop';
|
|
14
17
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
15
18
|
import { Calendar } from '../Calendar/Calendar.mjs';
|
|
16
19
|
import '../Button/Button.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.mjs","sources":["../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport styles from \"../FormField/FormField.module.scss\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { Calendar } from \"@/components/Calendar\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface DatePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DatePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DatePicker = flowComponent(\"DatePicker\", (props) => {\n const { children, className, onChange, ref, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(styles.formField, className);\n\n const popoverController = useOverlayController(\"Popover\");\n\n return (\n <Aria.DatePicker\n {...rest}\n {...fieldProps}\n className={clsx(fieldProps.className, rootClassName)}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <Calendar />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DatePicker>\n );\n});\n\nexport default DatePicker;\n"],"names":["styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePicker.mjs","sources":["../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport styles from \"../FormField/FormField.module.scss\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { Calendar } from \"@/components/Calendar\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface DatePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DatePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DatePicker = flowComponent(\"DatePicker\", (props) => {\n const { children, className, onChange, ref, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(styles.formField, className);\n\n const popoverController = useOverlayController(\"Popover\");\n\n return (\n <Aria.DatePicker\n {...rest}\n {...fieldProps}\n className={clsx(fieldProps.className, rootClassName)}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <Calendar />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DatePicker>\n );\n});\n\nexport default DatePicker;\n"],"names":["styles"],"mappings":";;;;;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cACC,SAAA,EAAU,YAAA;AAAA,cACV,eAAA,EAAe,IAAA;AAAA,cACf,UAAA,EAAY,iBAAA;AAAA,cAEZ,8BAAC,QAAA,EAAA,EAAS;AAAA;AAAA;AACZ,SAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,GAClB;AAEJ,CAAC;;;;"}
|
|
@@ -11,6 +11,9 @@ import { DateRangeInput } from './components/DateRangeInput/DateRangeInput.mjs';
|
|
|
11
11
|
import 'mobx';
|
|
12
12
|
import 'react';
|
|
13
13
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
14
|
+
import 'remeda';
|
|
15
|
+
import '@react-aria/utils';
|
|
16
|
+
import 'dot-prop';
|
|
14
17
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
15
18
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
16
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.mjs","sources":["../../../../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { RangeCalendar } from \"../Calendar/RangeCalendar\";\nimport { DateRangeInput } from \"./components/DateRangeInput\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface DateRangePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DateRangePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DateRangePicker = flowComponent(\"DateRangePicker\", (props) => {\n const { children, className, onChange, ref, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const popoverController = useOverlayController(\"Popover\");\n\n return (\n <Aria.DateRangePicker\n {...rest}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateRangeInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <RangeCalendar />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DateRangePicker>\n );\n});\n\nexport default DateRangePicker;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateRangePicker.mjs","sources":["../../../../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { RangeCalendar } from \"../Calendar/RangeCalendar\";\nimport { DateRangeInput } from \"./components/DateRangeInput\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface DateRangePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DateRangePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DateRangePicker = flowComponent(\"DateRangePicker\", (props) => {\n const { children, className, onChange, ref, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const popoverController = useOverlayController(\"Popover\");\n\n return (\n <Aria.DateRangePicker\n {...rest}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateRangeInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <RangeCalendar />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DateRangePicker>\n );\n});\n\nexport default DateRangePicker;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAoBO,MAAM,eAAA,GAAkB,aAAA,CAAc,iBAAA,EAAmB,CAAC,KAAA,KAAU;AACzE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,UAAU,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAExD,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,UAAA,CAAW,SAAA,EAAW,SAAS,CAAA;AAE1D,EAAA,MAAM,iBAAA,GAAoB,qBAAqB,SAAS,CAAA;AAExD,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA,CAAK,eAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,aAAA;AAAA,MACX,YAAA,EAAc,CAAC,CAAA,KAAM,iBAAA,CAAkB,QAAQ,CAAC,CAAA;AAAA,MAChD,QAAQ,iBAAA,CAAkB,MAAA;AAAA,MAC1B,QAAA,EAAU,CAAC,KAAA,KAAU;AACnB,QAAA,IAAI,QAAA,EAAU;AACZ,UAAA,QAAA,CAAS,KAAK,CAAA;AAAA,QAChB;AACA,QAAA,iBAAA,CAAkB,KAAA,EAAM;AAAA,MAC1B,CAAA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,wBAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,cAAA,EAAA,EAAe,UAAA,EAAY,KAAA,CAAM,UAAA,EAAY,GAAA,EAAU,CAAA;AAAA,0BACxD,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,iBAAA,EAC1B,QAAA,EACH,CAAA;AAAA,0BACA,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAU,YAAA;AAAA,cACV,eAAA,EAAe,IAAA;AAAA,cACf,UAAA,EAAY,iBAAA;AAAA,cAEZ,8BAAC,aAAA,EAAA,EAAc;AAAA;AAAA;AACjB,SAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,GAClB;AAEJ,CAAC;;;;"}
|
|
@@ -8,6 +8,9 @@ import 'mobx';
|
|
|
8
8
|
import 'react';
|
|
9
9
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
10
10
|
import '../../lib/propsContext/propsContext.mjs';
|
|
11
|
+
import 'remeda';
|
|
12
|
+
import '@react-aria/utils';
|
|
13
|
+
import 'dot-prop';
|
|
11
14
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
12
15
|
import '@tabler/icons-react';
|
|
13
16
|
import '../Icon/Icon.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightBox.mjs","sources":["../../../../../../src/components/LightBox/LightBox.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { Overlay } from \"@/components/Overlay/Overlay\";\nimport clsx from \"clsx\";\nimport type { OverlayController } from \"@/lib/controller\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport styles from \"./LightBox.module.scss\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport DivView from \"@/views/DivView\";\nimport ButtonView from \"@/views/ButtonView\";\n\nexport interface LightBoxProps\n extends PropsWithChildren, FlowComponentProps, PropsWithClassName {\n /** An overlay controller to control the light box state. */\n controller?: OverlayController;\n /**\n * Whether content can be displayed larger than the available space in the\n * screen. @default true\n */\n fitScreen?: boolean;\n}\n\nexport const LightBox = flowComponent(\"LightBox\", (props) => {\n const {\n controller: controllerFromProps,\n children,\n ref: ignoredRef,\n className,\n fitScreen = true,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.lightBox,\n fitScreen && styles.fitScreen,\n className,\n );\n\n const propsContext: PropsContext = {\n ActionGroup: {\n className: styles.actionGroup,\n Button: { variant: \"solid\", color: \"light\" },\n tunnelId: \"actionGroup\",\n },\n };\n\n const controllerFromContext = useOverlayController(\"LightBox\", {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n return (\n <Overlay\n overlayType=\"LightBox\"\n className={rootClassName}\n controller={controller}\n {...rest}\n >\n <PropsContextProvider props={propsContext}>\n <TunnelProvider>\n <DivView className={styles.content}>{children}</DivView>\n <DivView className={styles.actions}>\n <ButtonView\n color=\"light\"\n variant=\"solid\"\n onPress={controller.close}\n >\n <IconClose />\n </ButtonView>\n <TunnelExit id=\"actionGroup\" />\n </DivView>\n </TunnelProvider>\n </PropsContextProvider>\n </Overlay>\n );\n});\n\nexport default LightBox;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LightBox.mjs","sources":["../../../../../../src/components/LightBox/LightBox.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { Overlay } from \"@/components/Overlay/Overlay\";\nimport clsx from \"clsx\";\nimport type { OverlayController } from \"@/lib/controller\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport styles from \"./LightBox.module.scss\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport DivView from \"@/views/DivView\";\nimport ButtonView from \"@/views/ButtonView\";\n\nexport interface LightBoxProps\n extends PropsWithChildren, FlowComponentProps, PropsWithClassName {\n /** An overlay controller to control the light box state. */\n controller?: OverlayController;\n /**\n * Whether content can be displayed larger than the available space in the\n * screen. @default true\n */\n fitScreen?: boolean;\n}\n\nexport const LightBox = flowComponent(\"LightBox\", (props) => {\n const {\n controller: controllerFromProps,\n children,\n ref: ignoredRef,\n className,\n fitScreen = true,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.lightBox,\n fitScreen && styles.fitScreen,\n className,\n );\n\n const propsContext: PropsContext = {\n ActionGroup: {\n className: styles.actionGroup,\n Button: { variant: \"solid\", color: \"light\" },\n tunnelId: \"actionGroup\",\n },\n };\n\n const controllerFromContext = useOverlayController(\"LightBox\", {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n return (\n <Overlay\n overlayType=\"LightBox\"\n className={rootClassName}\n controller={controller}\n {...rest}\n >\n <PropsContextProvider props={propsContext}>\n <TunnelProvider>\n <DivView className={styles.content}>{children}</DivView>\n <DivView className={styles.actions}>\n <ButtonView\n color=\"light\"\n variant=\"solid\"\n onPress={controller.close}\n >\n <IconClose />\n </ButtonView>\n <TunnelExit id=\"actionG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IAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAW,MAAA,CAAO,OAAA,EACzB,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,KAAA,EAAM,OAAA;AAAA,cACN,OAAA,EAAQ,OAAA;AAAA,cACR,SAAS,UAAA,CAAW,KAAA;AAAA,cAEpB,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA,WACb;AAAA,0BACA,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAG,aAAA,EAAc;AAAA,SAAA,EAC/B;AAAA,OAAA,EACF,CAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -35,6 +35,9 @@ import TextView from '../../../../../../views/TextView.mjs';
|
|
|
35
35
|
import { SortingAccordion } from './SortingAccordion.mjs';
|
|
36
36
|
import ActionGroupView from '../../../../../../views/ActionGroupView.mjs';
|
|
37
37
|
import { useOverlayController } from '../../../../../../lib/controller/overlay/useOverlayController.mjs';
|
|
38
|
+
import 'remeda';
|
|
39
|
+
import '@react-aria/utils';
|
|
40
|
+
import 'dot-prop';
|
|
38
41
|
import HeadingView from '../../../../../../views/HeadingView.mjs';
|
|
39
42
|
import { ModalTrigger } from '../../../../../Modal/components/ModalTrigger/ModalTrigger.mjs';
|
|
40
43
|
import { Modal } from '../../../../../Modal/Modal.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllFiltersModal.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport { IconFilter } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { useList } from \"@/components/List\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport ContentView from \"@/views/ContentView\";\nimport SectionView from \"@/views/SectionView\";\nimport { FilterAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/FilterAccordion\";\nimport { ViewModeAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion\";\nimport TextView from \"@/views/TextView\";\nimport { SortingAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/SortingAccordion\";\nimport ActionGroupView from \"@/views/ActionGroupView\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport HeadingView from \"@/views/HeadingView\";\nimport clsx from \"clsx\";\nimport Modal, { ModalTrigger } from \"@/components/Modal\";\nimport { SkeletonText } from \"@/components/SkeletonText\";\n\nexport const AllFiltersModal: FC = () => {\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n const totalItemCount =\n list.batches.getTotalItemsCount() ?? list.items.entries.length;\n\n const filterAccordions = list.filters.map((f) => (\n <FilterAccordion filter={f} key={f.name} />\n ));\n\n const accordions = [\n <ViewModeAccordion key=\"viewMode\" />,\n <SortingAccordion key=\"sorting\" />,\n ...filterAccordions,\n ].filter(Boolean);\n\n const hasSecondaryFilters = list.filters.some(\n (f) => f.priority === \"secondary\",\n );\n\n const controller = useOverlayController(\"Modal\", {\n reuseControllerFromContext: false,\n });\n\n if (accordions.length === 0) {\n return null;\n }\n\n return (\n <ModalTrigger controller={controller}>\n <ButtonView\n className={clsx(\n styles.hideOnMobile,\n hasSecondaryFilters ? undefined : styles.hideOnDesktop,\n )}\n variant=\"outline\"\n color=\"secondary\"\n >\n <TextView>{stringFormatter.format(\"list.filters.all\")}</TextView>\n <IconFilter />\n </ButtonView>\n\n <ButtonView\n className={styles.hideOnDesktop}\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"list.filters.all\")}\n >\n <IconFilter />\n </ButtonView>\n\n <Modal offCanvas controller={controller}>\n <HeadingView>{stringFormatter.format(\"list.filters.all\")}</HeadingView>\n <ContentView>\n <SectionView>{...accordions}</SectionView>\n </ContentView>\n\n <ActionGroupView>\n <ButtonView onPress={() => controller.close()}>\n <TextView>\n {isInitiallyLoading ? (\n <SkeletonText width=\"16ch\" />\n ) : (\n stringFormatter.format(\"list.results.show\", {\n totalItemCount,\n })\n )}\n </TextView>\n </ButtonView>\n <ButtonView\n color=\"secondary\"\n variant=\"soft\"\n onPress={() => {\n list.resetFilters();\n controller.close();\n }}\n >\n {stringFormatter.format(\"list.reset\")}\n </ButtonView>\n </ActionGroupView>\n </Modal>\n </ModalTrigger>\n );\n};\n"],"names":["styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AllFiltersModal.mjs","sources":["../../../../../../../../../../src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport { IconFilter } from \"@/components/Icon/components/icons\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { useList } from \"@/components/List\";\nimport styles from \"@/components/List/components/Header/Header.module.css\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../../../locales/*.locale.json\";\nimport ContentView from \"@/views/ContentView\";\nimport SectionView from \"@/views/SectionView\";\nimport { FilterAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/FilterAccordion\";\nimport { ViewModeAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion\";\nimport TextView from \"@/views/TextView\";\nimport { SortingAccordion } from \"@/components/List/components/Header/components/AllFiltersModal/SortingAccordion\";\nimport ActionGroupView from \"@/views/ActionGroupView\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport HeadingView from \"@/views/HeadingView\";\nimport clsx from \"clsx\";\nimport Modal, { ModalTrigger } from \"@/components/Modal\";\nimport { SkeletonText } from \"@/components/SkeletonText\";\n\nexport const AllFiltersModal: FC = () => {\n const list = useList();\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const isInitiallyLoading = list.loader.useIsInitiallyLoading();\n const totalItemCount =\n list.batches.getTotalItemsCount() ?? list.items.entries.length;\n\n const filterAccordions = list.filters.map((f) => (\n <FilterAccordion filter={f} key={f.name} />\n ));\n\n const accordions = [\n <ViewModeAccordion key=\"viewMode\" />,\n <SortingAccordion key=\"sorting\" />,\n ...filterAccordions,\n ].filter(Boolean);\n\n const hasSecondaryFilters = list.filters.some(\n (f) => f.priority === \"secondary\",\n );\n\n const controller = useOverlayController(\"Modal\", {\n reuseControllerFromContext: false,\n });\n\n if (accordions.length === 0) {\n return null;\n }\n\n return (\n <ModalTrigger controller={controller}>\n <ButtonView\n className={clsx(\n styles.hideOnMobile,\n hasSecondaryFilters ? undefined : styles.hideOnDesktop,\n )}\n variant=\"outline\"\n color=\"secondary\"\n >\n <TextView>{stringFormatter.format(\"list.filters.all\")}</TextView>\n <IconFilter />\n </ButtonView>\n\n <ButtonView\n className={styles.hideOnDesktop}\n variant=\"outline\"\n color=\"secondary\"\n aria-label={stringFormatter.format(\"list.filters.all\")}\n >\n <IconFilter />\n </ButtonView>\n\n <Modal offCanvas controller={controller}>\n <HeadingView>{stringFormatter.format(\"list.filters.all\")}</HeadingView>\n <ContentView>\n <SectionView>{...accordions}</SectionView>\n </ContentView>\n\n <ActionGroupView>\n <ButtonView onPress={() => controller.close()}>\n <TextView>\n {isInitiallyLoading ? (\n <SkeletonText width=\"16ch\" />\n ) : (\n stringFormatter.format(\"list.results.show\", {\n totalItemCount,\n })\n )}\n </TextView>\n </ButtonView>\n <ButtonView\n color=\"secondary\"\n variant=\"soft\"\n onPress={() => {\n list.resetFilters();\n controller.close();\n }}\n >\n {stringFormatter.format(\"list.reset\")}\n </ButtonView>\n </ActionGroupView>\n </Modal>\n </ModalTrigger>\n );\n};\n"],"names":["styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,kBAAsB,MAAM;AACvC,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAA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QAAA,EAAA,eAAA,CAAgB,OAAO,YAAY;AAAA;AAAA;AACtC,OAAA,EACF;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -40,15 +40,7 @@ const Modal = flowComponent("Modal", (props) => {
|
|
|
40
40
|
);
|
|
41
41
|
const header = (children2) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
42
|
children2,
|
|
43
|
-
/* @__PURE__ */ jsx(Action, {
|
|
44
|
-
ButtonView,
|
|
45
|
-
{
|
|
46
|
-
variant: "plain",
|
|
47
|
-
color: "secondary",
|
|
48
|
-
onPress: controller?.close,
|
|
49
|
-
children: /* @__PURE__ */ jsx(IconClose, {})
|
|
50
|
-
}
|
|
51
|
-
) })
|
|
43
|
+
/* @__PURE__ */ jsx(Action, { closeModal: true, children: /* @__PURE__ */ jsx(ButtonView, { variant: "plain", color: "secondary", children: /* @__PURE__ */ jsx(IconClose, {}) }) })
|
|
52
44
|
] });
|
|
53
45
|
const nestedHeadingLevel = 3;
|
|
54
46
|
const nestedHeadingProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.mjs","sources":["../../../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import { Suspense, type PropsWithChildren, type ReactNode } from \"react\";\nimport styles from \"./Modal.module.scss\";\nimport clsx from \"clsx\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport type { OverlayController } from \"@/lib/controller/overlay\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { Overlay } from \"@/components/Overlay/Overlay\";\nimport { Action } from \"@/components/Action\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { OffCanvasSuspenseFallback } from \"@/components/Modal/components/OffCanvasSuspenseFallback\";\nimport Wrap from \"@/components/Wrap\";\nimport { ClearPropsContext } from \"@/components/ClearPropsContext/ClearPropsContext\";\n\nexport interface ModalProps\n extends
|
|
1
|
+
{"version":3,"file":"Modal.mjs","sources":["../../../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import { Suspense, type PropsWithChildren, type ReactNode } from \"react\";\nimport styles from \"./Modal.module.scss\";\nimport clsx from \"clsx\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport type { OverlayController } from \"@/lib/controller/overlay\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { Overlay, type OverlayProps } from \"@/components/Overlay/Overlay\";\nimport { Action } from \"@/components/Action\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport ButtonView from \"@/views/ButtonView\";\nimport { OffCanvasSuspenseFallback } from \"@/components/Modal/components/OffCanvasSuspenseFallback\";\nimport Wrap from \"@/components/Wrap\";\nimport { ClearPropsContext } from \"@/components/ClearPropsContext/ClearPropsContext\";\n\ntype SupportedOverlayProps = Pick<\n OverlayProps,\n \"isOpen\" | \"isDefaultOpen\" | \"onOpen\" | \"onClose\" | \"onOpenChange\"\n>;\n\nexport interface ModalProps\n extends\n PropsWithChildren,\n FlowComponentProps,\n PropsWithClassName,\n SupportedOverlayProps {\n /** The size of the modal. @default \"s\" */\n size?: \"s\" | \"m\" | \"l\";\n /** Whether the modal should be displayed as an off canvas. */\n offCanvas?: boolean;\n /**\n * Whether the off canvas should be displayed on the right or left side of the\n * screen. @default \"right\"\n */\n offCanvasOrientation?: \"left\" | \"right\";\n /** An overlay controller to control the modal state. */\n controller?: OverlayController;\n /**\n * Accepts \"actionConfirm\" to use the modal as a confirmation modal for an\n * action.\n */\n slot?: string;\n /** Whether the modal can be closed by clicking outside of it. */\n isDismissable?: boolean;\n}\n\nexport const Modal = flowComponent(\"Modal\", (props) => {\n const {\n size = \"s\",\n offCanvas,\n controller,\n children,\n ref,\n className,\n offCanvasOrientation = \"right\",\n ...rest\n } = props;\n\n const rootClassName = clsx(\n offCanvas ? styles.offCanvas : styles.modal,\n styles[`size-${size}`],\n offCanvasOrientation === \"left\" && styles[\"left\"],\n className,\n );\n\n const header = (children: ReactNode) => (\n <>\n {children}\n <Action closeModal>\n <ButtonView variant=\"plain\" color=\"secondary\">\n <IconClose />\n </ButtonView>\n </Action>\n </>\n );\n\n const nestedHeadingLevel = 3;\n\n const nestedHeadingProps: PropsContext = {\n Heading: { level: nestedHeadingLevel },\n Section: {\n Header: { Heading: { level: nestedHeadingLevel } },\n Heading: { level: nestedHeadingLevel },\n },\n Header: { Heading: { level: nestedHeadingLevel } },\n };\n\n const propsContext: PropsContext = {\n Content: {\n ...nestedHeadingProps,\n className: styles.content,\n },\n ColumnLayout: {\n ...nestedHeadingProps,\n l: [2, 1],\n m: [1],\n className: styles.columnLayout,\n AccentBox: { className: styles.accentBox, color: \"neutral\" },\n wrapWith: <ClearPropsContext />,\n },\n Heading: {\n className: styles.header,\n level: 2,\n slot: \"title\",\n children: dynamic((props) => header(props.children)),\n },\n ActionGroup: {\n className: styles.actionGroup,\n spacing: \"m\",\n },\n };\n\n return (\n <Overlay\n className={rootClassName}\n controller={controller}\n ref={ref}\n {...rest}\n >\n <PropsContextProvider props={propsContext}>\n <Wrap if={offCanvas}>\n <Suspense fallback={<OffCanvasSuspenseFallback />}>\n {children}\n </Suspense>\n </Wrap>\n </PropsContextProvider>\n </Overlay>\n );\n});\n\nexport default Modal;\n"],"names":["children","props"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmDO,MAAM,KAAA,GAAQ,aAAA,CAAc,OAAA,EAAS,CAAC,KAAA,KAAU;AACrD,EAAA,MAAM;AAAA,IACJ,IAAA,GAAO,GAAA;AAAA,IACP,SAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,GAAA;AAAA,IACA,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EAAG,CAAC,CAAA,EAAG,CAAC,CAAA;AAAA,MACR,CAAA,EAAG,CAAC,CAAC,CAAA;AAAA,MACL,WAAW,MAAA,CAAO,YAAA;AAAA,MAClB,WAAW,EAAE,SAAA,EAAW,MAAA,CAAO,SAAA,EAAW,OAAO,SAAA,EAAU;AAAA,MAC3D,QAAA,sBAAW,iBAAA,EAAA,EAAkB;AAAA,KAC/B;AAAA,IACA,OAAA,EAAS;AAAA,MACP,WAAW,MAAA,CAAO,MAAA;AAAA,MAClB,KAAA,EAAO,CAAA;AAAA,MACP,IAAA,EAAM,OAAA;AAAA,MACN,UAAU,OAAA,CAAQ,CAACC,WAAU,MAAA,CAAOA,MAAAA,CAAM,QAAQ,CAAC;AAAA,KACrD;AAAA,IACA,WAAA,EAAa;AAAA,MACX,WAAW,MAAA,CAAO,WAAA;AAAA,MAClB,OAAA,EAAS;AAAA;AACX,GACF;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,aAAA;AAAA,MACX,UAAA;AAAA,MACA,GAAA;AAAA,MACC,GAAG,IAAA;AAAA,MAEJ,8BAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,QAAA,kBAAA,GAAA,CAAC,QAAK,EAAA,EAAI,SAAA,EACR,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,0BAAU,GAAA,CAAC,yBAAA,EAAA,EAA0B,CAAA,EAC5C,QAAA,EACH,GACF,CAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -6,6 +6,10 @@ import clsx from 'clsx';
|
|
|
6
6
|
import 'mobx';
|
|
7
7
|
import 'react';
|
|
8
8
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
9
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
10
|
+
import 'remeda';
|
|
11
|
+
import '@react-aria/utils';
|
|
12
|
+
import 'dot-prop';
|
|
9
13
|
import { OverlayContextProvider } from '../../lib/controller/overlay/OverlayContextProvider.mjs';
|
|
10
14
|
import OverlayContentView from '../../views/OverlayContentView.mjs';
|
|
11
15
|
|
|
@@ -16,11 +20,19 @@ const Overlay = (props) => {
|
|
|
16
20
|
isDismissable = true,
|
|
17
21
|
className,
|
|
18
22
|
overlayType = "Modal",
|
|
23
|
+
isDefaultOpen,
|
|
19
24
|
isOpen: isOpenFromProps,
|
|
25
|
+
onOpen,
|
|
26
|
+
onClose,
|
|
27
|
+
onOpenChange,
|
|
20
28
|
ref
|
|
21
29
|
} = props;
|
|
22
30
|
const controllerFromContext = useOverlayController(overlayType, {
|
|
23
|
-
reuseControllerFromContext: true
|
|
31
|
+
reuseControllerFromContext: true,
|
|
32
|
+
isDefaultOpen,
|
|
33
|
+
onClose,
|
|
34
|
+
onOpen,
|
|
35
|
+
onOpenChange
|
|
24
36
|
});
|
|
25
37
|
const controller = controllerFromProps ?? controllerFromContext;
|
|
26
38
|
const isOpen = isOpenFromProps ?? controller.useIsOpen();
|
|
@@ -28,7 +40,7 @@ const Overlay = (props) => {
|
|
|
28
40
|
return /* @__PURE__ */ jsx(
|
|
29
41
|
OverlayContentView,
|
|
30
42
|
{
|
|
31
|
-
onOpenChange:
|
|
43
|
+
onOpenChange: controller.setOpen,
|
|
32
44
|
isOpen,
|
|
33
45
|
ref,
|
|
34
46
|
isDismissable,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.mjs","sources":["../../../../../../src/components/Overlay/Overlay.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref } from \"react\";\nimport styles from \"./Overlay.module.scss\";\nimport clsx from \"clsx\";\nimport type { OverlayController } from \"@/lib/controller\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport OverlayContextProvider from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport OverlayContentView from \"@/views/OverlayContentView\";\n\nexport interface OverlayProps extends PropsWithChildren, PropsWithClassName {\n ref?: Ref<HTMLDivElement>;\n /** The controller to control the overlay state. */\n controller?: OverlayController;\n /** Whether the overlay can be closed by clicking outside of it. */\n isDismissable?: boolean;\n /** Whether the overlay is a modal or a light box. */\n overlayType?: \"Modal\" | \"LightBox\";\n isOpen?: boolean;\n}\n\nexport const Overlay: FC<OverlayProps> = (props) => {\n const {\n controller: controllerFromProps,\n children,\n isDismissable = true,\n className,\n overlayType = \"Modal\",\n isOpen: isOpenFromProps,\n ref,\n } = props;\n\n const controllerFromContext = useOverlayController(overlayType, {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const isOpen = isOpenFromProps ?? controller.useIsOpen();\n\n const rootClassName = clsx(styles.overlay, className);\n\n return (\n <OverlayContentView\n onOpenChange={
|
|
1
|
+
{"version":3,"file":"Overlay.mjs","sources":["../../../../../../src/components/Overlay/Overlay.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref } from \"react\";\nimport styles from \"./Overlay.module.scss\";\nimport clsx from \"clsx\";\nimport type { OverlayController } from \"@/lib/controller\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport OverlayContextProvider from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport OverlayContentView from \"@/views/OverlayContentView\";\nimport type {\n OverlayCloseHandler,\n OverlayOpenHandler,\n OverlayOpenStateHandler,\n} from \"@/lib/controller/overlay/OverlayController\";\n\nexport interface OverlayProps extends PropsWithChildren, PropsWithClassName {\n ref?: Ref<HTMLDivElement>;\n /** The controller to control the overlay state. */\n controller?: OverlayController;\n /** Whether the overlay can be closed by clicking outside of it. */\n isDismissable?: boolean;\n /** Whether the overlay is a modal or a light box. */\n overlayType?: \"Modal\" | \"LightBox\";\n isOpen?: boolean;\n isDefaultOpen?: boolean;\n onOpen?: OverlayOpenHandler;\n onClose?: OverlayCloseHandler;\n onOpenChange?: OverlayOpenStateHandler;\n}\n\nexport const Overlay: FC<OverlayProps> = (props) => {\n const {\n controller: controllerFromProps,\n children,\n isDismissable = true,\n className,\n overlayType = \"Modal\",\n isDefaultOpen,\n isOpen: isOpenFromProps,\n onOpen,\n onClose,\n onOpenChange,\n ref,\n } = props;\n\n const controllerFromContext = useOverlayController(overlayType, {\n reuseControllerFromContext: true,\n isDefaultOpen,\n onClose,\n onOpen,\n onOpenChange,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const isOpen = isOpenFromProps ?? controller.useIsOpen();\n\n const rootClassName = clsx(styles.overlay, className);\n\n return (\n <OverlayContentView\n onOpenChange={controller.setOpen}\n isOpen={isOpen}\n ref={ref}\n isDismissable={isDismissable}\n className={rootClassName}\n >\n <OverlayContextProvider type=\"Modal\" controller={controller}>\n {children}\n </OverlayContextProvider>\n </OverlayContentView>\n );\n};\n\nexport default Overlay;\n"],"names":[],"mappings":";;;;;;;;;;;;;AA6BO,MAAM,OAAA,GAA4B,CAAC,KAAA,KAAU;AAClD,EAAA,MAAM;AAAA,IACJ,UAAA,EAAY,mBAAA;AAAA,IACZ,QAAA;AAAA,IACA,aAAA,GAAgB,IAAA;AAAA,IAChB,SAAA;AAAA,IACA,WAAA,GAAc,OAAA;AAAA,IACd,aAAA;AAAA,IACA,MAAA,EAAQ,eAAA;AAAA,IACR,MAAA;AAAA,IACA,OAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AAEJ,EAAA,MAAM,qBAAA,GAAwB,qBAAqB,WAAA,EAAa;AAAA,IAC9D,0BAAA,EAA4B,IAAA;AAAA,IAC5B,aAAA;AAAA,IACA,OAAA;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,MAAM,aAAa,mBAAA,IAAuB,qBAAA;AAE1C,EAAA,MAAM,MAAA,GAAS,eAAA,IAAmB,UAAA,CAAW,SAAA,EAAU;AAEvD,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,MAAA,CAAO,OAAA,EAAS,SAAS,CAAA;AAEpD,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,cAAc,UAAA,CAAW,OAAA;AAAA,MACzB,MAAA;AAAA,MACA,GAAA;AAAA,MACA,aAAA;AAAA,MACA,SAAA,EAAW,aAAA;AAAA,MAEX,QAAA,kBAAA,GAAA,CAAC,sBAAA,EAAA,EAAuB,IAAA,EAAK,OAAA,EAAQ,YAClC,QAAA,EACH;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -5,6 +5,9 @@ import { OverlayController } from '../../lib/controller/overlay/OverlayControlle
|
|
|
5
5
|
import '../../lib/controller/overlay/context.mjs';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../lib/propsContext/propsContext.mjs';
|
|
8
|
+
import 'remeda';
|
|
9
|
+
import '@react-aria/utils';
|
|
10
|
+
import 'dot-prop';
|
|
8
11
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
12
|
import { OverlayContextProvider } from '../../lib/controller/overlay/OverlayContextProvider.mjs';
|
|
10
13
|
|