@mittwald/flow-react-components 0.2.0-alpha.642 → 0.2.0-alpha.644

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/assets/doc-properties.json +6112 -4124
  3. package/dist/css/all.css +1 -1
  4. package/dist/js/components/src/components/Action/Action.mjs +0 -1
  5. package/dist/js/components/src/components/Action/Action.mjs.map +1 -1
  6. package/dist/js/components/src/components/Action/models/ActionState.mjs +5 -1
  7. package/dist/js/components/src/components/Action/models/ActionState.mjs.map +1 -1
  8. package/dist/js/components/src/components/Heading/Heading.mjs.map +1 -1
  9. package/dist/js/components/src/components/Heading/Heading.module.scss.mjs +3 -1
  10. package/dist/js/components/src/components/Heading/Heading.module.scss.mjs.map +1 -1
  11. package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.mjs +1 -1
  12. package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
  13. package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.module.scss.mjs +3 -1
  14. package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.module.scss.mjs.map +1 -1
  15. package/dist/js/components/src/components/propTypes/index.mjs +0 -2
  16. package/dist/js/components/src/components/propTypes/index.mjs.map +1 -1
  17. package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -15
  18. package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
  19. package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs +19 -36
  20. package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
  21. package/dist/js/components/src/integrations/react-hook-form/components/Form/useHotkeySubmit.mjs +19 -0
  22. package/dist/js/components/src/integrations/react-hook-form/components/Form/useHotkeySubmit.mjs.map +1 -0
  23. package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.mjs +42 -0
  24. package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.mjs.map +1 -0
  25. package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.mjs +37 -0
  26. package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.mjs.map +1 -0
  27. package/dist/js/components/src/integrations/react-hook-form/components/FormSubmitAction/FormSubmitAction.mjs +17 -0
  28. package/dist/js/components/src/integrations/react-hook-form/components/FormSubmitAction/FormSubmitAction.mjs.map +1 -0
  29. package/dist/js/components/src/integrations/react-hook-form/components/ResetButton/ResetButton.mjs +16 -34
  30. package/dist/js/components/src/integrations/react-hook-form/components/ResetButton/ResetButton.mjs.map +1 -1
  31. package/dist/js/components/src/integrations/react-hook-form/components/SubmitButton/SubmitButton.mjs +19 -56
  32. package/dist/js/components/src/integrations/react-hook-form/components/SubmitButton/SubmitButton.mjs.map +1 -1
  33. package/dist/js/react-hook-form.mjs +1 -1
  34. package/dist/types/components/Action/Action.d.ts.map +1 -1
  35. package/dist/types/components/Action/models/ActionState.d.ts +1 -0
  36. package/dist/types/components/Action/models/ActionState.d.ts.map +1 -1
  37. package/dist/types/components/Button/stories/lib.d.ts +3 -0
  38. package/dist/types/components/Button/stories/lib.d.ts.map +1 -1
  39. package/dist/types/components/Heading/Heading.d.ts +1 -1
  40. package/dist/types/components/Heading/Heading.d.ts.map +1 -1
  41. package/dist/types/components/Heading/stories/Default.stories.d.ts +1 -0
  42. package/dist/types/components/Heading/stories/Default.stories.d.ts.map +1 -1
  43. package/dist/types/components/IllustratedMessage/IllustratedMessage.d.ts +1 -1
  44. package/dist/types/components/IllustratedMessage/IllustratedMessage.d.ts.map +1 -1
  45. package/dist/types/components/IllustratedMessage/stories/Default.stories.d.ts +1 -0
  46. package/dist/types/components/IllustratedMessage/stories/Default.stories.d.ts.map +1 -1
  47. package/dist/types/components/List/typedList.d.ts +1 -1
  48. package/dist/types/components/propTypes/index.d.ts +0 -4
  49. package/dist/types/components/propTypes/index.d.ts.map +1 -1
  50. package/dist/types/integrations/react-hook-form/components/Field/Field.d.ts.map +1 -1
  51. package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts.map +1 -1
  52. package/dist/types/integrations/react-hook-form/components/Form/stories/Form.stories.d.ts +4 -0
  53. package/dist/types/integrations/react-hook-form/components/Form/stories/Form.stories.d.ts.map +1 -1
  54. package/dist/types/integrations/react-hook-form/components/Form/useHotkeySubmit.d.ts +8 -0
  55. package/dist/types/integrations/react-hook-form/components/Form/useHotkeySubmit.d.ts.map +1 -0
  56. package/dist/types/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.d.ts +21 -0
  57. package/dist/types/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.d.ts.map +1 -0
  58. package/dist/types/integrations/react-hook-form/components/FormContextProvider/index.d.ts +3 -0
  59. package/dist/types/integrations/react-hook-form/components/FormContextProvider/index.d.ts.map +1 -0
  60. package/dist/types/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.d.ts +9 -0
  61. package/dist/types/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.d.ts.map +1 -0
  62. package/dist/types/integrations/react-hook-form/components/FormSubmitAction/FormSubmitAction.d.ts +4 -0
  63. package/dist/types/integrations/react-hook-form/components/FormSubmitAction/FormSubmitAction.d.ts.map +1 -0
  64. package/dist/types/integrations/react-hook-form/components/FormSubmitAction/index.d.ts +2 -0
  65. package/dist/types/integrations/react-hook-form/components/FormSubmitAction/index.d.ts.map +1 -0
  66. package/dist/types/integrations/react-hook-form/components/ResetButton/ResetButton.d.ts +1 -6
  67. package/dist/types/integrations/react-hook-form/components/ResetButton/ResetButton.d.ts.map +1 -1
  68. package/dist/types/integrations/react-hook-form/components/ResetButton/index.d.ts +1 -1
  69. package/dist/types/integrations/react-hook-form/components/ResetButton/index.d.ts.map +1 -1
  70. package/dist/types/integrations/react-hook-form/components/SubmitButton/SubmitButton.d.ts +1 -6
  71. package/dist/types/integrations/react-hook-form/components/SubmitButton/SubmitButton.d.ts.map +1 -1
  72. package/dist/types/integrations/react-hook-form/components/SubmitButton/index.d.ts +1 -1
  73. package/dist/types/integrations/react-hook-form/components/SubmitButton/index.d.ts.map +1 -1
  74. package/dist/types/integrations/react-hook-form/index.d.ts +1 -1
  75. package/package.json +4 -4
  76. package/dist/js/components/src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.mjs +0 -77
  77. package/dist/js/components/src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.mjs.map +0 -1
  78. package/dist/js/components/src/integrations/react-hook-form/components/context/formContext.mjs +0 -19
  79. package/dist/js/components/src/integrations/react-hook-form/components/context/formContext.mjs.map +0 -1
  80. package/dist/types/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.d.ts +0 -7
  81. package/dist/types/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.d.ts.map +0 -1
  82. package/dist/types/integrations/react-hook-form/components/context/formContext.d.ts +0 -19
  83. package/dist/types/integrations/react-hook-form/components/context/formContext.d.ts.map +0 -1
@@ -52,7 +52,6 @@ const Action = flowComponent(
52
52
  const actionModel = actionModelFromProps ?? newActionModel;
53
53
  const propsContext = {
54
54
  Button: actionButtonContext,
55
- SubmitButton: actionButtonContext,
56
55
  Link: {
57
56
  onPress: dynamic(() => ActionModel.use().execute)
58
57
  },
@@ -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\";\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 const newActionModel = ActionModel.useNew(actionProps);\n const actionModel = actionModelFromProps ?? newActionModel;\n\n const propsContext: PropsContext = {\n Button: actionButtonContext,\n\n SubmitButton: actionButtonContext,\n\n Link: {\n onPress: dynamic(() => ActionModel.use().execute),\n },\n\n MenuItem: {\n onAction: dynamic(() => ActionModel.use().execute),\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":";;;;;;;;;;;AAUA,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,OAAO,2BAAA,CAA4B,KAAA;AAAA,IAC5C;AACA,IAAA,OAAO,oBAAA,GAAuB,aAAA,CAAc,OAAA,GAAU,MAAA,CAAO,OAAA;AAAA,EAC/D,CAAC,CAAA;AAAA,EAED,SAAA,EAAW,OAAA,CAAQ,CAAC,KAAA,KAAU;AAC5B,IAAA,MAAM,WAAA,GAAc,qBAAqB,KAAK,CAAA;AAC9C,IAAA,OAAO,KAAA,CAAM,aAAa,WAAA,KAAgB,WAAA;AAAA,EAC5C,CAAC,CAAA;AAAA,EAED,WAAA,EAAa,OAAA,CAAQ,CAAC,KAAA,KAAU;AAC9B,IAAA,MAAM,WAAA,GAAc,qBAAqB,KAAK,CAAA;AAC9C,IAAA,OAAO,KAAA,CAAM,eAAe,WAAA,KAAgB,aAAA;AAAA,EAC9C,CAAC,CAAA;AAAA,EAED,QAAA,EAAU,OAAA,CAAQ,CAAC,KAAA,KAAU;AAC3B,IAAA,MAAM,WAAA,GAAc,qBAAqB,KAAK,CAAA;AAC9C,IAAA,OAA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A,EAAe,OAAA,CAAQ,CAACA,MAAAA,KAAU;AAChC,UAAA,MAAM,MAAA,GAAS,YAAY,GAAA,EAAI;AAC/B,UAAA,MAAM,WAAA,GAAc,MAAA,CAAO,KAAA,CAAM,QAAA,EAAS;AAC1C,UAAA,OAAO,WAAA,KAAgB,aAAA,IAAiB,WAAA,KAAgB,WAAA,GACpD,QACAA,MAAAA,CAAM,aAAA;AAAA,QACZ,CAAC,CAAA;AAAA,QACD,UAAA,EAAY,QAAQ,MAAM;AACxB,UAAA,MAAM,MAAA,GAAS,YAAY,GAAA,EAAI;AAC/B,UAAA,OAAO,OAAO,iBAAA,GACV,MAAA,CAAO,2BAAA,GACP,MAAA,CAAO,qBAAqB,OAAO,CAAA;AAAA,QACzC,CAAC,CAAA;AAAA,QACD,WAAA,EAAa;AAAA,UACX,MAAA,EAAQ;AAAA;AACV;AACF,KACF;AAEA,IAAA,uBACE,GAAA,CAAC,yBAAsB,KAAA,EAAO,WAAA,EAC5B,8BAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,CAAA,EACF,CAAA;AAAA,EAEJ,CAAA;AAAA,EACA;AAAA,IACE,IAAA,EAAM;AAAA;AAEV;;;;"}
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\";\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 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 },\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":";;;;;;;;;;;AAUA,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,OAAO,2BAAA,CAA4B,KAAA;AAAA,IAC5C;AACA,IAAA,OAAO,oBAAA,GAAuB,aAAA,CAAc,OAAA,GAAU,MAAA,CAAO,OAAA;AAAA,EAC/D,CAAC,CAAA;AAAA,EAED,SAAA,EAAW,OAAA,CAAQ,CAAC,KAAA,KAAU;AAC5B,IAAA,MAAM,WAAA,GAAc,qBAAqB,KAAK,CAAA;AAC9C,IAAA,OAAO,KAAA,CAAM,aAAa,WAAA,KAAgB,WAAA;AAAA,EAC5C,CAAC,CAAA;AAAA,EAED,WAAA,EAAa,OAAA,CAAQ,CAAC,KAAA,KAAU;AAC9B,IAAA,MAAM,WAAA,GAAc,qBAAqB,KAAK,CAAA;AAC9C,IAAA,OAAO,KAAA,CAAM,eAAe,WAAA,KAAgB,aAAA;AAAA,EAC9C,CAAC,CAAA;AAAA,EAED,QAAA,EAAU,OAAA,CAAQ,CAAC,KAAA,KAAU;AAC3B,IAAA,MAAM,WAAA,GAAc,qBAAqB,KAAK,CAAA;AAC9C,IAAA,OAAO,KAAA,CAAM,YAAY,WAAA,KAAgB,UAAA;AAAA,EAC3C,CAAC,CAAA;AAAA,EAED,eAAA,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,GAAc,MAAA,CAAO,KAAA,CAAM,QAAA,EAAS;AAC1C,UAAA,OAAO,WAAA,KAAgB,aAAA,IAAiB,WAAA,KAAgB,WAAA,GACpD,QACAA,MAAAA,CAAM,aAAA;AAAA,QACZ,CAAC,CAAA;AAAA,QACD,UAAA,EAAY,QAAQ,MAAM;AACxB,UAAA,MAAM,MAAA,GAAS,YAAY,GAAA,EAAI;AAC/B,UAAA,OAAO,OAAO,iBAAA,GACV,MAAA,CAAO,2BAAA,GACP,MAAA,CAAO,qBAAqB,OAAO,CAAA;AAAA,QACzC,CAAC,CAAA;AAAA,QACD,WAAA,EAAa;AAAA,UACX,MAAA,EAAQ;AAAA;AACV;AACF,KACF;AAEA,IAAA,uBACE,GAAA,CAAC,yBAAsB,KAAA,EAAO,WAAA,EAC5B,8BAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,CAAA,EACF,CAAA;AAAA,EAEJ,CAAA;AAAA,EACA;AAAA,IACE,IAAA,EAAM;AAAA;AAEV;;;;"}
@@ -39,6 +39,7 @@ class ActionState {
39
39
  return this.state !== "isIdle";
40
40
  }
41
41
  onAsyncStart() {
42
+ this.clearPendingTimeout();
42
43
  this.isAsync = true;
43
44
  this.updateState("isExecuting");
44
45
  this.setPendingTimeout = window.setTimeout(
@@ -72,10 +73,13 @@ class ActionState {
72
73
  this.isAsync = false;
73
74
  this.error = void 0;
74
75
  }
75
- async onDone() {
76
+ clearPendingTimeout() {
76
77
  if (this.setPendingTimeout) {
77
78
  window.clearTimeout(this.setPendingTimeout);
78
79
  }
80
+ }
81
+ async onDone() {
82
+ this.clearPendingTimeout();
79
83
  if (this.error) {
80
84
  await this.startFailedFeedback();
81
85
  } else if (this.showFeedback !== false && (this.showFeedback || this.isAsync)) {
@@ -1 +1 @@
1
- {"version":3,"file":"ActionState.mjs","sources":["../../../../../../../src/components/Action/models/ActionState.ts"],"sourcesContent":["import {\n action as mobxAction,\n computed,\n makeObservable,\n observable,\n} from \"mobx\";\nimport useSelector from \"@/lib/mobx/useSelector\";\nimport { sleep } from \"@/lib/promises/sleep\";\nimport { useStatic } from \"@/lib/hooks/useStatic\";\n\nexport type ActionStateValue =\n | \"isIdle\"\n | \"isSucceeded\"\n | \"isPending\"\n | \"isExecuting\"\n | \"isFailed\";\n\nexport const duration = {\n pending: 1000,\n succeeded: 1500,\n failed: 2000,\n};\n\nexport class ActionState {\n private showFeedback?: boolean;\n public state: ActionStateValue = \"isIdle\";\n private setPendingTimeout: number | undefined;\n public error: unknown;\n private isAsync = false;\n\n public constructor() {\n makeObservable(this, {\n state: observable,\n updateState: mobxAction,\n isBusy: computed,\n });\n }\n\n public static useNew(): ActionState {\n return useStatic(() => new ActionState());\n }\n\n public updateState(newState: ActionStateValue): void {\n this.state = newState;\n }\n\n public useValue(): ActionStateValue {\n return useSelector(() => this.state, [this]);\n }\n\n public useIsBusy(): boolean {\n return useSelector(() => this.isBusy, [this]);\n }\n\n public get isBusy(): boolean {\n return this.state !== \"isIdle\";\n }\n\n public onAsyncStart(): void {\n this.isAsync = true;\n this.updateState(\"isExecuting\");\n this.setPendingTimeout = window.setTimeout(\n () => this.startPending(),\n duration.pending,\n );\n }\n\n public async onSucceeded(): Promise<void> {\n await this.onDone();\n }\n\n public async onFailed(error?: unknown): Promise<void> {\n this.error = error ?? new Error(\"Unknown error\");\n await this.onDone();\n }\n\n public withFeedback(feedback?: boolean): ActionState {\n this.showFeedback = feedback;\n return this;\n }\n\n private async startFailedFeedback(): Promise<void> {\n this.updateState(\"isFailed\");\n await sleep(duration.failed);\n this.resetAfterDone();\n }\n\n private async startSucceededFeedback(): Promise<void> {\n this.updateState(\"isSucceeded\");\n await sleep(duration.succeeded);\n this.resetAfterDone();\n }\n\n private resetAfterDone(): void {\n this.updateState(\"isIdle\");\n this.isAsync = false;\n this.error = undefined;\n }\n\n private async onDone(): Promise<void> {\n if (this.setPendingTimeout) {\n window.clearTimeout(this.setPendingTimeout);\n }\n if (this.error) {\n await this.startFailedFeedback();\n } else if (\n this.showFeedback !== false &&\n (this.showFeedback || this.isAsync)\n ) {\n await this.startSucceededFeedback();\n } else {\n this.resetAfterDone();\n }\n }\n\n private startPending(): void {\n this.updateState(\"isPending\");\n }\n}\n"],"names":["mobxAction"],"mappings":";;;;;AAiBO,MAAM,QAAA,GAAW;AAAA,EACtB,OAAA,EAAS,GAAA;AAAA,EACT,SAAA,EAAW,IAAA;AAAA,EACX,MAAA,EAAQ;AACV;AAEO,MAAM,WAAA,CAAY;AAAA,EACf,YAAA;AAAA,EACD,KAAA,GAA0B,QAAA;AAAA,EACzB,iBAAA;AAAA,EACD,KAAA;AAAA,EACC,OAAA,GAAU,KAAA;AAAA,EAEX,WAAA,GAAc;AACnB,IAAA,cAAA,CAAe,IAAA,EAAM;AAAA,MACnB,KAAA,EAAO,UAAA;AAAA,MACP,WAAA,EAAaA,MAAA;AAAA,MACb,MAAA,EAAQ;AAAA,KACT,CAAA;AAAA,EACH;AAAA,EAEA,OAAc,MAAA,GAAsB;AAClC,IAAA,OAAO,SAAA,CAAU,MAAM,IAAI,WAAA,EAAa,CAAA;AAAA,EAC1C;AAAA,EAEO,YAAY,QAAA,EAAkC;AACnD,IAAA,IAAA,CAAK,KAAA,GAAQ,QAAA;AAAA,EACf;AAAA,EAEO,QAAA,GAA6B;AAClC,IAAA,OAAO,YAAY,MAAM,IAAA,CAAK,KAAA,EAAO,CAAC,IAAI,CAAC,CAAA;AAAA,EAC7C;AAAA,EAEO,SAAA,GAAqB;AAC1B,IAAA,OAAO,YAAY,MAAM,IAAA,CAAK,MAAA,EAAQ,CAAC,IAAI,CAAC,CAAA;AAAA,EAC9C;AAAA,EAEA,IAAW,MAAA,GAAkB;AAC3B,IAAA,OAAO,KAAK,KAAA,KAAU,QAAA;AAAA,EACxB;AAAA,EAEO,YAAA,GAAqB;AAC1B,IAAA,IAAA,CAAK,OAAA,GAAU,IAAA;AACf,IAAA,IAAA,CAAK,YAAY,aAAa,CAAA;AAC9B,IA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,YAAA,KAAiB,UACrB,IAAA,CAAK,YAAA,IAAgB,KAAK,OAAA,CAAA,EAC3B;AACA,MAAA,MAAM,KAAK,sBAAA,EAAuB;AAAA,IACpC,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,cAAA,EAAe;AAAA,IACtB;AAAA,EACF;AAAA,EAEQ,YAAA,GAAqB;AAC3B,IAAA,IAAA,CAAK,YAAY,WAAW,CAAA;AAAA,EAC9B;AACF;;;;"}
1
+ {"version":3,"file":"ActionState.mjs","sources":["../../../../../../../src/components/Action/models/ActionState.ts"],"sourcesContent":["import {\n action as mobxAction,\n computed,\n makeObservable,\n observable,\n} from \"mobx\";\nimport useSelector from \"@/lib/mobx/useSelector\";\nimport { sleep } from \"@/lib/promises/sleep\";\nimport { useStatic } from \"@/lib/hooks/useStatic\";\n\nexport type ActionStateValue =\n | \"isIdle\"\n | \"isSucceeded\"\n | \"isPending\"\n | \"isExecuting\"\n | \"isFailed\";\n\nexport const duration = {\n pending: 1000,\n succeeded: 1500,\n failed: 2000,\n};\n\nexport class ActionState {\n private showFeedback?: boolean;\n public state: ActionStateValue = \"isIdle\";\n private setPendingTimeout: number | undefined;\n public error: unknown;\n private isAsync = false;\n\n public constructor() {\n makeObservable(this, {\n state: observable,\n updateState: mobxAction,\n isBusy: computed,\n });\n }\n\n public static useNew(): ActionState {\n return useStatic(() => new ActionState());\n }\n\n public updateState(newState: ActionStateValue): void {\n this.state = newState;\n }\n\n public useValue(): ActionStateValue {\n return useSelector(() => this.state, [this]);\n }\n\n public useIsBusy(): boolean {\n return useSelector(() => this.isBusy, [this]);\n }\n\n public get isBusy(): boolean {\n return this.state !== \"isIdle\";\n }\n\n public onAsyncStart(): void {\n this.clearPendingTimeout();\n this.isAsync = true;\n this.updateState(\"isExecuting\");\n this.setPendingTimeout = window.setTimeout(\n () => this.startPending(),\n duration.pending,\n );\n }\n\n public async onSucceeded(): Promise<void> {\n await this.onDone();\n }\n\n public async onFailed(error?: unknown): Promise<void> {\n this.error = error ?? new Error(\"Unknown error\");\n await this.onDone();\n }\n\n public withFeedback(feedback?: boolean): ActionState {\n this.showFeedback = feedback;\n return this;\n }\n\n private async startFailedFeedback(): Promise<void> {\n this.updateState(\"isFailed\");\n await sleep(duration.failed);\n this.resetAfterDone();\n }\n\n private async startSucceededFeedback(): Promise<void> {\n this.updateState(\"isSucceeded\");\n await sleep(duration.succeeded);\n this.resetAfterDone();\n }\n\n private resetAfterDone(): void {\n this.updateState(\"isIdle\");\n this.isAsync = false;\n this.error = undefined;\n }\n\n private clearPendingTimeout(): void {\n if (this.setPendingTimeout) {\n window.clearTimeout(this.setPendingTimeout);\n }\n }\n\n private async onDone(): Promise<void> {\n this.clearPendingTimeout();\n if (this.error) {\n await this.startFailedFeedback();\n } else if (\n this.showFeedback !== false &&\n (this.showFeedback || this.isAsync)\n ) {\n await this.startSucceededFeedback();\n } else {\n this.resetAfterDone();\n }\n }\n\n private startPending(): void {\n this.updateState(\"isPending\");\n }\n}\n"],"names":["mobxAction"],"mappings":";;;;;AAiBO,MAAM,QAAA,GAAW;AAAA,EACtB,OAAA,EAAS,GAAA;AAAA,EACT,SAAA,EAAW,IAAA;AAAA,EACX,MAAA,EAAQ;AACV;AAEO,MAAM,WAAA,CAAY;AAAA,EACf,YAAA;AAAA,EACD,KAAA,GAA0B,QAAA;AAAA,EACzB,iBAAA;AAAA,EACD,KAAA;AAAA,EACC,OAAA,GAAU,KAAA;AAAA,EAEX,WAAA,GAAc;AACnB,IAAA,cAAA,CAAe,IAAA,EAAM;AAAA,MACnB,KAAA,EAAO,UAAA;AAAA,MACP,WAAA,EAAaA,MAAA;AAAA,MACb,MAAA,EAAQ;AAAA,KACT,CAAA;AAAA,EACH;AAAA,EAEA,OAAc,MAAA,GAAsB;AAClC,IAAA,OAAO,SAAA,CAAU,MAAM,IAAI,WAAA,EAAa,CAAA;AAAA,EAC1C;AAAA,EAEO,YAAY,QAAA,EAAkC;AACnD,IAAA,IAAA,CAAK,KAAA,GAAQ,QA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A,MAAM,KAAA,CAAM,SAAS,SAAS,CAAA;AAC9B,IAAA,IAAA,CAAK,cAAA,EAAe;AAAA,EACtB;AAAA,EAEQ,cAAA,GAAuB;AAC7B,IAAA,IAAA,CAAK,YAAY,QAAQ,CAAA;AACzB,IAAA,IAAA,CAAK,OAAA,GAAU,KAAA;AACf,IAAA,IAAA,CAAK,KAAA,GAAQ,MAAA;AAAA,EACf;AAAA,EAEQ,mBAAA,GAA4B;AAClC,IAAA,IAAI,KAAK,iBAAA,EAAmB;AAC1B,MAAA,MAAA,CAAO,YAAA,CAAa,KAAK,iBAAiB,CAAA;AAAA,IAC5C;AAAA,EACF;AAAA,EAEA,MAAc,MAAA,GAAwB;AACpC,IAAA,IAAA,CAAK,mBAAA,EAAoB;AACzB,IAAA,IAAI,KAAK,KAAA,EAAO;AACd,MAAA,MAAM,KAAK,mBAAA,EAAoB;AAAA,IACjC,WACE,IAAA,CAAK,YAAA,KAAiB,UACrB,IAAA,CAAK,YAAA,IAAgB,KAAK,OAAA,CAAA,EAC3B;AACA,MAAA,MAAM,KAAK,sBAAA,EAAuB;AAAA,IACpC,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,cAAA,EAAe;AAAA,IACtB;AAAA,EACF;AAAA,EAEQ,YAAA,GAAqB;AAC3B,IAAA,IAAA,CAAK,YAAY,WAAW,CAAA;AAAA,EAC9B;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.mjs","sources":["../../../../../../src/components/Heading/Heading.tsx"],"sourcesContent":["export * from \"./view\";\nimport styles from \"./Heading.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\n\nexport interface HeadingProps extends Aria.HeadingProps, FlowComponentProps {\n /** The font size of the heading. */\n size?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\";\n /** The color of the heading. @default \"primary\" */\n color?: \"primary\" | \"danger\" | \"dark\" | \"light\";\n /** The text-wrap property of the text. @default undefined */\n wrap?: \"wrap\" | \"balance\";\n}\n\n/** @flr-generate all */\nexport const Heading = flowComponent(\"Heading\", (props) => {\n const {\n children,\n className,\n level = 2,\n color = \"primary\",\n wrap,\n size,\n ref,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.heading,\n size && styles[size],\n styles[color],\n wrap && styles[`wrap-${wrap}`],\n className,\n );\n\n const propsContext: PropsContext = {\n Icon: {\n \"aria-hidden\": true,\n className: styles.icon,\n },\n AlertBadge: {\n tunnelId: \"headingContent\",\n },\n Badge: {\n tunnelId: \"headingContent\",\n },\n ContextualHelpTrigger: {\n tunnelId: \"headingContent\",\n Button: {\n tunnelId: null,\n },\n },\n AlertText: {\n Icon: {\n className: styles.icon,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <TunnelProvider>\n <Aria.Heading\n level={level}\n className={rootClassName}\n {...rest}\n ref={ref}\n >\n <span className={styles.headingText}>{children}</span>\n <span className={styles.headingContent}>\n <TunnelExit id=\"headingContent\" />\n </span>\n </Aria.Heading>\n </TunnelProvider>\n </PropsContextProvider>\n );\n});\n\nexport default Heading;\n"],"names":[],"mappings":";;;;;;;;;AAoBO,MAAM,OAAA,GAAU,aAAA,CAAc,SAAA,EAAW,CAAC,KAAA,KAAU;AACzD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA,GAAQ,CAAA;AAAA,IACR,KAAA,GAAQ,SAAA;AAAA,IACR,IAAA;AAAA,IACA,IAAA;AAAA,IACA,GAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,OAAA;A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ading.mjs","sources":["../../../../../../src/components/Heading/Heading.tsx"],"sourcesContent":["export * from \"./view\";\nimport styles from \"./Heading.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\n\nexport interface HeadingProps extends Aria.HeadingProps, FlowComponentProps {\n /** The font size of the heading. */\n size?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\";\n /** The color of the heading. @default \"primary\" */\n color?: \"primary\" | \"danger\" | \"unavailable\" | \"dark\" | \"light\";\n /** The text-wrap property of the text. @default undefined */\n wrap?: \"wrap\" | \"balance\";\n}\n\n/** @flr-generate all */\nexport const Heading = flowComponent(\"Heading\", (props) => {\n const {\n children,\n className,\n level = 2,\n color = \"primary\",\n wrap,\n size,\n ref,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.heading,\n size && styles[size],\n styles[color],\n wrap && styles[`wrap-${wrap}`],\n className,\n );\n\n const propsContext: PropsContext = {\n Icon: {\n \"aria-hidden\": true,\n className: styles.icon,\n },\n AlertBadge: {\n tunnelId: \"headingContent\",\n },\n Badge: {\n tunnelId: \"headingContent\",\n },\n ContextualHelpTrigger: {\n tunnelId: \"headingContent\",\n Button: {\n tunnelId: null,\n },\n },\n AlertText: {\n Icon: {\n className: styles.icon,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <TunnelProvider>\n <Aria.Heading\n level={level}\n className={rootClassName}\n {...rest}\n ref={ref}\n >\n <span className={styles.headingText}>{children}</span>\n <span className={styles.headingContent}>\n <TunnelExit id=\"headingContent\" />\n </span>\n </Aria.Heading>\n </TunnelProvider>\n </PropsContextProvider>\n );\n});\n\nexport default Heading;\n"],"names":[],"mappings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AA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,MAAA,CAAO,WAAA,EAAc,QAAA,EAAS,CAAA;AAAA,wBAC/C,GAAA,CAAC,UAAK,SAAA,EAAW,MAAA,CAAO,gBACtB,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAG,gBAAA,EAAiB,CAAA,EAClC;AAAA;AAAA;AAAA,KAEJ,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
@@ -4,6 +4,7 @@ const heading = "flow--heading";
4
4
  const dark = "flow--heading--dark";
5
5
  const light = "flow--heading--light";
6
6
  const danger = "flow--heading--danger";
7
+ const unavailable = "flow--heading--unavailable";
7
8
  const headingText = "flow--heading--heading-text";
8
9
  const icon = "flow--heading--icon";
9
10
  const headingContent = "flow--heading--heading-content";
@@ -18,6 +19,7 @@ const styles = {
18
19
  dark: dark,
19
20
  light: light,
20
21
  danger: danger,
22
+ unavailable: unavailable,
21
23
  headingText: headingText,
22
24
  icon: icon,
23
25
  headingContent: headingContent,
@@ -31,5 +33,5 @@ const styles = {
31
33
  "wrap-balance": "flow--heading--wrap-balance"
32
34
  };
33
35
 
34
- export { danger, dark, styles as default, heading, headingContent, headingText, icon, l, light, m, s, xl, xs, xxl };
36
+ export { danger, dark, styles as default, heading, headingContent, headingText, icon, l, light, m, s, unavailable, xl, xs, xxl };
35
37
  //# sourceMappingURL=Heading.module.scss.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Heading.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -24,7 +24,7 @@ const IllustratedMessage = flowComponent(
24
24
  },
25
25
  Heading: {
26
26
  className: styles.heading,
27
- color: lightOrDarkColor
27
+ color
28
28
  },
29
29
  Text: {
30
30
  className: styles.text,
@@ -1 +1 @@
1
- {"version":3,"file":"IllustratedMessage.mjs","sources":["../../../../../../src/components/IllustratedMessage/IllustratedMessage.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./IllustratedMessage.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\n\nexport interface IllustratedMessageProps\n extends PropsWithChildren<ComponentProps<\"div\">>,\n FlowComponentProps {\n /** The color of the illustrated message. @default \"primary\" */\n color?: \"primary\" | \"danger\" | \"light\" | \"dark\";\n}\n\n/** @flr-generate all */\nexport const IllustratedMessage = flowComponent(\n \"IllustratedMessage\",\n (props) => {\n const { className, children, color = \"primary\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.illustratedMessage,\n className,\n styles[color],\n );\n\n const lightOrDarkColor =\n color === \"dark\" || color === \"light\" ? color : undefined;\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n size: \"l\",\n },\n Heading: {\n className: styles.heading,\n color: lightOrDarkColor,\n },\n Text: {\n className: styles.text,\n color: lightOrDarkColor,\n },\n Button: {\n color: lightOrDarkColor ?? \"accent\",\n },\n ActionGroup: {\n className: styles.actionGroup,\n },\n ProgressBar: { className: styles.progressBar },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </div>\n );\n },\n);\n\nexport default IllustratedMessage;\n"],"names":[],"mappings":";;;;;;;AAkBO,MAAM,kBAAA,GAAqB,aAAA;AAAA,EAChC,oBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,QAAQ,SAAA,EAAW,GAAG,MAAK,GAAI,KAAA;AAE5D,IAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,MACpB,MAAA,CAAO,kBAAA;AAAA,MACP,SAAA;AAAA,MACA,OAAO,KAAK;AAAA,KACd;AAEA,IAAA,MAAM,gBAAA,GACJ,KAAA,KAAU,MAAA,IAAU,KAAA,KAAU,UAAU,KAAA,GAAQ,MAAA;AAElD,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,IAAA,EAAM;AAAA,QACJ,WAAW,MAAA,CAAO,IAAA;AAAA,QAClB,IAAA,EAAM;AAAA,OACR;AAAA,MACA,OAAA,EAAS;AAAA,QACP,WAAW,MAAA,CAAO,OAAA;AAAA,QAClB,KAAA,EAAO;AAAA,OACT;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,WAAW,MAAA,CAAO,IAAA;AAAA,QAClB,KAAA,EAAO;AAAA,OACT;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,OAAO,gBAAA,IAAoB;AAAA,OAC7B;AAAA,MACA,WAAA,EAAa;AAAA,QACX,WAAW,MAAA,CAAO;AAAA,OACpB;AAAA,MACA,WAAA,EAAa,EAAE,SAAA,EAAW,MAAA,CAAO,WAAA;AAAY,KAC/C;AAEA,IAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAK,GAAG,IAAA,EAAM,SAAA,EAAW,aAAA,EACxB,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;;;;"}
1
+ {"version":3,"file":"IllustratedMessage.mjs","sources":["../../../../../../src/components/IllustratedMessage/IllustratedMessage.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./IllustratedMessage.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\n\nexport interface IllustratedMessageProps\n extends PropsWithChildren<ComponentProps<\"div\">>,\n FlowComponentProps {\n /** The color of the illustrated message. @default \"primary\" */\n color?: \"primary\" | \"danger\" | \"unavailable\" | \"light\" | \"dark\";\n}\n\n/** @flr-generate all */\nexport const IllustratedMessage = flowComponent(\n \"IllustratedMessage\",\n (props) => {\n const { className, children, color = \"primary\", ...rest } = props;\n\n const rootClassName = clsx(\n styles.illustratedMessage,\n className,\n styles[color],\n );\n\n const lightOrDarkColor =\n color === \"dark\" || color === \"light\" ? color : undefined;\n\n const propsContext: PropsContext = {\n Icon: {\n className: styles.icon,\n size: \"l\",\n },\n Heading: {\n className: styles.heading,\n color,\n },\n Text: {\n className: styles.text,\n color: lightOrDarkColor,\n },\n Button: {\n color: lightOrDarkColor ?? \"accent\",\n },\n ActionGroup: {\n className: styles.actionGroup,\n },\n ProgressBar: { className: styles.progressBar },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </div>\n );\n },\n);\n\nexport default IllustratedMessage;\n"],"names":[],"mappings":";;;;;;;AAkBO,MAAM,kBAAA,GAAqB,aAAA;AAAA,EAChC,oBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,QAAQ,SAAA,EAAW,GAAG,MAAK,GAAI,KAAA;AAE5D,IAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,MACpB,MAAA,CAAO,kBAAA;AAAA,MACP,SAAA;AAAA,MACA,OAAO,KAAK;AAAA,KACd;AAEA,IAAA,MAAM,gBAAA,GACJ,KAAA,KAAU,MAAA,IAAU,KAAA,KAAU,UAAU,KAAA,GAAQ,MAAA;AAElD,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,IAAA,EAAM;AAAA,QACJ,WAAW,MAAA,CAAO,IAAA;AAAA,QAClB,IAAA,EAAM;AAAA,OACR;AAAA,MACA,OAAA,EAAS;AAAA,QACP,WAAW,MAAA,CAAO,OAAA;AAAA,QAClB;AAAA,OACF;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,WAAW,MAAA,CAAO,IAAA;AAAA,QAClB,KAAA,EAAO;AAAA,OACT;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,OAAO,gBAAA,IAAoB;AAAA,OAC7B;AAAA,MACA,WAAA,EAAa;AAAA,QACX,WAAW,MAAA,CAAO;AAAA,OACpB;AAAA,MACA,WAAA,EAAa,EAAE,SAAA,EAAW,MAAA,CAAO,WAAA;AAAY,KAC/C;AAEA,IAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAK,GAAG,IAAA,EAAM,SAAA,EAAW,aAAA,EACxB,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;;;;"}
@@ -8,6 +8,7 @@ const actionGroup = "flow--illustrated-message--action-group";
8
8
  const progressBar = "flow--illustrated-message--progress-bar";
9
9
  const primary = "flow--illustrated-message--primary";
10
10
  const danger = "flow--illustrated-message--danger";
11
+ const unavailable = "flow--illustrated-message--unavailable";
11
12
  const dark = "flow--illustrated-message--dark";
12
13
  const light = "flow--illustrated-message--light";
13
14
  const styles = {
@@ -19,9 +20,10 @@ const styles = {
19
20
  progressBar: progressBar,
20
21
  primary: primary,
21
22
  danger: danger,
23
+ unavailable: unavailable,
22
24
  dark: dark,
23
25
  light: light
24
26
  };
25
27
 
26
- export { actionGroup, danger, dark, styles as default, heading, icon, illustratedMessage, light, primary, progressBar, text };
28
+ export { actionGroup, danger, dark, styles as default, heading, icon, illustratedMessage, light, primary, progressBar, text, unavailable };
27
29
  //# sourceMappingURL=IllustratedMessage.module.scss.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IllustratedMessage.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"IllustratedMessage.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -69,8 +69,6 @@ const propsContextSupportingComponentsMap = {
69
69
  SegmentedControl: true,
70
70
  Select: true,
71
71
  Slider: true,
72
- SubmitButton: true,
73
- ResetButton: true,
74
72
  Switch: true,
75
73
  Tabs: true,
76
74
  TabTitle: true,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../src/components/propTypes/index.ts"],"sourcesContent":["import type { TextProps } from \"@/components/Text\";\nimport type { ButtonProps } from \"@/components/Button\";\nimport type { IconProps } from \"@/components/Icon\";\nimport type { LabelProps } from \"@/components/Label\";\nimport type { ContentProps } from \"@/components/Content\";\nimport type { LayoutCardProps } from \"@/components/LayoutCard\";\nimport type { LinkProps } from \"@/components/Link\";\nimport type { LightBoxProps } from \"@/components/LightBox\";\nimport type { FieldErrorProps } from \"@/components/FieldError\";\nimport type { FieldDescriptionProps } from \"@/components/FieldDescription\";\nimport type { AlertProps } from \"@/components/Alert\";\nimport type { HeadingProps } from \"@/components/Heading\";\nimport type { InitialsProps } from \"@/components/Initials\";\nimport type { ImageProps } from \"@/components/Image\";\nimport type { CopyButtonProps } from \"@/components/CopyButton\";\nimport type { HeaderProps } from \"@/components/Header/\";\nimport type { SwitchProps } from \"@/components/Switch\";\nimport type { AlertBadgeProps } from \"@/components/AlertBadge\";\nimport type { ActionGroupProps } from \"@/components/ActionGroup\";\nimport type { AvatarProps } from \"@/components/Avatar\";\nimport type { ActionProps } from \"@/components/Action\";\nimport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n MenuItemProps,\n} from \"@/components/ContextMenu\";\nimport type { SelectProps } from \"@/components/Select\";\nimport type {\n RadioButtonProps,\n RadioGroupProps,\n RadioProps,\n} from \"@/components/RadioGroup\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport type { NumberFieldProps } from \"@/components/NumberField\";\nimport type { TextAreaProps } from \"@/components/TextArea\";\nimport type { CheckboxGroupProps } from \"@/components/CheckboxGroup\";\nimport type { CheckboxProps } from \"@/components/Checkbox\";\nimport type { CheckboxButtonProps } from \"@/components/CheckboxButton\";\nimport type { TabsProps } from \"@/components/Tabs\";\nimport type { ModalProps } from \"@/components/Modal\";\nimport type { SectionProps } from \"@/components/Section\";\nimport type { SliderProps } from \"@/components/Slider\";\nimport type { CounterBadgeProps } from \"@/components/CounterBadge\";\nimport type { FlowComponentName } from \"@/components/propTypes/types\";\nimport type {\n ContextualHelpProps,\n ContextualHelpTriggerProps,\n} from \"@/components/ContextualHelp\";\nimport type { PopoverProps, PopoverTriggerProps } from \"@/components/Popover\";\nimport type { ContextMenuSectionProps } from \"@/components/ContextMenu/components/ContextMenuSection\";\nimport type { ListProps } from \"@/components/List\";\nimport type { PasswordCreationFieldProps } from \"@/components/PasswordCreationField\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { BadgeProps } from \"@/components/Badge\";\nimport type { DatePickerProps } from \"@/components/DatePicker\";\nimport type * as Aria from \"react-aria-components\";\nimport type { DateRangePickerProps } from \"@/components/DateRangePicker\";\nimport type { TimeFieldProps } from \"@/components/TimeField\";\nimport type { AlertIconProps } from \"@/components/AlertIcon\";\nimport type { ListSummaryProps } from \"@/components/List/components/ListSummary/ListSummary\";\nimport type { SegmentedControlProps } from \"@/components/SegmentedControl\";\nimport type { SegmentProps } from \"@/components/SegmentedControl/components/Segment\";\nimport type { FileCardProps } from \"@/components/FileCard\";\nimport type { FileFieldProps } from \"@/components/FileField\";\nimport type { AlignProps } from \"@/components/Align\";\nimport type { CountryOptionsProps } from \"src/components/CountryOptions\";\nimport type { ComboBoxProps } from \"@/components/ComboBox\";\nimport type { OptionProps } from \"@/components/Option\";\nimport type { MessageProps } from \"@/components/Message\";\nimport type { MessageThreadProps } from \"@/components/MessageThread\";\nimport type { FileCardListProps } from \"@/components/FileCardList\";\nimport type { AccentBoxProps } from \"@/components/AccentBox\";\nimport type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport type { MenuTriggerProps } from \"@/components/OverlayTrigger\";\nimport type { ProgressBarProps } from \"@/components/ProgressBar\";\nimport type { FileDropZoneProps } from \"@/components/FileDropZone\";\nimport type { NavigationProps } from \"@/components/Navigation\";\nimport type { NavigationGroupProps } from \"@/components/Navigation/components/NavigationGroup\";\nimport type { AutocompleteProps } from \"@/components/Autocomplete/Autocomplete\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport type { MarkdownEditorProps } from \"@/components/MarkdownEditor\";\nimport type { SubmitButtonProps } from \"@/integrations/react-hook-form/components/SubmitButton/SubmitButton\";\nimport type { ResetButtonProps } from \"@/integrations/react-hook-form/components/ResetButton/ResetButton\";\nimport type { AlertTextProps } from \"@/components/AlertText\";\nimport type { IllustratedMessageProps } from \"@/components/IllustratedMessage\";\n\nexport * from \"./types\";\n\nexport interface FlowComponentPropsTypes {\n AccentBox: AccentBoxProps;\n Action: ActionProps;\n ActionGroup: ActionGroupProps;\n Alert: AlertProps;\n AlertBadge: AlertBadgeProps;\n AlertIcon: AlertIconProps;\n AlertText: AlertTextProps;\n Align: AlignProps;\n Avatar: AvatarProps;\n Autocomplete: AutocompleteProps;\n Badge: BadgeProps;\n Button: ButtonProps;\n Checkbox: CheckboxProps;\n CheckboxButton: CheckboxButtonProps;\n CheckboxGroup: CheckboxGroupProps;\n ColumnLayout: ColumnLayoutProps;\n ComboBox: ComboBoxProps;\n Content: ContentProps;\n ContextMenu: ContextMenuProps;\n ContextMenuSection: ContextMenuSectionProps;\n ContextMenuTrigger: ContextMenuTriggerProps;\n ContextualHelp: ContextualHelpProps;\n ContextualHelpTrigger: ContextualHelpTriggerProps;\n CopyButton: CopyButtonProps;\n CounterBadge: CounterBadgeProps;\n CountryOptions: CountryOptionsProps;\n DatePicker: DatePickerProps<Aria.DateValue>;\n DateRangePicker: DateRangePickerProps<Aria.DateValue>;\n FieldDescription: FieldDescriptionProps;\n FieldError: FieldErrorProps;\n FileCard: FileCardProps;\n FileCardList: FileCardListProps;\n FileField: FileFieldProps;\n FileDropZone: FileDropZoneProps;\n Header: HeaderProps;\n Heading: HeadingProps;\n Icon: IconProps;\n IllustratedMessage: IllustratedMessageProps;\n Image: ImageProps;\n Initials: InitialsProps;\n Label: LabelProps;\n LayoutCard: LayoutCardProps;\n LightBox: LightBoxProps;\n Link: LinkProps;\n List: ListProps<never>;\n ListSummary: ListSummaryProps;\n MarkdownEditor: MarkdownEditorProps;\n MenuItem: MenuItemProps;\n MenuTrigger: MenuTriggerProps;\n Message: MessageProps;\n MessageThread: MessageThreadProps;\n Modal: ModalProps;\n Navigation: NavigationProps;\n NavigationGroup: NavigationGroupProps;\n NumberField: NumberFieldProps;\n Option: OptionProps;\n Options: OptionsProps;\n Popover: PopoverProps;\n PopoverTrigger: PopoverTriggerProps;\n PasswordCreationField: PasswordCreationFieldProps;\n ProgressBar: ProgressBarProps;\n Radio: RadioProps;\n RadioButton: RadioButtonProps;\n RadioGroup: RadioGroupProps;\n SearchField: SearchFieldProps;\n Section: SectionProps;\n Segment: SegmentProps;\n SegmentedControl: SegmentedControlProps;\n Select: SelectProps;\n Slider: SliderProps;\n SubmitButton: SubmitButtonProps;\n ResetButton: ResetButtonProps;\n Switch: SwitchProps;\n Tabs: TabsProps;\n TabTitle: TabsProps;\n Text: TextProps;\n TextArea: TextAreaProps;\n TextField: TextFieldProps;\n TimeField: TimeFieldProps;\n}\n\nconst propsContextSupportingComponentsMap: Record<\n keyof FlowComponentPropsTypes,\n true\n> = {\n AccentBox: true,\n Action: true,\n ActionGroup: true,\n Avatar: true,\n Autocomplete: true,\n Alert: true,\n AlertBadge: true,\n AlertIcon: true,\n AlertText: true,\n Align: true,\n Badge: true,\n Button: true,\n Checkbox: true,\n CheckboxButton: true,\n CheckboxGroup: true,\n ColumnLayout: true,\n ComboBox: true,\n Content: true,\n ContextMenu: true,\n ContextMenuSection: true,\n ContextMenuTrigger: true,\n ContextualHelp: true,\n ContextualHelpTrigger: true,\n CopyButton: true,\n CounterBadge: true,\n CountryOptions: true,\n DatePicker: true,\n DateRangePicker: true,\n FieldDescription: true,\n FieldError: true,\n FileCard: true,\n FileCardList: true,\n FileField: true,\n FileDropZone: true,\n Header: true,\n Heading: true,\n Icon: true,\n IllustratedMessage: true,\n Image: true,\n Initials: true,\n Label: true,\n LayoutCard: true,\n LightBox: true,\n Link: true,\n List: true,\n ListSummary: true,\n MarkdownEditor: true,\n MenuItem: true,\n MenuTrigger: true,\n Message: true,\n MessageThread: true,\n Modal: true,\n Navigation: true,\n NavigationGroup: true,\n NumberField: true,\n Radio: true,\n Option: true,\n Options: true,\n Popover: true,\n PopoverTrigger: true,\n PasswordCreationField: true,\n ProgressBar: true,\n RadioButton: true,\n RadioGroup: true,\n SearchField: true,\n Section: true,\n Segment: true,\n SegmentedControl: true,\n Select: true,\n Slider: true,\n SubmitButton: true,\n ResetButton: true,\n Switch: true,\n Tabs: true,\n TabTitle: true,\n TestComponent: true,\n Text: true,\n TextArea: true,\n TextField: true,\n TimeField: true,\n};\n\nexport const propsContextSupportingComponents = Object.keys(\n propsContextSupportingComponentsMap,\n) as FlowComponentName[];\n"],"names":[],"mappings":"AA0KA,MAAM,mCAAA,GAGF;AAAA,EACF,SAAA,EAAW,IAAA;AAAA,EACX,MAAA,EAAQ,IAAA;AAAA,EACR,WAAA,EAAa,IAAA;AAAA,EACb,MAAA,EAAQ,IAAA;AAAA,EACR,YAAA,EAAc,IAAA;AAAA,EACd,KAAA,EAAO,IAAA;AAAA,EACP,UAAA,EAAY,IAAA;AAAA,EACZ,SAAA,EAAW,IAAA;AAAA,EACX,SAAA,EAAW,IAAA;AAAA,EACX,KAAA,EAAO,IAAA;AAAA,EACP,KAAA,EAAO,IAAA;AAAA,EACP,MAAA,EAAQ,IAAA;AAAA,EACR,QAAA,EAAU,IAAA;AAAA,EACV,cAAA,EAAgB,IAAA;AAAA,EAChB,aAAA,EAAe,IAAA;AAAA,EACf,YAAA,EAAc,IAAA;A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OAAA,EAAS,IAAA;AAAA,EACT,OAAA,EAAS,IAAA;AAAA,EACT,cAAA,EAAgB,IAAA;AAAA,EAChB,qBAAA,EAAuB,IAAA;AAAA,EACvB,WAAA,EAAa,IAAA;AAAA,EACb,WAAA,EAAa,IAAA;AAAA,EACb,UAAA,EAAY,IAAA;AAAA,EACZ,WAAA,EAAa,IAAA;AAAA,EACb,OAAA,EAAS,IAAA;AAAA,EACT,OAAA,EAAS,IAAA;AAAA,EACT,gBAAA,EAAkB,IAAA;AAAA,EAClB,MAAA,EAAQ,IAAA;AAAA,EACR,MAAA,EAAQ,IAAA;AAAA,EACR,YAAA,EAAc,IAAA;AAAA,EACd,WAAA,EAAa,IAAA;AAAA,EACb,MAAA,EAAQ,IAAA;AAAA,EACR,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,IAAA;AAAA,EACV,aAAA,EAAe,IAAA;AAAA,EACf,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,IAAA;AAAA,EACV,SAAA,EAAW,IAAA;AAAA,EACX,SAAA,EAAW;AACb,CAAA;AAEO,MAAM,mCAAmC,MAAA,CAAO,IAAA;AAAA,EACrD;AACF;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../../src/components/propTypes/index.ts"],"sourcesContent":["import type { TextProps } from \"@/components/Text\";\nimport type { ButtonProps } from \"@/components/Button\";\nimport type { IconProps } from \"@/components/Icon\";\nimport type { LabelProps } from \"@/components/Label\";\nimport type { ContentProps } from \"@/components/Content\";\nimport type { LayoutCardProps } from \"@/components/LayoutCard\";\nimport type { LinkProps } from \"@/components/Link\";\nimport type { LightBoxProps } from \"@/components/LightBox\";\nimport type { FieldErrorProps } from \"@/components/FieldError\";\nimport type { FieldDescriptionProps } from \"@/components/FieldDescription\";\nimport type { AlertProps } from \"@/components/Alert\";\nimport type { HeadingProps } from \"@/components/Heading\";\nimport type { InitialsProps } from \"@/components/Initials\";\nimport type { ImageProps } from \"@/components/Image\";\nimport type { CopyButtonProps } from \"@/components/CopyButton\";\nimport type { HeaderProps } from \"@/components/Header/\";\nimport type { SwitchProps } from \"@/components/Switch\";\nimport type { AlertBadgeProps } from \"@/components/AlertBadge\";\nimport type { ActionGroupProps } from \"@/components/ActionGroup\";\nimport type { AvatarProps } from \"@/components/Avatar\";\nimport type { ActionProps } from \"@/components/Action\";\nimport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n MenuItemProps,\n} from \"@/components/ContextMenu\";\nimport type { SelectProps } from \"@/components/Select\";\nimport type {\n RadioButtonProps,\n RadioGroupProps,\n RadioProps,\n} from \"@/components/RadioGroup\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport type { NumberFieldProps } from \"@/components/NumberField\";\nimport type { TextAreaProps } from \"@/components/TextArea\";\nimport type { CheckboxGroupProps } from \"@/components/CheckboxGroup\";\nimport type { CheckboxProps } from \"@/components/Checkbox\";\nimport type { CheckboxButtonProps } from \"@/components/CheckboxButton\";\nimport type { TabsProps } from \"@/components/Tabs\";\nimport type { ModalProps } from \"@/components/Modal\";\nimport type { SectionProps } from \"@/components/Section\";\nimport type { SliderProps } from \"@/components/Slider\";\nimport type { CounterBadgeProps } from \"@/components/CounterBadge\";\nimport type { FlowComponentName } from \"@/components/propTypes/types\";\nimport type {\n ContextualHelpProps,\n ContextualHelpTriggerProps,\n} from \"@/components/ContextualHelp\";\nimport type { PopoverProps, PopoverTriggerProps } from \"@/components/Popover\";\nimport type { ContextMenuSectionProps } from \"@/components/ContextMenu/components/ContextMenuSection\";\nimport type { ListProps } from \"@/components/List\";\nimport type { PasswordCreationFieldProps } from \"@/components/PasswordCreationField\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { BadgeProps } from \"@/components/Badge\";\nimport type { DatePickerProps } from \"@/components/DatePicker\";\nimport type * as Aria from \"react-aria-components\";\nimport type { DateRangePickerProps } from \"@/components/DateRangePicker\";\nimport type { TimeFieldProps } from \"@/components/TimeField\";\nimport type { AlertIconProps } from \"@/components/AlertIcon\";\nimport type { ListSummaryProps } from \"@/components/List/components/ListSummary/ListSummary\";\nimport type { SegmentedControlProps } from \"@/components/SegmentedControl\";\nimport type { SegmentProps } from \"@/components/SegmentedControl/components/Segment\";\nimport type { FileCardProps } from \"@/components/FileCard\";\nimport type { FileFieldProps } from \"@/components/FileField\";\nimport type { AlignProps } from \"@/components/Align\";\nimport type { CountryOptionsProps } from \"src/components/CountryOptions\";\nimport type { ComboBoxProps } from \"@/components/ComboBox\";\nimport type { OptionProps } from \"@/components/Option\";\nimport type { MessageProps } from \"@/components/Message\";\nimport type { MessageThreadProps } from \"@/components/MessageThread\";\nimport type { FileCardListProps } from \"@/components/FileCardList\";\nimport type { AccentBoxProps } from \"@/components/AccentBox\";\nimport type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport type { MenuTriggerProps } from \"@/components/OverlayTrigger\";\nimport type { ProgressBarProps } from \"@/components/ProgressBar\";\nimport type { FileDropZoneProps } from \"@/components/FileDropZone\";\nimport type { NavigationProps } from \"@/components/Navigation\";\nimport type { NavigationGroupProps } from \"@/components/Navigation/components/NavigationGroup\";\nimport type { AutocompleteProps } from \"@/components/Autocomplete/Autocomplete\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport type { MarkdownEditorProps } from \"@/components/MarkdownEditor\";\nimport type { AlertTextProps } from \"@/components/AlertText\";\nimport type { IllustratedMessageProps } from \"@/components/IllustratedMessage\";\n\nexport * from \"./types\";\n\nexport interface FlowComponentPropsTypes {\n AccentBox: AccentBoxProps;\n Action: ActionProps;\n ActionGroup: ActionGroupProps;\n Alert: AlertProps;\n AlertBadge: AlertBadgeProps;\n AlertIcon: AlertIconProps;\n AlertText: AlertTextProps;\n Align: AlignProps;\n Avatar: AvatarProps;\n Autocomplete: AutocompleteProps;\n Badge: BadgeProps;\n Button: ButtonProps;\n Checkbox: CheckboxProps;\n CheckboxButton: CheckboxButtonProps;\n CheckboxGroup: CheckboxGroupProps;\n ColumnLayout: ColumnLayoutProps;\n ComboBox: ComboBoxProps;\n Content: ContentProps;\n ContextMenu: ContextMenuProps;\n ContextMenuSection: ContextMenuSectionProps;\n ContextMenuTrigger: ContextMenuTriggerProps;\n ContextualHelp: ContextualHelpProps;\n ContextualHelpTrigger: ContextualHelpTriggerProps;\n CopyButton: CopyButtonProps;\n CounterBadge: CounterBadgeProps;\n CountryOptions: CountryOptionsProps;\n DatePicker: DatePickerProps<Aria.DateValue>;\n DateRangePicker: DateRangePickerProps<Aria.DateValue>;\n FieldDescription: FieldDescriptionProps;\n FieldError: FieldErrorProps;\n FileCard: FileCardProps;\n FileCardList: FileCardListProps;\n FileField: FileFieldProps;\n FileDropZone: FileDropZoneProps;\n Header: HeaderProps;\n Heading: HeadingProps;\n Icon: IconProps;\n IllustratedMessage: IllustratedMessageProps;\n Image: ImageProps;\n Initials: InitialsProps;\n Label: LabelProps;\n LayoutCard: LayoutCardProps;\n LightBox: LightBoxProps;\n Link: LinkProps;\n List: ListProps<never>;\n ListSummary: ListSummaryProps;\n MarkdownEditor: MarkdownEditorProps;\n MenuItem: MenuItemProps;\n MenuTrigger: MenuTriggerProps;\n Message: MessageProps;\n MessageThread: MessageThreadProps;\n Modal: ModalProps;\n Navigation: NavigationProps;\n NavigationGroup: NavigationGroupProps;\n NumberField: NumberFieldProps;\n Option: OptionProps;\n Options: OptionsProps;\n Popover: PopoverProps;\n PopoverTrigger: PopoverTriggerProps;\n PasswordCreationField: PasswordCreationFieldProps;\n ProgressBar: ProgressBarProps;\n Radio: RadioProps;\n RadioButton: RadioButtonProps;\n RadioGroup: RadioGroupProps;\n SearchField: SearchFieldProps;\n Section: SectionProps;\n Segment: SegmentProps;\n SegmentedControl: SegmentedControlProps;\n Select: SelectProps;\n Slider: SliderProps;\n Switch: SwitchProps;\n Tabs: TabsProps;\n TabTitle: TabsProps;\n Text: TextProps;\n TextArea: TextAreaProps;\n TextField: TextFieldProps;\n TimeField: TimeFieldProps;\n}\n\nconst propsContextSupportingComponentsMap: Record<\n keyof FlowComponentPropsTypes,\n true\n> = {\n AccentBox: true,\n Action: true,\n ActionGroup: true,\n Avatar: true,\n Autocomplete: true,\n Alert: true,\n AlertBadge: true,\n AlertIcon: true,\n AlertText: true,\n Align: true,\n Badge: true,\n Button: true,\n Checkbox: true,\n CheckboxButton: true,\n CheckboxGroup: true,\n ColumnLayout: true,\n ComboBox: true,\n Content: true,\n ContextMenu: true,\n ContextMenuSection: true,\n ContextMenuTrigger: true,\n ContextualHelp: true,\n ContextualHelpTrigger: true,\n CopyButton: true,\n CounterBadge: true,\n CountryOptions: true,\n DatePicker: true,\n DateRangePicker: true,\n FieldDescription: true,\n FieldError: true,\n FileCard: true,\n FileCardList: true,\n FileField: true,\n FileDropZone: true,\n Header: true,\n Heading: true,\n Icon: true,\n IllustratedMessage: true,\n Image: true,\n Initials: true,\n Label: true,\n LayoutCard: true,\n LightBox: true,\n Link: true,\n List: true,\n ListSummary: true,\n MarkdownEditor: true,\n MenuItem: true,\n MenuTrigger: true,\n Message: true,\n MessageThread: true,\n Modal: true,\n Navigation: true,\n NavigationGroup: true,\n NumberField: true,\n Radio: true,\n Option: true,\n Options: true,\n Popover: true,\n PopoverTrigger: true,\n PasswordCreationField: true,\n ProgressBar: true,\n RadioButton: true,\n RadioGroup: true,\n SearchField: true,\n Section: true,\n Segment: true,\n SegmentedControl: true,\n Select: true,\n Slider: true,\n Switch: true,\n Tabs: true,\n TabTitle: true,\n TestComponent: true,\n Text: true,\n TextArea: true,\n TextField: true,\n TimeField: true,\n};\n\nexport const propsContextSupportingComponents = Object.keys(\n propsContextSupportingComponentsMap,\n) as FlowComponentName[];\n"],"names":[],"mappings":"AAsKA,MAAM,mCAAA,GAGF;AAAA,EACF,SAAA,EAAW,IAAA;AAAA,EACX,MAAA,EAAQ,IAAA;AAAA,EACR,WAAA,EAAa,IAAA;AAAA,EACb,MAAA,EAAQ,IAAA;AAAA,EACR,YAAA,EAAc,IAAA;AAAA,EACd,KAAA,EAAO,IAAA;AAAA,EACP,UAAA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AA;AAAA,EACV,WAAA,EAAa,IAAA;AAAA,EACb,OAAA,EAAS,IAAA;AAAA,EACT,aAAA,EAAe,IAAA;AAAA,EACf,KAAA,EAAO,IAAA;AAAA,EACP,UAAA,EAAY,IAAA;AAAA,EACZ,eAAA,EAAiB,IAAA;AAAA,EACjB,WAAA,EAAa,IAAA;AAAA,EACb,KAAA,EAAO,IAAA;AAAA,EACP,MAAA,EAAQ,IAAA;AAAA,EACR,OAAA,EAAS,IAAA;AAAA,EACT,OAAA,EAAS,IAAA;AAAA,EACT,cAAA,EAAgB,IAAA;AAAA,EAChB,qBAAA,EAAuB,IAAA;AAAA,EACvB,WAAA,EAAa,IAAA;AAAA,EACb,WAAA,EAAa,IAAA;AAAA,EACb,UAAA,EAAY,IAAA;AAAA,EACZ,WAAA,EAAa,IAAA;AAAA,EACb,OAAA,EAAS,IAAA;AAAA,EACT,OAAA,EAAS,IAAA;AAAA,EACT,gBAAA,EAAkB,IAAA;AAAA,EAClB,MAAA,EAAQ,IAAA;AAAA,EACR,MAAA,EAAQ,IAAA;AAAA,EACR,MAAA,EAAQ,IAAA;AAAA,EACR,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,IAAA;AAAA,EACV,aAAA,EAAe,IAAA;AAAA,EACf,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,IAAA;AAAA,EACV,SAAA,EAAW,IAAA;AAAA,EACX,SAAA,EAAW;AACb,CAAA;AAEO,MAAM,mCAAmC,MAAA,CAAO,IAAA;AAAA,EACrD;AACF;;;;"}
@@ -1,17 +1,15 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import { useFormContext } from '../context/formContext.mjs';
4
+ import { useFormContext } from '../FormContextProvider/FormContextProvider.mjs';
5
5
  import { dynamic } from '../../../../lib/propsContext/dynamicProps/dynamic.mjs';
6
6
  import '../../../../lib/propsContext/propsContext.mjs';
7
7
  import { PropsContextProvider } from '../../../../lib/propsContext/components/PropsContextProvider.mjs';
8
8
  import 'react';
9
9
  import { useController, useWatch } from 'react-hook-form';
10
- import { useHotkeys } from 'react-hotkeys-hook';
11
10
  import { useLocalizedStringFormatter } from 'react-aria';
12
11
  import locales from '../../../../../../_virtual/_.locale.json@72ba2ce40f190df671686fec50c04ddf.mjs';
13
12
  import FieldErrorView from '../../../../views/FieldErrorView.mjs';
14
- import { mergeRefs } from '@react-aria/utils';
15
13
 
16
14
  function Field(props) {
17
15
  const { children, name, defaultValue, ...rest } = props;
@@ -40,20 +38,8 @@ function Field(props) {
40
38
  name
41
39
  }) ?? controller.field.value;
42
40
  const isFieldInvalid = controller.fieldState.invalid;
43
- const hotkeyRef = useHotkeys(
44
- "mod+enter",
45
- () => {
46
- formContext.submit();
47
- },
48
- {
49
- enableOnFormTags: true,
50
- enableOnContentEditable: true
51
- }
52
- );
53
- const refWithHotkey = mergeRefs(controller.field.ref, hotkeyRef);
54
41
  const fieldProps = {
55
42
  ...controller.field,
56
- ref: refWithHotkey,
57
43
  value,
58
44
  name,
59
45
  form: formContext.id,
@@ -1 +1 @@
1
- {"version":3,"file":"Field.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport { dynamic, type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useHotkeys } from \"react-hotkeys-hook\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport { mergeRefs } from \"@react-aria/utils\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">,\n PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n\n const hotkeyRef = useHotkeys<never>(\n \"mod+enter\",\n () => {\n formContext.submit();\n },\n {\n enableOnFormTags: true,\n enableOnContentEditable: true,\n },\n );\n\n const refWithHotkey = mergeRefs(controller.field.ref, hotkeyRef);\n\n const fieldProps = {\n ...controller.field,\n ref: refWithHotkey,\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isReadOnly: formContext.isReadOnly,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }),\n };\n\n const propsContext: PropsContext = {\n Autocomplete: {\n SearchField: fieldProps,\n TextField: fieldProps,\n },\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldProps,\n selectedKey: value,\n },\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n controller.fieldState,\n controller.field,\n value,\n formContext.isReadOnly,\n ]}\n >\n {children}\n </PropsContextProvider>\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T> | UseFormReturn<T>[\"control\"],\n): typeof Field<T> => Field;\n\nexport default Field;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAqBO,SAAS,MAA6B,KAAA,EAAsB;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,GAAG,MAAK,GAAI,KAAA;AAElD,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,MAAM,aAAa,aAAA,CAAc;AAAA,IAC/B,GAAG,KAAA;AAAA,IACH,KAAA,EAAO;AAAA,MACL,GAAG,KAAA,CAAM,KAAA;AAAA,MACT,SAAA,EACE,OAAO,IAAA,CAAK,KAAA,EAAO,cAAc,QAAA,GAC7B;AAAA,QACE,KAAA,EAAO,KAAK,KAAA,CAAM,SAAA;AAAA,QAClB,OAAA,EAAS,eAAA,CAAgB,MAAA,CAAO,WAAA,EAAa;AAAA,UAC3C,MAAA,EAAQ,KAAK,KAAA,CAAM;AAAA,SACpB;AAAA,OACH,GACA,KAAK,KAAA,EAAO,SAAA;AAAA,MAClB,SAAA,EACE,OAAO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;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,YAAA;AAAA,MACP,YAAA,EAAc;AAAA,QACZ,UAAA,CAAW,UAAA;AAAA,QACX,UAAA,CAAW,KAAA;AAAA,QACX,KAAA;AAAA,QACA,WAAA,CAAY;AAAA,OACd;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AAEO,MAAM,UAAA,GAAa,CACxB,WAAA,KACoB;;;;"}
1
+ {"version":3,"file":"Field.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport { dynamic, type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">,\n PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext();\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n\n const fieldProps = {\n ...controller.field,\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isReadOnly: formContext.isReadOnly,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }),\n };\n\n const propsContext: PropsContext = {\n Autocomplete: {\n SearchField: fieldProps,\n TextField: fieldProps,\n },\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldProps,\n selectedKey: value,\n },\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n controller.fieldState,\n controller.field,\n value,\n formContext.isReadOnly,\n ]}\n >\n {children}\n </PropsContextProvider>\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T> | UseFormReturn<T>[\"control\"],\n): typeof Field<T> => Field;\n\nexport default Field;\n"],"names":[],"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;AAAA,IACZ,eAAA,EAAiB,UAAA;AAAA,IACjB,SAAA,EAAW,UAAA;AAAA,IACX,gBAAA,EAAkB,UAAA;AAAA,IAClB,MAAA,EAAQ;AAAA,MACN,GAAG,UAAA;AAAA,MACH,WAAA,EAAa;AAAA,KACf;AAAA,IACA,QAAA,EAAU;AAAA,MACR,GAAG,UAAA;AAAA,MACH,WAAA,EAAa;AAAA;AACf,GACF;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,YAAA;AAAA,MACP,YAAA,EAAc;AAAA,QACZ,UAAA,CAAW,UAAA;AAAA,QACX,UAAA,CAAW,KAAA;AAAA,QACX,KAAA;AAAA,QACA,WAAA,CAAY;AAAA,OACd;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AAEO,MAAM,UAAA,GAAa,CACxB,WAAA,KACoB;;;;"}
@@ -1,10 +1,10 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { jsx } from 'react/jsx-runtime';
4
- import { FormContextProvider } from '../context/formContext.mjs';
5
- import { useState, useId, useMemo, useRef } from 'react';
4
+ import { useHotkeySubmit } from './useHotkeySubmit.mjs';
5
+ import { FormContextProvider } from '../FormContextProvider/FormContextProvider.mjs';
6
+ import { useId, useMemo } from 'react';
6
7
  import { FormProvider } from 'react-hook-form';
7
- import { useRegisterActionStateContext } from './lib/useRegisterActionStateContext.mjs';
8
8
 
9
9
  const DefaultFormComponent = (p) => /* @__PURE__ */ jsx("form", { ...p });
10
10
  function Form(props) {
@@ -12,52 +12,35 @@ function Form(props) {
12
12
  form,
13
13
  children,
14
14
  onSubmit,
15
- formComponent: FormView = DefaultFormComponent,
16
- isReadOnly: isReadOnlyFromProps,
15
+ formComponent = DefaultFormComponent,
16
+ isReadOnly,
17
17
  ref,
18
+ id: idProp,
18
19
  ...formProps
19
20
  } = props;
20
- const [readonlyContextState, setReadOnlyContextState] = useState(!!isReadOnlyFromProps);
21
- const formId = useId();
22
- const FormViewComponent = useMemo(() => FormView, [formId]);
23
- const submitButtonRef = useRef(null);
24
- const isReadOnly = isReadOnlyFromProps || readonlyContextState;
25
- const { action, registerSubmitResult } = useRegisterActionStateContext(form);
21
+ const newFormId = useId();
22
+ const formId = idProp ?? newFormId;
23
+ const FormComponent = useMemo(() => formComponent, [formId]);
26
24
  const handleSubmit = (e) => {
27
- const { isSubmitting, isValidating } = form.control._formState;
28
25
  const formEvent = e && "nativeEvent" in e ? e : void 0;
29
26
  formEvent?.stopPropagation();
30
- if (isSubmitting || isValidating) {
31
- formEvent?.preventDefault();
32
- return;
33
- }
34
- const submit = form.handleSubmit((values) => {
35
- setReadOnlyContextState(true);
36
- const result = onSubmit(values, formEvent);
37
- registerSubmitResult(result);
38
- return result;
39
- });
40
- return submit(formEvent).finally(() => {
41
- setReadOnlyContextState(false);
42
- });
27
+ return form.handleSubmit(onSubmit)(formEvent);
43
28
  };
29
+ const refWithHotkeySubmit = useHotkeySubmit({
30
+ ref,
31
+ handleSubmit
32
+ });
44
33
  return /* @__PURE__ */ jsx(FormProvider, { ...form, children: /* @__PURE__ */ jsx(
45
34
  FormContextProvider,
46
35
  {
47
- value: {
48
- form,
49
- id: formId,
50
- isReadOnly,
51
- setReadOnly: setReadOnlyContextState,
52
- submit: handleSubmit,
53
- submitButtonRef,
54
- formActionModel: action
55
- },
36
+ form,
37
+ isReadOnly,
38
+ id: formId,
56
39
  children: /* @__PURE__ */ jsx(
57
- FormViewComponent,
40
+ FormComponent,
58
41
  {
59
42
  ...formProps,
60
- ref,
43
+ ref: refWithHotkeySubmit,
61
44
  id: formId,
62
45
  onSubmit: handleSubmit,
63
46
  children
@@ -1 +1 @@
1
- {"version":3,"file":"Form.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"sourcesContent":["import { FormContextProvider } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport {\n type ComponentProps,\n type FC,\n type FormEvent,\n type FormEventHandler,\n type PropsWithChildren,\n type Ref,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type {\n FieldValues,\n SubmitHandler,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { FormProvider as RhfFormContextProvider } from \"react-hook-form\";\nimport { useRegisterActionStateContext } from \"@/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext\";\n\nexport type FormOnSubmitHandler<F extends FieldValues> = SubmitHandler<F>;\n\ntype FormComponentType = FC<\n PropsWithChildren<{\n id: string;\n onSubmit?: FormEventHandler | FormOnSubmitHandler<never>;\n ref?: Ref<HTMLFormElement>;\n }>\n>;\n\nexport interface FormProps<F extends FieldValues>\n extends Omit<ComponentProps<\"form\">, \"onSubmit\">,\n PropsWithChildren {\n form: UseFormReturn<F>;\n onSubmit: FormOnSubmitHandler<F>;\n formComponent?: FC<Omit<FormComponentType, \"ref\">>;\n isReadOnly?: boolean;\n}\n\nconst DefaultFormComponent: FormComponentType = (p) => <form {...p} />;\n\nexport function Form<F extends FieldValues>(props: FormProps<F>) {\n const {\n form,\n children,\n onSubmit,\n formComponent: FormView = DefaultFormComponent,\n isReadOnly: isReadOnlyFromProps,\n ref,\n ...formProps\n } = props;\n\n const [readonlyContextState, setReadOnlyContextState] =\n useState(!!isReadOnlyFromProps);\n\n const formId = useId();\n const FormViewComponent = useMemo(() => FormView, [formId]);\n\n const submitButtonRef = useRef<HTMLButtonElement>(null);\n\n const isReadOnly = isReadOnlyFromProps || readonlyContextState;\n const { action, registerSubmitResult } = useRegisterActionStateContext(form);\n\n const handleSubmit = (e?: FormEvent<HTMLFormElement> | F) => {\n const { isSubmitting, isValidating } = form.control._formState;\n const formEvent =\n e && \"nativeEvent\" in e ? (e as FormEvent<HTMLFormElement>) : undefined;\n\n formEvent?.stopPropagation();\n\n if (isSubmitting || isValidating) {\n formEvent?.preventDefault();\n return;\n }\n\n const submit = form.handleSubmit((values) => {\n setReadOnlyContextState(true);\n const result = onSubmit(values, formEvent);\n registerSubmitResult(result);\n return result;\n });\n\n return submit(formEvent).finally(() => {\n setReadOnlyContextState(false);\n });\n };\n\n return (\n <RhfFormContextProvider {...form}>\n <FormContextProvider\n value={{\n form,\n id: formId,\n isReadOnly,\n setReadOnly: setReadOnlyContextState,\n submit: handleSubmit,\n submitButtonRef: submitButtonRef,\n formActionModel: action,\n }}\n >\n <FormViewComponent\n {...formProps}\n ref={ref}\n id={formId}\n onSubmit={handleSubmit}\n >\n {children}\n </FormViewComponent>\n </FormContextProvider>\n </RhfFormContextProvider>\n );\n}\n\nexport default Form;\n"],"names":["RhfFormContextProvider"],"mappings":";;;;;;AAwCA,MAAM,uBAA0C,CAAC,CAAA,qBAAM,GAAA,CAAC,MAAA,EAAA,EAAM,GAAG,CAAA,EAAG,CAAA;AAE7D,SAAS,KAA4B,KAAA,EAAqB;AAC/D,EAAA,MAAM;AAAA,IACJ,IAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAe,QAAA,GAAW,oBAAA;AAAA,IAC1B,UAAA,EAAY,mBAAA;AAAA,IACZ,GAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,CAAC,oBAAA,EAAsB,uBAAuB,IAClD,QAAA,CAAS,CAAC,CAAC,mBAAmB,CAAA;AAEhC,EAAA,MAAM,SAAS,KAAA,EAAM;AACrB,EAAA,MAAM,oBAAoB,OAAA,CAAQ,MAAM,QAAA,EAAU,CAAC,MAAM,CAAC,CAAA;AAE1D,EAAA,MAAM,eAAA,GAAkB,OAA0B,IAAI,CAAA;AAEtD,EAAA,MAAM,aAAa,mBAAA,IAAuB,oBAAA;AAC1C,EAAA,MAAM,EAAE,MAAA,EAAQ,oBAAA,EAAqB,GAAI,8BAA8B,IAAI,CAAA;AAE3E,EAAA,MAAM,YAAA,GAAe,CAAC,CAAA,KAAuC;AAC3D,IAAA,MAAM,EAAE,YAAA,EAAc,YAAA,EAAa,GAAI,KAAK,OAAA,CAAQ,UAAA;AACpD,IAAA,MAAM,SAAA,GACJ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esContent":["import { useHotkeySubmit } from \"@/integrations/react-hook-form/components/Form/useHotkeySubmit\";\nimport { FormContextProvider } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport {\n type ComponentProps,\n type FC,\n type FormEvent,\n type FormEventHandler,\n type PropsWithChildren,\n type Ref,\n useId,\n useMemo,\n} from \"react\";\nimport type {\n FieldValues,\n SubmitHandler,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { FormProvider as RhfFormContextProvider } from \"react-hook-form\";\n\nexport type FormOnSubmitHandler<F extends FieldValues> = SubmitHandler<F>;\n\ntype FormComponentType = FC<\n PropsWithChildren<{\n id: string;\n onSubmit?: FormEventHandler | FormOnSubmitHandler<never>;\n ref?: Ref<HTMLFormElement>;\n }>\n>;\n\nexport interface FormProps<F extends FieldValues>\n extends Omit<ComponentProps<\"form\">, \"onSubmit\">,\n PropsWithChildren {\n form: UseFormReturn<F>;\n onSubmit: FormOnSubmitHandler<F>;\n formComponent?: FC<Omit<FormComponentType, \"ref\">>;\n isReadOnly?: boolean;\n}\n\nconst DefaultFormComponent: FormComponentType = (p) => <form {...p} />;\n\nexport function Form<F extends FieldValues>(props: FormProps<F>) {\n const {\n form,\n children,\n onSubmit,\n formComponent = DefaultFormComponent,\n isReadOnly,\n ref,\n id: idProp,\n ...formProps\n } = props;\n\n const newFormId = useId();\n const formId = idProp ?? newFormId;\n const FormComponent = useMemo(() => formComponent, [formId]);\n\n const handleSubmit = (e?: FormEvent | F) => {\n const formEvent = e && \"nativeEvent\" in e ? (e as FormEvent) : undefined;\n formEvent?.stopPropagation();\n return form.handleSubmit(onSubmit)(formEvent);\n };\n\n const refWithHotkeySubmit = useHotkeySubmit({\n ref,\n handleSubmit,\n });\n\n return (\n <RhfFormContextProvider {...form}>\n <FormContextProvider\n form={form as UseFormReturn}\n isReadOnly={isReadOnly}\n id={formId}\n >\n <FormComponent\n {...formProps}\n ref={refWithHotkeySubmit}\n id={formId}\n onSubmit={handleSubmit}\n >\n {children}\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A,EAAK,mBAAA;AAAA,UACL,EAAA,EAAI,MAAA;AAAA,UACJ,QAAA,EAAU,YAAA;AAAA,UAET;AAAA;AAAA;AACH;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,19 @@
1
+ "use client"
2
+ /* */
3
+ import { useObjectRef } from 'react-aria';
4
+ import { useHotkeys } from 'react-hotkeys-hook';
5
+ import { useMergeRefs } from 'use-callback-ref';
6
+
7
+ const useHotkeySubmit = (options) => {
8
+ const { ref, handleSubmit } = options;
9
+ return useMergeRefs([
10
+ useObjectRef(ref),
11
+ useHotkeys("mod+enter", handleSubmit, {
12
+ enableOnFormTags: true,
13
+ enableOnContentEditable: true
14
+ })
15
+ ]);
16
+ };
17
+
18
+ export { useHotkeySubmit };
19
+ //# sourceMappingURL=useHotkeySubmit.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHotkeySubmit.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Form/useHotkeySubmit.ts"],"sourcesContent":["import type { Ref } from \"react\";\nimport { useObjectRef } from \"react-aria\";\nimport { useHotkeys } from \"react-hotkeys-hook\";\nimport { useMergeRefs } from \"use-callback-ref\";\n\ninterface Options {\n ref: Ref<HTMLFormElement> | undefined;\n handleSubmit: () => void;\n}\n\nexport const useHotkeySubmit = (options: Options) => {\n const { ref, handleSubmit } = options;\n\n return useMergeRefs([\n useObjectRef(ref),\n useHotkeys<never>(\"mod+enter\", handleSubmit, {\n enableOnFormTags: true,\n enableOnContentEditable: true,\n }),\n ]);\n};\n"],"names":[],"mappings":";;;;AAUO,MAAM,eAAA,GAAkB,CAAC,OAAA,KAAqB;AACnD,EAAA,MAAM,EAAE,GAAA,EAAK,YAAA,EAAa,GAAI,OAAA;AAE9B,EAAA,OAAO,YAAA,CAAa;AAAA,IAClB,aAAa,GAAG,CAAA;AAAA,IAChB,UAAA,CAAkB,aAAa,YAAA,EAAc;AAAA,MAC3C,gBAAA,EAAkB,IAAA;AAAA,MAClB,uBAAA,EAAyB;AAAA,KAC1B;AAAA,GACF,CAAA;AACH;;;;"}
@@ -0,0 +1,42 @@
1
+ "use client"
2
+ /* */
3
+ import { jsx } from 'react/jsx-runtime';
4
+ import { createContext, useContext, useState } from 'react';
5
+ import invariant from 'invariant';
6
+ import { useFormSubmitAction } from './useFormSubmitAction.mjs';
7
+
8
+ const FormContext = createContext(void 0);
9
+ const FormContextProvider = (props) => {
10
+ const { form, id, isReadOnly: isReadOnlyProp = false, children } = props;
11
+ const [isReadOnlyState, setReadOnly] = useState(isReadOnlyProp);
12
+ const isReadOnly = isReadOnlyProp || isReadOnlyState;
13
+ const formSubmitAction = useFormSubmitAction({
14
+ form,
15
+ setReadOnly
16
+ });
17
+ return /* @__PURE__ */ jsx(
18
+ FormContext,
19
+ {
20
+ value: {
21
+ isReadOnly,
22
+ setReadOnly,
23
+ id,
24
+ form,
25
+ formSubmitAction
26
+ },
27
+ children
28
+ }
29
+ );
30
+ };
31
+ const useFormContext = () => {
32
+ const ctx = useOptionalFormContext();
33
+ invariant(
34
+ !!ctx,
35
+ "Could not useFormContext() outside a Form, or multiple versions of Flow installed."
36
+ );
37
+ return ctx;
38
+ };
39
+ const useOptionalFormContext = () => useContext(FormContext);
40
+
41
+ export { FormContext, FormContextProvider, FormContextProvider as default, useFormContext, useOptionalFormContext };
42
+ //# sourceMappingURL=FormContextProvider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormContextProvider.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.tsx"],"sourcesContent":["import type { UseFormReturn } from \"react-hook-form\";\nimport {\n createContext,\n useContext,\n useState,\n type Dispatch,\n type PropsWithChildren,\n type SetStateAction,\n} from \"react\";\nimport type { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport invariant from \"invariant\";\nimport { useFormSubmitAction } from \"@/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction\";\n\ninterface FormContext {\n form: UseFormReturn;\n id: string;\n isReadOnly: boolean;\n setReadOnly: Dispatch<SetStateAction<boolean>>;\n formSubmitAction: ActionModel;\n}\n\nexport const FormContext = createContext<FormContext | undefined>(undefined);\n\nexport interface FormContextProviderProps extends PropsWithChildren {\n form: UseFormReturn;\n id: string;\n isReadOnly?: boolean;\n}\n\nexport const FormContextProvider = (props: FormContextProviderProps) => {\n const { form, id, isReadOnly: isReadOnlyProp = false, children } = props;\n\n const [isReadOnlyState, setReadOnly] = useState(isReadOnlyProp);\n const isReadOnly = isReadOnlyProp || isReadOnlyState;\n\n const formSubmitAction = useFormSubmitAction({\n form,\n setReadOnly,\n });\n\n return (\n <FormContext\n value={{\n isReadOnly,\n setReadOnly,\n id,\n form,\n formSubmitAction,\n }}\n >\n {children}\n </FormContext>\n );\n};\n\nexport const useFormContext = () => {\n const ctx = useOptionalFormContext();\n invariant(\n !!ctx,\n \"Could not useFormContext() outside a Form, or multiple versions of Flow installed.\",\n );\n return ctx;\n};\n\nexport const useOptionalFormContext = () => useContext(FormContext);\n\nexport default FormContextProvider;\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,WAAA,GAAc,cAAuC,MAAS;AAQpE,MAAM,mBAAA,GAAsB,CAAC,KAAA,KAAoC;AACtE,EAAA,MAAM,EAAE,IAAA,EAAM,EAAA,EAAI,YAAY,cAAA,GAAiB,KAAA,EAAO,UAAS,GAAI,KAAA;AAEnE,EAAA,MAAM,CAAC,eAAA,EAAiB,WAAW,CAAA,GAAI,SAAS,cAAc,CAAA;AAC9D,EAAA,MAAM,aAAa,cAAA,IAAkB,eAAA;AAErC,EAAA,MAAM,mBAAmB,mBAAA,CAAoB;AAAA,IAC3C,IAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO;AAAA,QACL,UAAA;AAAA,QACA,WAAA;AAAA,QACA,EAAA;AAAA,QACA,IAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AAEO,MAAM,iBAAiB,MAAM;AAClC,EAAA,MAAM,MAAM,sBAAA,EAAuB;AACnC,EAAA,SAAA;AAAA,IACE,CAAC,CAAC,GAAA;AAAA,IACF;AAAA,GACF;AACA,EAAA,OAAO,GAAA;AACT;AAEO,MAAM,sBAAA,GAAyB,MAAM,UAAA,CAAW,WAAW;;;;"}
@@ -0,0 +1,37 @@
1
+ "use client"
2
+ /* */
3
+ import { ActionModel } from '../../../../components/Action/models/ActionModel.mjs';
4
+ import { useRef, useEffect } from 'react';
5
+
6
+ const useFormSubmitAction = (options) => {
7
+ const { form, setReadOnly } = options;
8
+ const formSubmitAction = ActionModel.useNew({});
9
+ const { isSubmitting, isSubmitted, isSubmitSuccessful } = form.formState;
10
+ const wasSubmitting = useRef(isSubmitting);
11
+ useEffect(() => {
12
+ const submittingDone = wasSubmitting.current && !isSubmitting;
13
+ wasSubmitting.current = isSubmitting;
14
+ if (isSubmitting) {
15
+ setReadOnly(true);
16
+ formSubmitAction.state.onAsyncStart();
17
+ } else if (submittingDone) {
18
+ if (isSubmitSuccessful) {
19
+ formSubmitAction.state.onSucceeded();
20
+ } else {
21
+ formSubmitAction.state.onFailed(new Error("Form submission failed"));
22
+ }
23
+ setReadOnly(false);
24
+ }
25
+ }, [
26
+ wasSubmitting,
27
+ isSubmitting,
28
+ isSubmitted,
29
+ isSubmitSuccessful,
30
+ formSubmitAction,
31
+ setReadOnly
32
+ ]);
33
+ return formSubmitAction;
34
+ };
35
+
36
+ export { useFormSubmitAction };
37
+ //# sourceMappingURL=useFormSubmitAction.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormSubmitAction.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.ts"],"sourcesContent":["import { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport { useEffect, useRef } from \"react\";\nimport type { UseFormReturn } from \"react-hook-form\";\n\ninterface Options {\n form: UseFormReturn;\n setReadOnly: (isReadOnly: boolean) => void;\n}\n\nexport const useFormSubmitAction = (options: Options) => {\n const { form, setReadOnly } = options;\n\n const formSubmitAction = ActionModel.useNew({});\n\n const { isSubmitting, isSubmitted, isSubmitSuccessful } = form.formState;\n const wasSubmitting = useRef(isSubmitting);\n\n useEffect(() => {\n const submittingDone = wasSubmitting.current && !isSubmitting;\n wasSubmitting.current = isSubmitting;\n\n if (isSubmitting) {\n setReadOnly(true);\n formSubmitAction.state.onAsyncStart();\n } else if (submittingDone) {\n if (isSubmitSuccessful) {\n formSubmitAction.state.onSucceeded();\n } else {\n formSubmitAction.state.onFailed(new Error(\"Form submission failed\"));\n }\n setReadOnly(false);\n }\n }, [\n wasSubmitting,\n isSubmitting,\n isSubmitted,\n isSubmitSuccessful,\n formSubmitAction,\n setReadOnly,\n ]);\n\n return formSubmitAction;\n};\n"],"names":[],"mappings":";;;AASO,MAAM,mBAAA,GAAsB,CAAC,OAAA,KAAqB;AACvD,EAAA,MAAM,EAAE,IAAA,EAAM,WAAA,EAAY,GAAI,OAAA;AAE9B,EAAA,MAAM,gBAAA,GAAmB,WAAA,CAAY,MAAA,CAAO,EAAE,CAAA;AAE9C,EAAA,MAAM,EAAE,YAAA,EAAc,WAAA,EAAa,kBAAA,KAAuB,IAAA,CAAK,SAAA;AAC/D,EAAA,MAAM,aAAA,GAAgB,OAAO,YAAY,CAAA;AAEzC,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,cAAA,GAAiB,aAAA,CAAc,OAAA,IAAW,CAAC,YAAA;AACjD,IAAA,aAAA,CAAc,OAAA,GAAU,YAAA;AAExB,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,WAAA,CAAY,IAAI,CAAA;AAChB,MAAA,gBAAA,CAAiB,MAAM,YAAA,EAAa;AAAA,IACtC,WAAW,cAAA,EAAgB;AACzB,MAAA,IAAI,kBAAA,EAAoB;AACtB,QAAA,gBAAA,CAAiB,MAAM,WAAA,EAAY;AAAA,MACrC,CAAA,MAAO;AACL,QAAA,gBAAA,CAAiB,KAAA,CAAM,QAAA,CAAS,IAAI,KAAA,CAAM,wBAAwB,CAAC,CAAA;AAAA,MACrE;AACA,MAAA,WAAA,CAAY,KAAK,CAAA;AAAA,IACnB;AAAA,EACF,CAAA,EAAG;AAAA,IACD,aAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,kBAAA;AAAA,IACA,gBAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,OAAO,gBAAA;AACT;;;;"}
@@ -0,0 +1,17 @@
1
+ "use client"
2
+ /* */
3
+ import { jsx } from 'react/jsx-runtime';
4
+ import { Action } from '../../../../components/Action/Action.mjs';
5
+ import 'react-aria';
6
+ import 'react';
7
+ import '@react-aria/live-announcer';
8
+ import { useFormContext } from '../FormContextProvider/FormContextProvider.mjs';
9
+
10
+ const FormSubmitAction = (props) => {
11
+ const { children } = props;
12
+ const action = useFormContext().formSubmitAction;
13
+ return /* @__PURE__ */ jsx(Action, { actionModel: action, children });
14
+ };
15
+
16
+ export { FormSubmitAction, FormSubmitAction as default };
17
+ //# sourceMappingURL=FormSubmitAction.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormSubmitAction.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/FormSubmitAction/FormSubmitAction.tsx"],"sourcesContent":["import Action from \"@/components/Action\";\nimport { useFormContext } from \"@/integrations/react-hook-form/components/FormContextProvider\";\nimport type { FC, PropsWithChildren } from \"react\";\n\nexport const FormSubmitAction: FC<PropsWithChildren> = (props) => {\n const { children } = props;\n const action = useFormContext().formSubmitAction;\n return <Action actionModel={action}>{children}</Action>;\n};\n\nexport default FormSubmitAction;\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,gBAAA,GAA0C,CAAC,KAAA,KAAU;AAChE,EAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AACrB,EAAA,MAAM,MAAA,GAAS,gBAAe,CAAE,gBAAA;AAChC,EAAA,uBAAO,GAAA,CAAC,MAAA,EAAA,EAAO,WAAA,EAAa,MAAA,EAAS,QAAA,EAAS,CAAA;AAChD;;;;"}