@powerhousedao/design-system 6.0.0-dev.196 → 6.0.0-dev.197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{button-CRGaTu1H.d.ts → button-C8doazjv.d.ts} +1 -1
- package/dist/{button-CRGaTu1H.d.ts.map → button-C8doazjv.d.ts.map} +1 -1
- package/dist/{character-counter-sqhtpnM2.d.ts → character-counter-BWoglM2P.d.ts} +1 -1
- package/dist/{character-counter-sqhtpnM2.d.ts.map → character-counter-BWoglM2P.d.ts.map} +1 -1
- package/dist/{checkbox-WQJ1ELix.d.ts → checkbox-BueZ7Wg_.d.ts} +3 -3
- package/dist/{checkbox-WQJ1ELix.d.ts.map → checkbox-BueZ7Wg_.d.ts.map} +1 -1
- package/dist/{checkbox-base-kQOLgBSw.d.ts → checkbox-base-CZo-4eL0.d.ts} +1 -1
- package/dist/{checkbox-base-kQOLgBSw.d.ts.map → checkbox-base-CZo-4eL0.d.ts.map} +1 -1
- package/dist/{command-BVb5bGtc.d.ts → command--QCHwqST.d.ts} +8 -8
- package/dist/{command-BVb5bGtc.d.ts.map → command--QCHwqST.d.ts.map} +1 -1
- package/dist/connect/components/toast/toast.d.ts +16 -0
- package/dist/connect/components/toast/toast.d.ts.map +1 -0
- package/dist/connect/components/toast/toast.js +71 -0
- package/dist/connect/components/toast/toast.js.map +1 -0
- package/dist/connect/index.d.ts +3 -3
- package/dist/connect/index.js +3 -2
- package/dist/{connect-CrXsa33f.js → connect-D2wTJ-7r.js} +36 -366
- package/dist/connect-D2wTJ-7r.js.map +1 -0
- package/dist/{content-B-HaysyU.d.ts → content-DFFfr1mk.d.ts} +2 -2
- package/dist/{content-B-HaysyU.d.ts.map → content-DFFfr1mk.d.ts.map} +1 -1
- package/dist/document-timeline-FWiQhfIq.js +288 -0
- package/dist/document-timeline-FWiQhfIq.js.map +1 -0
- package/dist/{enum-field-gjkjO_WS.d.ts → enum-field-CBFI4x1f.d.ts} +4 -4
- package/dist/{enum-field-gjkjO_WS.d.ts.map → enum-field-CBFI4x1f.d.ts.map} +1 -1
- package/dist/{form-C1QA8m1k.d.ts → form-CKRKn0TQ.d.ts} +1 -1
- package/dist/{form-C1QA8m1k.d.ts.map → form-CKRKn0TQ.d.ts.map} +1 -1
- package/dist/{form-description-CJVMogCL.d.ts → form-description-CYkcMEzm.d.ts} +1 -1
- package/dist/{form-description-CJVMogCL.d.ts.map → form-description-CYkcMEzm.d.ts.map} +1 -1
- package/dist/{form-group-BDgpr5u8.d.ts → form-group-C8kL6pdZ.d.ts} +1 -1
- package/dist/form-group-C8kL6pdZ.d.ts.map +1 -0
- package/dist/{form-label-CCANBlbG.d.ts → form-label-b6nQi0XO.d.ts} +1 -1
- package/dist/{form-label-CCANBlbG.d.ts.map → form-label-b6nQi0XO.d.ts.map} +1 -1
- package/dist/{form-message-TYsO9BYM.d.ts → form-message-Dq72nBXz.d.ts} +1 -1
- package/dist/{form-message-TYsO9BYM.d.ts.map → form-message-Dq72nBXz.d.ts.map} +1 -1
- package/dist/{form-server-error-message-DM79ceCA.d.ts → form-server-error-message-DXbaiTfF.d.ts} +1 -1
- package/dist/{form-server-error-message-DM79ceCA.d.ts.map → form-server-error-message-DXbaiTfF.d.ts.map} +1 -1
- package/dist/{id-autocomplete-BafWC9wr.d.ts → id-autocomplete-CLC7zy-f.d.ts} +2 -2
- package/dist/{id-autocomplete-BafWC9wr.d.ts.map → id-autocomplete-CLC7zy-f.d.ts.map} +1 -1
- package/dist/{id-autocomplete-input-container-DxxI5DR6.d.ts → id-autocomplete-input-container-DsLTOkaT.d.ts} +2 -2
- package/dist/{id-autocomplete-input-container-DxxI5DR6.d.ts.map → id-autocomplete-input-container-DsLTOkaT.d.ts.map} +1 -1
- package/dist/{id-autocomplete-list-BHBavDro.d.ts → id-autocomplete-list-CFWHGDwL.d.ts} +2 -2
- package/dist/{id-autocomplete-list-BHBavDro.d.ts.map → id-autocomplete-list-CFWHGDwL.d.ts.map} +1 -1
- package/dist/{id-autocomplete-list-option-DlFexoVY.d.ts → id-autocomplete-list-option-fOnxSbzb.d.ts} +2 -2
- package/dist/{id-autocomplete-list-option-DlFexoVY.d.ts.map → id-autocomplete-list-option-fOnxSbzb.d.ts.map} +1 -1
- package/dist/{index-CuSjRT5A.d.ts → index-B6YyDoT1.d.ts} +1 -1
- package/dist/{index-CuSjRT5A.d.ts.map → index-B6YyDoT1.d.ts.map} +1 -1
- package/dist/{index-C37KRTG6.d.ts → index-U9etrdGX.d.ts} +3 -15
- package/dist/index-U9etrdGX.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{input-Bl0zw1zI.d.ts → input-BpEQjaWV.d.ts} +1 -1
- package/dist/{input-Bl0zw1zI.d.ts.map → input-BpEQjaWV.d.ts.map} +1 -1
- package/dist/{json-viewer-B5JtYTX7.d.ts → json-viewer-DaTgmzkS.d.ts} +1 -1
- package/dist/{json-viewer-B5JtYTX7.d.ts.map → json-viewer-DaTgmzkS.d.ts.map} +1 -1
- package/dist/{message-list-BZ9ku5cz.d.ts → message-list-C4mPpBBa.d.ts} +2 -2
- package/dist/{message-list-BZ9ku5cz.d.ts.map → message-list-C4mPpBBa.d.ts.map} +1 -1
- package/dist/{popover-CD29J7Ou.d.ts → popover-XSBOuSih.d.ts} +1 -1
- package/dist/{popover-CD29J7Ou.d.ts.map → popover-XSBOuSih.d.ts.map} +1 -1
- package/dist/{radio-9EYSHlFT.d.ts → radio-eL0Oy86J.d.ts} +1 -1
- package/dist/{radio-9EYSHlFT.d.ts.map → radio-eL0Oy86J.d.ts.map} +1 -1
- package/dist/{radio-group-BT-3-R48.d.ts → radio-group-Bkli6nUz.d.ts} +1 -1
- package/dist/{radio-group-BT-3-R48.d.ts.map → radio-group-Bkli6nUz.d.ts.map} +1 -1
- package/dist/{radio-group-field-BeQEWaTA.d.ts → radio-group-field-z7q-PVyY.d.ts} +2 -2
- package/dist/{radio-group-field-BeQEWaTA.d.ts.map → radio-group-field-z7q-PVyY.d.ts.map} +1 -1
- package/dist/rwa/index.d.ts +2 -2
- package/dist/rwa/index.js +11 -10
- package/dist/rwa/index.js.map +1 -1
- package/dist/{search-autocomplete-BRGCFNv4.d.ts → search-autocomplete-BJJkrZ1i.d.ts} +2 -2
- package/dist/{search-autocomplete-BRGCFNv4.d.ts.map → search-autocomplete-BJJkrZ1i.d.ts.map} +1 -1
- package/dist/{select-field-CxQiIXRy.d.ts → select-field-D27IGJrV.d.ts} +2 -2
- package/dist/{select-field-CxQiIXRy.d.ts.map → select-field-D27IGJrV.d.ts.map} +1 -1
- package/dist/{selected-content-DPH03IS_.d.ts → selected-content-CdIw4hcC.d.ts} +2 -2
- package/dist/{selected-content-DPH03IS_.d.ts.map → selected-content-CdIw4hcC.d.ts.map} +1 -1
- package/dist/{splitted-input-diff-Cvmajf1T.d.ts → splitted-input-diff-Bjrw-jzX.d.ts} +2 -2
- package/dist/{splitted-input-diff-Cvmajf1T.d.ts.map → splitted-input-diff-Bjrw-jzX.d.ts.map} +1 -1
- package/dist/{src-BX8sU0Tq.js → src-8xf1ueaA.js} +3 -3
- package/dist/src-8xf1ueaA.js.map +1 -0
- package/dist/{text-field-D_SU7LsS.d.ts → text-field-Bi7Ze25A.d.ts} +3 -3
- package/dist/{text-field-D_SU7LsS.d.ts.map → text-field-Bi7Ze25A.d.ts.map} +1 -1
- package/dist/{text-input-BHnj0vwk.d.ts → text-input-BAO78Lzx.d.ts} +3 -3
- package/dist/{text-input-BHnj0vwk.d.ts.map → text-input-BAO78Lzx.d.ts.map} +1 -1
- package/dist/{text-input-diff-BX11t5bF.d.ts → text-input-diff-Bx-zFOZd.d.ts} +2 -2
- package/dist/{text-input-diff-BX11t5bF.d.ts.map → text-input-diff-Bx-zFOZd.d.ts.map} +1 -1
- package/dist/{tooltip-CJfsoXUL.d.ts → tooltip-CsucyiCV.d.ts} +1 -1
- package/dist/{tooltip-CJfsoXUL.d.ts.map → tooltip-CsucyiCV.d.ts.map} +1 -1
- package/dist/{types-BWOaVvle.d.ts → types-BTq-St7H.d.ts} +1 -1
- package/dist/{types-BWOaVvle.d.ts.map → types-BTq-St7H.d.ts.map} +1 -1
- package/dist/{types-xiS8yRsl.d.ts → types-Bsn62tJB.d.ts} +1 -1
- package/dist/{types-xiS8yRsl.d.ts.map → types-Bsn62tJB.d.ts.map} +1 -1
- package/dist/{types-DY2V2IQi.d.ts → types-C04Q_Fan.d.ts} +1 -1
- package/dist/{types-DY2V2IQi.d.ts.map → types-C04Q_Fan.d.ts.map} +1 -1
- package/dist/ui/components/button/button.d.ts +1 -1
- package/dist/ui/components/button/button.js +2 -2
- package/dist/ui/components/button/button.js.map +1 -1
- package/dist/ui/components/character-counter/character-counter.d.ts +1 -1
- package/dist/ui/components/character-counter/character-counter.js.map +1 -1
- package/dist/ui/components/checkbox/checkbox-base.d.ts +1 -1
- package/dist/ui/components/checkbox/checkbox-base.js +2 -2
- package/dist/ui/components/checkbox/checkbox-base.js.map +1 -1
- package/dist/ui/components/checkbox/checkbox.d.ts +1 -1
- package/dist/ui/components/checkbox/checkbox.js +2 -2
- package/dist/ui/components/checkbox/checkbox.js.map +1 -1
- package/dist/ui/components/command/command.d.ts +1 -1
- package/dist/ui/components/command/command.js +8 -8
- package/dist/ui/components/command/command.js.map +1 -1
- package/dist/ui/components/enum-field/enum-field.d.ts +1 -1
- package/dist/ui/components/enum-field/enum-field.js +1 -1
- package/dist/ui/components/enum-field/enum-field.js.map +1 -1
- package/dist/ui/components/enum-field/types.d.ts +1 -1
- package/dist/ui/components/form/form.d.ts +1 -1
- package/dist/ui/components/form/form.js +1 -1
- package/dist/ui/components/form/form.js.map +1 -1
- package/dist/ui/components/form/utils.js.map +1 -1
- package/dist/ui/components/form-description/form-description.d.ts +1 -1
- package/dist/ui/components/form-description/form-description.js +1 -1
- package/dist/ui/components/form-description/form-description.js.map +1 -1
- package/dist/ui/components/form-group/form-group.d.ts +1 -1
- package/dist/ui/components/form-group/form-group.js.map +1 -1
- package/dist/ui/components/form-label/form-label.d.ts +1 -1
- package/dist/ui/components/form-label/form-label.js +1 -1
- package/dist/ui/components/form-label/form-label.js.map +1 -1
- package/dist/ui/components/form-message/form-message.d.ts +1 -1
- package/dist/ui/components/form-message/form-message.js +1 -1
- package/dist/ui/components/form-message/form-message.js.map +1 -1
- package/dist/ui/components/form-message/form-server-error-message.d.ts +1 -1
- package/dist/ui/components/form-message/form-server-error-message.js.map +1 -1
- package/dist/ui/components/form-message/message-list.d.ts +1 -1
- package/dist/ui/components/form-message/message-list.js +1 -1
- package/dist/ui/components/form-message/message-list.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-context.js +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-context.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.js +2 -2
- package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.js +2 -2
- package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list.js +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list.js.map +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete.js +2 -2
- package/dist/ui/components/id-autocomplete/id-autocomplete.js.map +1 -1
- package/dist/ui/components/id-autocomplete/types.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/use-id-autocomplete.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/use-id-autocomplete.js.map +1 -1
- package/dist/ui/components/index.d.ts +36 -36
- package/dist/ui/components/input/input.d.ts +1 -1
- package/dist/ui/components/input/input.js +1 -1
- package/dist/ui/components/input/input.js.map +1 -1
- package/dist/ui/components/input/splitted-input-diff.d.ts +1 -1
- package/dist/ui/components/input/splitted-input-diff.js +1 -1
- package/dist/ui/components/input/splitted-input-diff.js.map +1 -1
- package/dist/ui/components/input/subcomponent/input-diff.js +1 -1
- package/dist/ui/components/input/subcomponent/input-diff.js.map +1 -1
- package/dist/ui/components/input/subcomponent/text-diff.d.ts +1 -1
- package/dist/ui/components/input/subcomponent/text-diff.js +1 -1
- package/dist/ui/components/input/subcomponent/text-diff.js.map +1 -1
- package/dist/ui/components/json-viewer/json-viewer.d.ts +1 -1
- package/dist/ui/components/json-viewer/json-viewer.js +1 -1
- package/dist/ui/components/json-viewer/json-viewer.js.map +1 -1
- package/dist/ui/components/popover/popover.d.ts +1 -1
- package/dist/ui/components/popover/popover.js +2 -2
- package/dist/ui/components/popover/popover.js.map +1 -1
- package/dist/ui/components/radio-group-field/radio-group-field.d.ts +1 -1
- package/dist/ui/components/radio-group-field/radio-group-field.js +3 -3
- package/dist/ui/components/radio-group-field/radio-group-field.js.map +1 -1
- package/dist/ui/components/radio-group-field/radio-group.d.ts +1 -1
- package/dist/ui/components/radio-group-field/radio-group.js +1 -1
- package/dist/ui/components/radio-group-field/radio-group.js.map +1 -1
- package/dist/ui/components/radio-group-field/radio.d.ts +1 -1
- package/dist/ui/components/radio-group-field/radio.js +2 -2
- package/dist/ui/components/radio-group-field/radio.js.map +1 -1
- package/dist/ui/components/search-autocomplete/index.d.ts +3 -3
- package/dist/ui/components/search-autocomplete/search-autocomplete.d.ts +1 -1
- package/dist/ui/components/search-autocomplete/search-autocomplete.js +1 -1
- package/dist/ui/components/search-autocomplete/search-autocomplete.js.map +1 -1
- package/dist/ui/components/search-autocomplete/types.d.ts +1 -1
- package/dist/ui/components/search-autocomplete/use-search-autocomplete.d.ts +1 -1
- package/dist/ui/components/search-autocomplete/use-search-autocomplete.js.map +1 -1
- package/dist/ui/components/select-field/content.d.ts +1 -1
- package/dist/ui/components/select-field/content.js +1 -1
- package/dist/ui/components/select-field/content.js.map +1 -1
- package/dist/ui/components/select-field/select-field.d.ts +1 -1
- package/dist/ui/components/select-field/select-field.js +2 -2
- package/dist/ui/components/select-field/select-field.js.map +1 -1
- package/dist/ui/components/select-field/selected-content.d.ts +1 -1
- package/dist/ui/components/select-field/selected-content.js +1 -1
- package/dist/ui/components/select-field/selected-content.js.map +1 -1
- package/dist/ui/components/select-field/subcomponents/CommandItemList.d.ts +1 -1
- package/dist/ui/components/select-field/subcomponents/CommandItemList.js +1 -1
- package/dist/ui/components/select-field/subcomponents/CommandItemList.js.map +1 -1
- package/dist/ui/components/select-field/use-select-field.d.ts +1 -1
- package/dist/ui/components/select-field/use-select-field.js.map +1 -1
- package/dist/ui/components/text-field/text-field.d.ts +1 -1
- package/dist/ui/components/text-field/text-field.js +1 -1
- package/dist/ui/components/text-field/text-field.js.map +1 -1
- package/dist/ui/components/text-input/text-input-diff.d.ts +1 -1
- package/dist/ui/components/text-input/text-input-diff.js.map +1 -1
- package/dist/ui/components/text-input/text-input.d.ts +1 -1
- package/dist/ui/components/text-input/text-input.js +2 -2
- package/dist/ui/components/text-input/text-input.js.map +1 -1
- package/dist/ui/components/text-input/types.d.ts +1 -1
- package/dist/ui/components/tooltip/tooltip.d.ts +1 -1
- package/dist/ui/components/tooltip/tooltip.js +2 -2
- package/dist/ui/components/tooltip/tooltip.js.map +1 -1
- package/dist/ui/components/types.d.ts +1 -1
- package/dist/ui/components/value-transformer/value-transformer.d.ts +1 -1
- package/dist/ui/components/value-transformer/value-transformer.js +1 -1
- package/dist/ui/components/value-transformer/value-transformer.js.map +1 -1
- package/dist/ui/components/with-field-validation/with-field-validation.d.ts +1 -1
- package/dist/ui/components/with-field-validation/with-field-validation.js +1 -1
- package/dist/ui/components/with-field-validation/with-field-validation.js.map +1 -1
- package/dist/ui/index.d.ts +38 -38
- package/dist/ui/lib/date-picker.d.ts +1 -1
- package/dist/ui/lib/date-picker.js.map +1 -1
- package/dist/ui/lib/date-time-picker.js.map +1 -1
- package/dist/ui/lib/deep-equal.js.map +1 -1
- package/dist/ui/lib/is-empty.js.map +1 -1
- package/dist/ui/lib/shared-value-transformers.d.ts +1 -1
- package/dist/ui/lib/shared-value-transformers.js.map +1 -1
- package/dist/ui/lib/types.d.ts +1 -1
- package/dist/ui/lib/value-cast.js.map +1 -1
- package/dist/ui/types.d.ts +2 -2
- package/dist/{use-id-autocomplete-FGV0tDeG.d.ts → use-id-autocomplete-JE8w4UXf.d.ts} +2 -2
- package/dist/{use-id-autocomplete-FGV0tDeG.d.ts.map → use-id-autocomplete-JE8w4UXf.d.ts.map} +1 -1
- package/dist/{use-search-autocomplete-BYRTKJjd.d.ts → use-search-autocomplete-IfcQ_gKh.d.ts} +2 -2
- package/dist/{use-search-autocomplete-BYRTKJjd.d.ts.map → use-search-autocomplete-IfcQ_gKh.d.ts.map} +1 -1
- package/dist/{value-transformer-BDrKuBqy.d.ts → value-transformer-2yvrA5Rp.d.ts} +2 -2
- package/dist/{value-transformer-BDrKuBqy.d.ts.map → value-transformer-2yvrA5Rp.d.ts.map} +1 -1
- package/dist/{with-field-validation-DQwlMTzr.d.ts → with-field-validation-YcGrdIrv.d.ts} +2 -2
- package/dist/{with-field-validation-DQwlMTzr.d.ts.map → with-field-validation-YcGrdIrv.d.ts.map} +1 -1
- package/package.json +13 -5
- package/dist/connect-CrXsa33f.js.map +0 -1
- package/dist/form-group-BDgpr5u8.d.ts.map +0 -1
- package/dist/index-C37KRTG6.d.ts.map +0 -1
- package/dist/src-BX8sU0Tq.js.map +0 -1
- /package/dist/{index-C2geSgue.d.ts → index-E7Wvm5uX.d.ts} +0 -0
- /package/dist/{index-Dw5cCt-A.d.ts → index-J3R2mDFQ.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as WithDifference, f as FieldErrorHandling } from "./index-
|
|
2
|
-
import { n as TextInputProps } from "./text-input-
|
|
1
|
+
import { _ as WithDifference, f as FieldErrorHandling } from "./index-B6YyDoT1.js";
|
|
2
|
+
import { n as TextInputProps } from "./text-input-BAO78Lzx.js";
|
|
3
3
|
import * as react from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/ui/components/text-field/text-field.d.ts
|
|
@@ -7,4 +7,4 @@ type TextFieldProps = TextInputProps & FieldErrorHandling & WithDifference<strin
|
|
|
7
7
|
declare const TextField: react.ForwardRefExoticComponent<TextInputProps & FieldErrorHandling & WithDifference<string> & react.RefAttributes<HTMLInputElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { TextFieldProps as n, TextField as t };
|
|
10
|
-
//# sourceMappingURL=text-field-
|
|
10
|
+
//# sourceMappingURL=text-field-Bi7Ze25A.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field-
|
|
1
|
+
{"version":3,"file":"text-field-Bi7Ze25A.d.ts","names":[],"sources":["../src/ui/components/text-field/text-field.tsx"],"mappings":";;;;;KAMY,cAAA,GAAiB,cAAA,GAC3B,kBAAA,GACA,cAAA;AAAA,cAEW,SAAA,EAAS,KAAA,CAAA,yBAAA,CAAA,cAAA,GAAA,kBAAA,GAAA,cAAA,WAAA,KAAA,CAAA,aAAA,CAAA,gBAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as WithDifference, p as InputBaseProps, u as DiffMode } from "./index-
|
|
2
|
-
import { t as CommonTextProps } from "./types-
|
|
1
|
+
import { _ as WithDifference, p as InputBaseProps, u as DiffMode } from "./index-B6YyDoT1.js";
|
|
2
|
+
import { t as CommonTextProps } from "./types-Bsn62tJB.js";
|
|
3
3
|
import * as react from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/ui/components/text-input/text-input.d.ts
|
|
@@ -11,4 +11,4 @@ interface TextInputProps extends Omit<InputBaseProps<string> & Omit<React.InputH
|
|
|
11
11
|
declare const TextInput: react.ForwardRefExoticComponent<TextInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { TextInputProps as n, TextInput as t };
|
|
14
|
-
//# sourceMappingURL=text-input-
|
|
14
|
+
//# sourceMappingURL=text-input-BAO78Lzx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input-
|
|
1
|
+
{"version":3,"file":"text-input-BAO78Lzx.d.ts","names":[],"sources":["../src/ui/components/text-input/text-input.tsx"],"mappings":";;;;;UAeU,cAAA,SAEN,IAAA,CACE,cAAA,WACE,IAAA,CAAK,KAAA,CAAM,mBAAA,CAAoB,gBAAA,gBAC/B,eAAA,6BAGJ,IAAA,CAAK,cAAA;EACP,KAAA;EACA,YAAA;EACA,QAAA,GAAW,OAAA,CAAQ,QAAA;AAAA;AAAA,cAGf,SAAA,EAAS,KAAA,CAAA,yBAAA,CAAA,cAAA,GAAA,KAAA,CAAA,aAAA,CAAA,gBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as WithDifference } from "./index-
|
|
1
|
+
import { _ as WithDifference } from "./index-B6YyDoT1.js";
|
|
2
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/ui/components/text-input/text-input-diff.d.ts
|
|
@@ -17,4 +17,4 @@ declare const TextInputDiff: ({
|
|
|
17
17
|
}: TextInputDiffProps) => react_jsx_runtime0.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { TextInputDiff as t };
|
|
20
|
-
//# sourceMappingURL=text-input-diff-
|
|
20
|
+
//# sourceMappingURL=text-input-diff-Bx-zFOZd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input-diff-
|
|
1
|
+
{"version":3,"file":"text-input-diff-Bx-zFOZd.d.ts","names":[],"sources":["../src/ui/components/text-input/text-input-diff.tsx"],"mappings":";;;;UAKU,kBAAA,SAA2B,cAAA;EACnC,KAAA;EACA,KAAA,GAAQ,KAAA,CAAM,SAAA;EACd,QAAA;AAAA;AAAA,cAEI,aAAA;EAAiB,KAAA;EAAA,KAAA;EAAA,QAAA;EAAA,SAAA;EAAA,QAAA;EAAA;AAAA,GAOpB,kBAAA,KAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -11,4 +11,4 @@ declare const TooltipContent: react.ForwardRefExoticComponent<TooltipContentProp
|
|
|
11
11
|
declare const Tooltip: React.FC<TooltipProps$1>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { TooltipProps$1 as a, TooltipContent as i, Root$1 as n, Trigger$1 as o, Tooltip as r, Provider$1 as t };
|
|
14
|
-
//# sourceMappingURL=tooltip-
|
|
14
|
+
//# sourceMappingURL=tooltip-CsucyiCV.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-
|
|
1
|
+
{"version":3,"file":"tooltip-CsucyiCV.d.ts","names":[],"sources":["../src/ui/components/tooltip/tooltip.tsx"],"mappings":";;;;UAcU,cAAA,SACA,YAAA,EAAuB,IAAA,CAAK,mBAAA;EACpC,OAAA,EAAS,KAAA,CAAM,SAAA;EACf,SAAA;EACA,cAAA;AAAA;AAAA,cAGI,cAAA,EAAc,KAAA,CAAA,yBAAA,CAAA,mBAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cA+Bd,OAAA,EAAS,KAAA,CAAM,EAAA,CAAG,cAAA"}
|
|
@@ -29,4 +29,4 @@ interface ValueTransformerProps {
|
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
export { TransformerType as a, WeekStartDayNumber as c, TransformerTrigger as i, DatePickerView as n, ValueTransformerFn as o, TransformerObject as r, ValueTransformerProps as s, DateFieldValue as t };
|
|
32
|
-
//# sourceMappingURL=types-
|
|
32
|
+
//# sourceMappingURL=types-BTq-St7H.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-BTq-St7H.d.ts","names":[],"sources":["../src/ui/lib/types.ts"],"mappings":";KAAY,cAAA,YAA0B,IAAA;AAAA,KAC1B,cAAA;AAAA,KACA,kBAAA;AAAA,KAEA,kBAAA,IAAsB,KAAA;AAAA,KAEtB,kBAAA;AAAA,KAEA,iBAAA;EAPA;;;EAWV,WAAA,EAAa,kBAAA;EACb,OAAA;IAXU;;;;IAgBR,OAAA,GAAU,kBAAA;IAdF;;;;IAmBR,EAAA;EAAA;AAAA;AAAA,KAIQ,eAAA,GAAkB,iBAAA,KAAsB,kBAAA;AAAA,UAEnC,qBAAA;EACf,YAAA,EAAc,eAAA;EACd,QAAA,EAAU,KAAA,CAAM,YAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-Bsn62tJB.d.ts","names":[],"sources":["../src/ui/components/text-input/types.ts"],"mappings":";UAAiB,eAAA;EACf,SAAA;EACA,SAAA;EACA,OAAA,GAAU,MAAA;EACV,WAAA;EACA,IAAA;EACA,SAAA;EACA,SAAA;EACA,YAAA;EACA,UAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-C04Q_Fan.d.ts","names":[],"sources":["../src/ui/components/search-autocomplete/types.ts"],"mappings":";;;UAEiB,wBAAA;EACf,KAAA;EACA,KAAA;EACA,OAAA;EACA,WAAA;EACA,IAAA;EACA,QAAA;EACA,aAAA;EACA,QAAA,GAAW,MAAA;EACX,QAAA;AAAA;AAAA,UAGe,4BAAA;EACf,cAAA;EACA,WAAA;EACA,gBAAA,GAAmB,SAAA;EACnB,YAAA,GAAe,KAAA;AAAA;AAAA,UAGA,uBAAA;EACf,YAAA,IAAgB,KAAA,aAAkB,OAAA,CAAQ,wBAAA;EAC1C,QAAA,GAAW,KAAA,oBAAyB,OAAA;EACpC,WAAA;EACA,gBAAA,GAAmB,SAAA;EACnB,WAAA;EACA,QAAA;EACA,OAAA;EACA,SAAA;EACA,YAAA,IAAgB,MAAA,EAAQ,wBAAA,KAA6B,SAAA;EACrD,SAAA,IACE,MAAA,EAAQ,wBAAA,EACR,GAAA,EAAK,4BAAA,KACF,SAAA;EACL,gBAAA;EACA,UAAA;AAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ButtonProps, r as buttonVariants, t as Button } from "../../../button-
|
|
1
|
+
import { n as ButtonProps, r as buttonVariants, t as Button } from "../../../button-C8doazjv.js";
|
|
2
2
|
export { Button, ButtonProps, buttonVariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as cn } from "../../../src-
|
|
1
|
+
import { t as cn } from "../../../src-8xf1ueaA.js";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
@@ -12,7 +12,7 @@ const buttonVariants = cva(cn("inline-flex items-center justify-center gap-2", "
|
|
|
12
12
|
} },
|
|
13
13
|
defaultVariants: { variant: "default" }
|
|
14
14
|
});
|
|
15
|
-
const Button = forwardRef(({ variant, className, asChild = false, ...props }, ref) => {
|
|
15
|
+
const Button = /* @__PURE__ */ forwardRef(({ variant, className, asChild = false, ...props }, ref) => {
|
|
16
16
|
return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
17
17
|
className: cn(buttonVariants({
|
|
18
18
|
variant,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../../../../src/ui/components/button/button.tsx"],"sourcesContent":["import { cn } from \"#design-system\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef } from \"react\";\n\nconst buttonVariants = cva(\n cn(\n \"inline-flex items-center justify-center gap-2\",\n \"whitespace-nowrap rounded-md text-sm font-medium\",\n \"transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2\",\n \"disabled:pointer-events-none\",\n \"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n ),\n {\n variants: {\n variant: {\n default: \"\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant, className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"button.js","names":["cn","Slot","cva","forwardRef","buttonVariants","variants","variant","default","outline","ghost","defaultVariants","Button","className","asChild","props","ref","Comp"],"sources":["../../../../src/ui/components/button/button.tsx"],"sourcesContent":["import { cn } from \"#design-system\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef } from \"react\";\n\nconst buttonVariants = cva(\n cn(\n \"inline-flex items-center justify-center gap-2\",\n \"whitespace-nowrap rounded-md text-sm font-medium\",\n \"transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2\",\n \"disabled:pointer-events-none\",\n \"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n ),\n {\n variants: {\n variant: {\n default: \"\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant, className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;AAMA,MAAMI,iBAAiBF,IACrBF,GACE,iDACA,oDACA,qBACA,+EACA,gCACA,8DACD,EACD;CACEK,UAAU,EACRC,SAAS;EACPC,SAAS;EACTC,SACE;EACFC,OAAO;EACT,EACD;CACDC,iBAAiB,EACfJ,SAAS,WACX;CAEJ,CAAC;AASD,MAAMK,SAASR,4BACZ,EAAEG,SAASM,WAAWC,UAAU,OAAO,GAAGC,SAASC,QAAQ;AAE1D,QACE,oBAFWF,UAAUZ,OAAO,UAE5B;EACE,WAAWD,GAAGI,eAAe;GAAEE;GAASM;GAAW,CAAC,CAAC;EAChDG;EACL,GAAID;EACJ,CAAA;EAGP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CharacterCounterProps, t as CharacterCounter } from "../../../character-counter-
|
|
1
|
+
import { n as CharacterCounterProps, t as CharacterCounter } from "../../../character-counter-BWoglM2P.js";
|
|
2
2
|
export { CharacterCounter, CharacterCounterProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"character-counter.js","names":[],"sources":["../../../../src/ui/components/character-counter/character-counter.tsx"],"sourcesContent":["export interface CharacterCounterProps {\n maxLength: number;\n value: string;\n}\n\nconst counterVariants = {\n normal: \"text-gray-500\",\n warning: \"text-yellow-900\",\n error: \"text-red-900\",\n};\n\nconst maxLengthVariants = {\n normal: \"text-gray-300 dark:text-gray-700\",\n warning: \"text-yellow-400 dark:text-[#644E00]\",\n error: \"text-red-400 dark:text-[#7D3D37]\",\n};\n\nexport const CharacterCounter: React.FC<CharacterCounterProps> = ({\n maxLength,\n value,\n}) => {\n const remaining = (value.length / maxLength) * 100;\n const state =\n remaining < 90 ? \"normal\" : remaining <= 100 ? \"warning\" : \"error\";\n\n return (\n <div className=\"flex items-center text-[10px] leading-3\">\n <span className={counterVariants[state]}>{value.length}</span>\n <span className={maxLengthVariants[state]}>/{maxLength}</span>\n </div>\n );\n};\n"],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"character-counter.js","names":["counterVariants","normal","warning","error","maxLengthVariants","CharacterCounter","maxLength","value","remaining","length","state"],"sources":["../../../../src/ui/components/character-counter/character-counter.tsx"],"sourcesContent":["export interface CharacterCounterProps {\n maxLength: number;\n value: string;\n}\n\nconst counterVariants = {\n normal: \"text-gray-500\",\n warning: \"text-yellow-900\",\n error: \"text-red-900\",\n};\n\nconst maxLengthVariants = {\n normal: \"text-gray-300 dark:text-gray-700\",\n warning: \"text-yellow-400 dark:text-[#644E00]\",\n error: \"text-red-400 dark:text-[#7D3D37]\",\n};\n\nexport const CharacterCounter: React.FC<CharacterCounterProps> = ({\n maxLength,\n value,\n}) => {\n const remaining = (value.length / maxLength) * 100;\n const state =\n remaining < 90 ? \"normal\" : remaining <= 100 ? \"warning\" : \"error\";\n\n return (\n <div className=\"flex items-center text-[10px] leading-3\">\n <span className={counterVariants[state]}>{value.length}</span>\n <span className={maxLengthVariants[state]}>/{maxLength}</span>\n </div>\n );\n};\n"],"mappings":";;AAKA,MAAMA,kBAAkB;CACtBC,QAAQ;CACRC,SAAS;CACTC,OAAO;CACR;AAED,MAAMC,oBAAoB;CACxBH,QAAQ;CACRC,SAAS;CACTC,OAAO;CACR;AAED,MAAaE,oBAAqD,EAChEC,WACAC,YACI;CACJ,MAAMC,YAAaD,MAAME,SAASH,YAAa;CAC/C,MAAMI,QACJF,YAAY,KAAK,WAAWA,aAAa,MAAM,YAAY;AAE7D,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,QAAD;GAAM,WAAWR,gBAAgBU;aAASH,MAAME;GAAa,CAAA,EAC7D,qBAAC,QAAD;GAAM,WAAWL,kBAAkBM;aAAnC,CAA2C,KAAEJ,UAAgB;KACzD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CheckboxValue, t as CheckboxBase } from "../../../checkbox-base-
|
|
1
|
+
import { n as CheckboxValue, t as CheckboxBase } from "../../../checkbox-base-CZo-4eL0.js";
|
|
2
2
|
export { CheckboxBase, CheckboxValue };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as cn } from "../../../src-
|
|
1
|
+
import { t as cn } from "../../../src-8xf1ueaA.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
5
5
|
//#region src/ui/components/checkbox/checkbox-base.tsx
|
|
6
|
-
const CheckboxBase = React$1.forwardRef(({ className, checked, invalid, ...props }, ref) => /* @__PURE__ */ jsx(CheckboxPrimitive.Root, {
|
|
6
|
+
const CheckboxBase = /* @__PURE__ */ React$1.forwardRef(({ className, checked, invalid, ...props }, ref) => /* @__PURE__ */ jsx(CheckboxPrimitive.Root, {
|
|
7
7
|
ref,
|
|
8
8
|
className: cn("peer size-4 shrink-0 rounded", "border-input border shadow-sm shadow-black/[.04]", "ring-offset-background transition-shadow", "focus-visible:border-ring focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:border-gray-700 disabled:data-[invalid=false]:data-[state=checked]:bg-gray-700 disabled:data-[invalid=false]:data-[state=indeterminate]:bg-gray-700 dark:disabled:data-[invalid=false]:data-[state=checked]:bg-gray-500 dark:disabled:data-[invalid=false]:data-[state=indeterminate]:bg-gray-500", "data-[state]:border-gray-700 dark:data-[state]:border-gray-500", "data-[state=checked]:bg-gray-900 data-[state=indeterminate]:bg-gray-900 dark:data-[state=checked]:bg-gray-400 dark:data-[state=indeterminate]:bg-gray-400", "data-[state=checked]:text-slate-50 data-[state=indeterminate]:text-slate-50 dark:data-[state=checked]:text-gray-900 dark:data-[state=indeterminate]:text-gray-900", !props.disabled && ["group-hover:border-gray-900 data-[state=checked]:group-hover:bg-gray-900 data-[state=indeterminate]:group-hover:bg-gray-900", "dark:group-hover:border-slate-50 dark:data-[state=checked]:group-hover:bg-slate-50 dark:data-[state=indeterminate]:group-hover:bg-slate-50"], "data-[invalid=true]:data-[state]:!border-red-800 data-[invalid=true]:data-[state=checked]:!bg-red-800 data-[invalid=true]:data-[state=indeterminate]:!bg-red-800", "dark:data-[invalid=true]:data-[state]:!border-red-800 dark:data-[invalid=true]:data-[state=checked]:!bg-red-800 dark:data-[invalid=true]:data-[state=indeterminate]:!bg-red-800", "data-[invalid=true]:group-hover:!border-red-900 data-[invalid=true]:data-[state=checked]:group-hover:!bg-red-900 data-[invalid=true]:data-[state=indeterminate]:group-hover:!bg-red-900", className),
|
|
9
9
|
checked,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-base.js","names":["React"],"sources":["../../../../src/ui/components/checkbox/checkbox-base.tsx"],"sourcesContent":["import { cn } from \"#design-system\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport * as React from \"react\";\n\ntype CheckboxValue = boolean | \"indeterminate\";\n\ntype CheckboxBaseProps = React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n> & {\n invalid?: boolean;\n};\n\nconst CheckboxBase = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n CheckboxBaseProps\n>(({ className, checked, invalid, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n // Base styles\n \"peer size-4 shrink-0 rounded\",\n // Border & Shadow\n \"border-input border shadow-sm shadow-black/[.04]\",\n // Background & Ring\n \"ring-offset-background transition-shadow\",\n // Focus styles\n \"focus-visible:border-ring focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2\",\n // Disabled state\n \"disabled:cursor-not-allowed disabled:border-gray-700 disabled:data-[invalid=false]:data-[state=checked]:bg-gray-700 disabled:data-[invalid=false]:data-[state=indeterminate]:bg-gray-700 dark:disabled:data-[invalid=false]:data-[state=checked]:bg-gray-500 dark:disabled:data-[invalid=false]:data-[state=indeterminate]:bg-gray-500\",\n // Checked & Indeterminate states\n \"data-[state]:border-gray-700 dark:data-[state]:border-gray-500\",\n \"data-[state=checked]:bg-gray-900 data-[state=indeterminate]:bg-gray-900 dark:data-[state=checked]:bg-gray-400 dark:data-[state=indeterminate]:bg-gray-400\",\n \"data-[state=checked]:text-slate-50 data-[state=indeterminate]:text-slate-50 dark:data-[state=checked]:text-gray-900 dark:data-[state=indeterminate]:text-gray-900\",\n // hover states\n !props.disabled && [\n \"group-hover:border-gray-900 data-[state=checked]:group-hover:bg-gray-900 data-[state=indeterminate]:group-hover:bg-gray-900\",\n \"dark:group-hover:border-slate-50 dark:data-[state=checked]:group-hover:bg-slate-50 dark:data-[state=indeterminate]:group-hover:bg-slate-50\",\n ],\n // Error state\n \"data-[invalid=true]:data-[state]:!border-red-800 data-[invalid=true]:data-[state=checked]:!bg-red-800 data-[invalid=true]:data-[state=indeterminate]:!bg-red-800\",\n \"dark:data-[invalid=true]:data-[state]:!border-red-800 dark:data-[invalid=true]:data-[state=checked]:!bg-red-800 dark:data-[invalid=true]:data-[state=indeterminate]:!bg-red-800\",\n // error hover states\n \"data-[invalid=true]:group-hover:!border-red-900 data-[invalid=true]:data-[state=checked]:group-hover:!bg-red-900 data-[invalid=true]:data-[state=indeterminate]:group-hover:!bg-red-900\",\n className,\n )}\n checked={checked}\n data-invalid={invalid}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n {checked === \"indeterminate\" ? (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n ) : checked ? (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n ) : null}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\n\nCheckboxBase.displayName = \"CheckboxBase\";\n\nexport { CheckboxBase, type CheckboxValue };\n"],"mappings":";;;;;AAYA,
|
|
1
|
+
{"version":3,"file":"checkbox-base.js","names":["cn","CheckboxPrimitive","React","CheckboxBase","forwardRef","className","checked","invalid","props","ref","disabled","displayName"],"sources":["../../../../src/ui/components/checkbox/checkbox-base.tsx"],"sourcesContent":["import { cn } from \"#design-system\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport * as React from \"react\";\n\ntype CheckboxValue = boolean | \"indeterminate\";\n\ntype CheckboxBaseProps = React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n> & {\n invalid?: boolean;\n};\n\nconst CheckboxBase = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n CheckboxBaseProps\n>(({ className, checked, invalid, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n // Base styles\n \"peer size-4 shrink-0 rounded\",\n // Border & Shadow\n \"border-input border shadow-sm shadow-black/[.04]\",\n // Background & Ring\n \"ring-offset-background transition-shadow\",\n // Focus styles\n \"focus-visible:border-ring focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2\",\n // Disabled state\n \"disabled:cursor-not-allowed disabled:border-gray-700 disabled:data-[invalid=false]:data-[state=checked]:bg-gray-700 disabled:data-[invalid=false]:data-[state=indeterminate]:bg-gray-700 dark:disabled:data-[invalid=false]:data-[state=checked]:bg-gray-500 dark:disabled:data-[invalid=false]:data-[state=indeterminate]:bg-gray-500\",\n // Checked & Indeterminate states\n \"data-[state]:border-gray-700 dark:data-[state]:border-gray-500\",\n \"data-[state=checked]:bg-gray-900 data-[state=indeterminate]:bg-gray-900 dark:data-[state=checked]:bg-gray-400 dark:data-[state=indeterminate]:bg-gray-400\",\n \"data-[state=checked]:text-slate-50 data-[state=indeterminate]:text-slate-50 dark:data-[state=checked]:text-gray-900 dark:data-[state=indeterminate]:text-gray-900\",\n // hover states\n !props.disabled && [\n \"group-hover:border-gray-900 data-[state=checked]:group-hover:bg-gray-900 data-[state=indeterminate]:group-hover:bg-gray-900\",\n \"dark:group-hover:border-slate-50 dark:data-[state=checked]:group-hover:bg-slate-50 dark:data-[state=indeterminate]:group-hover:bg-slate-50\",\n ],\n // Error state\n \"data-[invalid=true]:data-[state]:!border-red-800 data-[invalid=true]:data-[state=checked]:!bg-red-800 data-[invalid=true]:data-[state=indeterminate]:!bg-red-800\",\n \"dark:data-[invalid=true]:data-[state]:!border-red-800 dark:data-[invalid=true]:data-[state=checked]:!bg-red-800 dark:data-[invalid=true]:data-[state=indeterminate]:!bg-red-800\",\n // error hover states\n \"data-[invalid=true]:group-hover:!border-red-900 data-[invalid=true]:data-[state=checked]:group-hover:!bg-red-900 data-[invalid=true]:data-[state=indeterminate]:group-hover:!bg-red-900\",\n className,\n )}\n checked={checked}\n data-invalid={invalid}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n {checked === \"indeterminate\" ? (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n ) : checked ? (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n ) : null}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\n\nCheckboxBase.displayName = \"CheckboxBase\";\n\nexport { CheckboxBase, type CheckboxValue };\n"],"mappings":";;;;;AAYA,MAAMG,eAAeD,wBAAME,YAGxB,EAAEC,WAAWC,SAASC,SAAS,GAAGC,SAASC,QAC5C,oBAAC,kBAAkB,MAAnB;CACOA;CACL,WAAWT,GAET,gCAEA,oDAEA,4CAEA,iIAEA,0UAEA,kEACA,6JACA,qKAEA,CAACQ,MAAME,YAAY,CACjB,+HACA,6IACD,EAED,oKACA,mLAEA,2LACAL,UACD;CACQC;CACT,gBAAcC;CACd,GAAIC;WAEJ,oBAAC,kBAAkB,WAAnB;EAA6B,WAAU;YACpCF,YAAY,kBACX,oBAAC,OAAD;GACE,OAAM;GACN,QAAO;GACP,SAAQ;GACR,MAAK;GACL,OAAM;aAEN,oBAAC,QAAD;IACE,UAAS;IACT,UAAS;IACT,GAAE;IAAgK,CAAA;GAEhK,CAAA,GACJA,UACF,oBAAC,OAAD;GACE,OAAM;GACN,QAAO;GACP,SAAQ;GACR,MAAK;GACL,OAAM;aAEN,oBAAC,QAAD;IACE,UAAS;IACT,UAAS;IACT,GAAE;IAAqX,CAAA;GAErX,CAAA,GACJ;EACuB,CAAA;CAEhC,CAAA,CAAC;AAEFH,aAAaQ,cAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CheckboxProps, t as Checkbox } from "../../../checkbox-
|
|
1
|
+
import { n as CheckboxProps, t as Checkbox } from "../../../checkbox-BueZ7Wg_.js";
|
|
2
2
|
export { Checkbox, CheckboxProps };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as cn } from "../../../src-
|
|
1
|
+
import { t as cn } from "../../../src-8xf1ueaA.js";
|
|
2
2
|
import { CheckboxBase } from "./checkbox-base.js";
|
|
3
3
|
import { FormLabel } from "../form-label/form-label.js";
|
|
4
4
|
import { FormMessageList } from "../form-message/message-list.js";
|
|
5
5
|
import React, { useId } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/ui/components/checkbox/checkbox.tsx
|
|
8
|
-
const Checkbox = React.forwardRef(({ id: idProp, name, label, value, defaultValue, disabled, required, description, errors, warnings, onChange, className, ...props }, ref) => {
|
|
8
|
+
const Checkbox = /* @__PURE__ */ React.forwardRef(({ id: idProp, name, label, value, defaultValue, disabled, required, description, errors, warnings, onChange, className, ...props }, ref) => {
|
|
9
9
|
const generatedId = useId();
|
|
10
10
|
const id = idProp ?? generatedId;
|
|
11
11
|
const hasError = !!errors?.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../../src/ui/components/checkbox/checkbox.tsx"],"sourcesContent":["import { cn } from \"#design-system\";\nimport React, { useId } from \"react\";\nimport type { InputBaseProps } from \"../../types.js\";\nimport { FormLabel } from \"../form-label/form-label.js\";\nimport { FormMessageList } from \"../form-message/message-list.js\";\nimport type { CheckboxValue } from \"./checkbox-base.js\";\nimport { CheckboxBase } from \"./checkbox-base.js\";\n\ntype CheckboxBaseProps = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof InputBaseProps<CheckboxValue> | \"onChange\"\n>;\n\nexport interface CheckboxProps\n extends CheckboxBaseProps, InputBaseProps<CheckboxValue> {\n onChange?: ((checked: CheckboxValue) => void) | ((checked: boolean) => void);\n}\n\nconst Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n (\n {\n id: idProp,\n name,\n label,\n value,\n defaultValue,\n disabled,\n required,\n description,\n errors,\n warnings,\n onChange,\n className,\n ...props\n },\n ref,\n ) => {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const hasError = !!errors?.length;\n\n const castValue = (value: unknown) => {\n if (value === \"true\") return true;\n if (value === \"false\") return false;\n return value;\n };\n\n return (\n <div className={cn(\"flex flex-col gap-2\")}>\n <div className={cn(\"group flex items-center space-x-2\", className)}>\n <CheckboxBase\n id={id}\n name={name}\n checked={castValue(value ?? defaultValue) as CheckboxValue}\n disabled={disabled}\n onCheckedChange={onChange}\n required={required}\n invalid={hasError}\n aria-invalid={hasError}\n ref={ref}\n {...props}\n />\n <FormLabel\n htmlFor={id}\n required={required}\n disabled={disabled}\n hasError={hasError}\n description={description}\n className={cn(!disabled && \"group-hover:cursor-pointer\")}\n inline\n >\n {label}\n </FormLabel>\n </div>\n {warnings && <FormMessageList type=\"warning\" messages={warnings} />}\n {errors && <FormMessageList type=\"error\" messages={errors} />}\n </div>\n );\n },\n);\n\nCheckbox.displayName = \"Checkbox\";\n\nexport { Checkbox };\n"],"mappings":";;;;;;;AAkBA,
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["cn","React","useId","FormLabel","FormMessageList","CheckboxBase","Checkbox","forwardRef","id","idProp","name","label","value","defaultValue","disabled","required","description","errors","warnings","onChange","className","props","ref","generatedId","hasError","length","castValue","displayName"],"sources":["../../../../src/ui/components/checkbox/checkbox.tsx"],"sourcesContent":["import { cn } from \"#design-system\";\nimport React, { useId } from \"react\";\nimport type { InputBaseProps } from \"../../types.js\";\nimport { FormLabel } from \"../form-label/form-label.js\";\nimport { FormMessageList } from \"../form-message/message-list.js\";\nimport type { CheckboxValue } from \"./checkbox-base.js\";\nimport { CheckboxBase } from \"./checkbox-base.js\";\n\ntype CheckboxBaseProps = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof InputBaseProps<CheckboxValue> | \"onChange\"\n>;\n\nexport interface CheckboxProps\n extends CheckboxBaseProps, InputBaseProps<CheckboxValue> {\n onChange?: ((checked: CheckboxValue) => void) | ((checked: boolean) => void);\n}\n\nconst Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n (\n {\n id: idProp,\n name,\n label,\n value,\n defaultValue,\n disabled,\n required,\n description,\n errors,\n warnings,\n onChange,\n className,\n ...props\n },\n ref,\n ) => {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const hasError = !!errors?.length;\n\n const castValue = (value: unknown) => {\n if (value === \"true\") return true;\n if (value === \"false\") return false;\n return value;\n };\n\n return (\n <div className={cn(\"flex flex-col gap-2\")}>\n <div className={cn(\"group flex items-center space-x-2\", className)}>\n <CheckboxBase\n id={id}\n name={name}\n checked={castValue(value ?? defaultValue) as CheckboxValue}\n disabled={disabled}\n onCheckedChange={onChange}\n required={required}\n invalid={hasError}\n aria-invalid={hasError}\n ref={ref}\n {...props}\n />\n <FormLabel\n htmlFor={id}\n required={required}\n disabled={disabled}\n hasError={hasError}\n description={description}\n className={cn(!disabled && \"group-hover:cursor-pointer\")}\n inline\n >\n {label}\n </FormLabel>\n </div>\n {warnings && <FormMessageList type=\"warning\" messages={warnings} />}\n {errors && <FormMessageList type=\"error\" messages={errors} />}\n </div>\n );\n },\n);\n\nCheckbox.displayName = \"Checkbox\";\n\nexport { Checkbox };\n"],"mappings":";;;;;;;AAkBA,MAAMM,WAAWL,sBAAMM,YAEnB,EACEC,IAAIC,QACJC,MACAC,OACAC,OACAC,cACAC,UACAC,UACAC,aACAC,QACAC,UACAC,UACAC,WACA,GAAGC,SAELC,QACG;CACH,MAAMC,cAAcrB,OAAO;CAC3B,MAAMM,KAAKC,UAAUc;CACrB,MAAMC,WAAW,CAAC,CAACP,QAAQQ;CAE3B,MAAMC,aAAad,UAAmB;AACpC,MAAIA,UAAU,OAAQ,QAAO;AAC7B,MAAIA,UAAU,QAAS,QAAO;AAC9B,SAAOA;;AAGT,QACE,qBAAC,OAAD;EAAK,WAAWZ,GAAG,sBAAsB;YAAzC;GACE,qBAAC,OAAD;IAAK,WAAWA,GAAG,qCAAqCoB,UAAU;cAAlE,CACE,oBAAC,cAAD;KACMZ;KACEE;KACN,SAASgB,UAAUd,SAASC,aAA8B;KAChDC;KACV,iBAAiBK;KACPJ;KACV,SAASS;KACT,gBAAcA;KACTF;KACL,GAAID;KAAM,CAAA,EAEZ,oBAAC,WAAD;KACE,SAASb;KACCO;KACAD;KACAU;KACGR;KACb,WAAWhB,GAAG,CAACc,YAAY,6BAA6B;KACxD,QAAA;eAECH;KACQ,CAAA,CACR;;GACJO,YAAY,oBAAC,iBAAD;IAAiB,MAAK;IAAU,UAAUA;IAAY,CAAA;GAClED,UAAU,oBAAC,iBAAD;IAAiB,MAAK;IAAQ,UAAUA;IAAU,CAAA;GACzD;;EAGX;AAEDX,SAASqB,cAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CommandItem, i as CommandInput, n as CommandEmpty, o as CommandList, r as CommandGroup, s as CommandLoading, t as Command } from "../../../command
|
|
1
|
+
import { a as CommandItem, i as CommandInput, n as CommandEmpty, o as CommandList, r as CommandGroup, s as CommandLoading, t as Command } from "../../../command--QCHwqST.js";
|
|
2
2
|
export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { h as Icon, t as cn } from "../../../src-
|
|
1
|
+
import { h as Icon, t as cn } from "../../../src-8xf1ueaA.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Command as Command$1 } from "cmdk";
|
|
5
5
|
//#region src/ui/components/command/command.tsx
|
|
6
|
-
const Command = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1, {
|
|
6
|
+
const Command = /* @__PURE__ */ React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1, {
|
|
7
7
|
ref,
|
|
8
8
|
className: cn("flex size-full flex-col rounded-md [&_[cmdk-label]]:hidden", className),
|
|
9
9
|
...props
|
|
10
10
|
}));
|
|
11
11
|
Command.displayName = Command$1.displayName;
|
|
12
|
-
const CommandInput = React.forwardRef(({ wrapperClassName, className, ...props }, ref) => /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
const CommandInput = /* @__PURE__ */ React.forwardRef(({ wrapperClassName, className, ...props }, ref) => /* @__PURE__ */ jsxs("div", {
|
|
13
13
|
className: cn("group relative flex items-center border-b", "border-b-gray-300 dark:border-b-gray-900", "hover:border-b-gray-300 dark:hover:border-b-gray-800", "hover:bg-gray-100 dark:hover:bg-gray-900", "focus-within:border-b-gray-300 dark:focus-within:border-b-gray-800", "focus-within:bg-gray-100 dark:focus-within:bg-gray-900", wrapperClassName),
|
|
14
14
|
"cmdk-input-wrapper": "",
|
|
15
15
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
@@ -23,29 +23,29 @@ const CommandInput = React.forwardRef(({ wrapperClassName, className, ...props }
|
|
|
23
23
|
})]
|
|
24
24
|
}));
|
|
25
25
|
CommandInput.displayName = Command$1.Input.displayName;
|
|
26
|
-
const CommandList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.List, {
|
|
26
|
+
const CommandList = /* @__PURE__ */ React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.List, {
|
|
27
27
|
ref,
|
|
28
28
|
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", "focus:outline-none", "scrollbar-thin scrollbar-gutter-stable", "scrollbar-track-transparent", "scrollbar-thumb-gray-300 hover:scrollbar-thumb-gray-300", "dark:scrollbar-thumb-charcoal-700 dark:hover:scrollbar-thumb-charcoal-700", "scrollbar-thumb-rounded-md", className),
|
|
29
29
|
...props
|
|
30
30
|
}));
|
|
31
31
|
CommandList.displayName = Command$1.List.displayName;
|
|
32
|
-
const CommandLoading = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(Command$1.Loading, {
|
|
32
|
+
const CommandLoading = /* @__PURE__ */ React.forwardRef((props, ref) => /* @__PURE__ */ jsx(Command$1.Loading, {
|
|
33
33
|
ref,
|
|
34
34
|
...props
|
|
35
35
|
}));
|
|
36
36
|
CommandLoading.displayName = Command$1.Loading.displayName;
|
|
37
|
-
const CommandEmpty = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
37
|
+
const CommandEmpty = /* @__PURE__ */ React.forwardRef((props, ref) => /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
38
38
|
ref,
|
|
39
39
|
...props
|
|
40
40
|
}));
|
|
41
41
|
CommandEmpty.displayName = Command$1.Empty.displayName;
|
|
42
|
-
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.Group, {
|
|
42
|
+
const CommandGroup = /* @__PURE__ */ React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.Group, {
|
|
43
43
|
ref,
|
|
44
44
|
className: cn("overflow-hidden px-0.5 py-1", "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className),
|
|
45
45
|
...props
|
|
46
46
|
}));
|
|
47
47
|
CommandGroup.displayName = Command$1.Group.displayName;
|
|
48
|
-
const CommandItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.Item, {
|
|
48
|
+
const CommandItem = /* @__PURE__ */ React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.Item, {
|
|
49
49
|
ref,
|
|
50
50
|
className: cn("relative flex select-none items-center justify-between", "h-8 gap-2 rounded-md py-1.5 pl-1.5 pr-2.5", "text-[14px] leading-4 outline-none", "border-y-2 border-white dark:border-slate-600", "data-[disabled=true]:pointer-events-none", "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
51
51
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","names":["CommandPrimitive"],"sources":["../../../../src/ui/components/command/command.tsx"],"sourcesContent":["import { cn, Icon } from \"#design-system\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport React from \"react\";\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex size-full flex-col rounded-md [&_[cmdk-label]]:hidden\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {\n wrapperClassName?: string;\n }\n>(({ wrapperClassName, className, ...props }, ref) => (\n <div\n className={cn(\n \"group relative flex items-center border-b\",\n \"border-b-gray-300 dark:border-b-gray-900\",\n \"hover:border-b-gray-300 dark:hover:border-b-gray-800\",\n \"hover:bg-gray-100 dark:hover:bg-gray-900\",\n \"focus-within:border-b-gray-300 dark:focus-within:border-b-gray-800\",\n \"focus-within:bg-gray-100 dark:focus-within:bg-gray-900\",\n wrapperClassName,\n )}\n cmdk-input-wrapper=\"\"\n >\n <Icon\n name=\"Search\"\n size={16}\n className={cn(\n \"pointer-events-none absolute left-2 top-3.5 text-gray-500 dark:text-gray-700\",\n \"group-hover:text-gray-700 dark:group-hover:text-gray-500\",\n \"group-focus-within:!text-gray-900 dark:group-focus-within:!text-gray-50\",\n )}\n />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex w-full bg-transparent pb-2 pl-8 pr-3 pt-3 text-[14px] font-normal leading-5 outline-none\",\n \"placeholder:text-gray-500 dark:placeholder:text-gray-700\",\n \"group-hover:placeholder:text-gray-700 dark:group-hover:placeholder:text-gray-500\",\n \"group-focus-within:placeholder:!text-gray-700 dark:group-focus-within:placeholder:!text-gray-300\",\n \"disabled:cursor-not-allowed\",\n className,\n )}\n {...props}\n />\n </div>\n));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n \"max-h-[300px] overflow-y-auto overflow-x-hidden\",\n \"focus:outline-none\",\n \"scrollbar-thin scrollbar-gutter-stable\",\n \"scrollbar-track-transparent\",\n \"scrollbar-thumb-gray-300 hover:scrollbar-thumb-gray-300\",\n \"dark:scrollbar-thumb-charcoal-700 dark:hover:scrollbar-thumb-charcoal-700\",\n \"scrollbar-thumb-rounded-md\",\n className,\n )}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandLoading = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Loading>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Loading>\n>((props, ref) => <CommandPrimitive.Loading ref={ref} {...props} />);\nCommandLoading.displayName = CommandPrimitive.Loading.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => <CommandPrimitive.Empty ref={ref} {...props} />);\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden px-0.5 py-1\",\n \"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex select-none items-center justify-between\",\n \"h-8 gap-2 rounded-md py-1.5 pl-1.5 pr-2.5\",\n \"text-[14px] leading-4 outline-none\",\n \"border-y-2 border-white dark:border-slate-600\",\n \"data-[disabled=true]:pointer-events-none\",\n \"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nexport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandLoading,\n};\n"],"mappings":";;;;;AAIA,
|
|
1
|
+
{"version":3,"file":"command.js","names":["cn","Icon","Command","CommandPrimitive","React","forwardRef","className","props","ref","displayName","CommandInput","wrapperClassName","Input","CommandList","List","CommandLoading","Loading","CommandEmpty","Empty","CommandGroup","Group","CommandItem","Item"],"sources":["../../../../src/ui/components/command/command.tsx"],"sourcesContent":["import { cn, Icon } from \"#design-system\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport React from \"react\";\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex size-full flex-col rounded-md [&_[cmdk-label]]:hidden\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & {\n wrapperClassName?: string;\n }\n>(({ wrapperClassName, className, ...props }, ref) => (\n <div\n className={cn(\n \"group relative flex items-center border-b\",\n \"border-b-gray-300 dark:border-b-gray-900\",\n \"hover:border-b-gray-300 dark:hover:border-b-gray-800\",\n \"hover:bg-gray-100 dark:hover:bg-gray-900\",\n \"focus-within:border-b-gray-300 dark:focus-within:border-b-gray-800\",\n \"focus-within:bg-gray-100 dark:focus-within:bg-gray-900\",\n wrapperClassName,\n )}\n cmdk-input-wrapper=\"\"\n >\n <Icon\n name=\"Search\"\n size={16}\n className={cn(\n \"pointer-events-none absolute left-2 top-3.5 text-gray-500 dark:text-gray-700\",\n \"group-hover:text-gray-700 dark:group-hover:text-gray-500\",\n \"group-focus-within:!text-gray-900 dark:group-focus-within:!text-gray-50\",\n )}\n />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex w-full bg-transparent pb-2 pl-8 pr-3 pt-3 text-[14px] font-normal leading-5 outline-none\",\n \"placeholder:text-gray-500 dark:placeholder:text-gray-700\",\n \"group-hover:placeholder:text-gray-700 dark:group-hover:placeholder:text-gray-500\",\n \"group-focus-within:placeholder:!text-gray-700 dark:group-focus-within:placeholder:!text-gray-300\",\n \"disabled:cursor-not-allowed\",\n className,\n )}\n {...props}\n />\n </div>\n));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n \"max-h-[300px] overflow-y-auto overflow-x-hidden\",\n \"focus:outline-none\",\n \"scrollbar-thin scrollbar-gutter-stable\",\n \"scrollbar-track-transparent\",\n \"scrollbar-thumb-gray-300 hover:scrollbar-thumb-gray-300\",\n \"dark:scrollbar-thumb-charcoal-700 dark:hover:scrollbar-thumb-charcoal-700\",\n \"scrollbar-thumb-rounded-md\",\n className,\n )}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandLoading = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Loading>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Loading>\n>((props, ref) => <CommandPrimitive.Loading ref={ref} {...props} />);\nCommandLoading.displayName = CommandPrimitive.Loading.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => <CommandPrimitive.Empty ref={ref} {...props} />);\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden px-0.5 py-1\",\n \"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex select-none items-center justify-between\",\n \"h-8 gap-2 rounded-md py-1.5 pl-1.5 pr-2.5\",\n \"text-[14px] leading-4 outline-none\",\n \"border-y-2 border-white dark:border-slate-600\",\n \"data-[disabled=true]:pointer-events-none\",\n \"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nexport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandLoading,\n};\n"],"mappings":";;;;;AAIA,MAAME,UAAUE,sBAAMC,YAGnB,EAAEC,WAAW,GAAGC,SAASC,QAC1B,oBAAC,WAAD;CACOA;CACL,WAAWR,GACT,8DACAM,UACD;CACD,GAAIC;CAEP,CAAA,CAAC;AACFL,QAAQO,cAAcN,UAAiBM;AAEvC,MAAMC,eAAeN,sBAAMC,YAKxB,EAAEM,kBAAkBL,WAAW,GAAGC,SAASC,QAC5C,qBAAC,OAAD;CACE,WAAWR,GACT,6CACA,4CACA,wDACA,4CACA,sEACA,0DACAW,iBACD;CACD,sBAAmB;WAVrB,CAYE,oBAAC,MAAD;EACE,MAAK;EACL,MAAM;EACN,WAAWX,GACT,gFACA,4DACA,0EACD;EAAC,CAAA,EAEJ,oBAAC,UAAiB,OAAlB;EACOQ;EACL,WAAWR,GACT,iGACA,4DACA,oFACA,oGACA,+BACAM,UACD;EACD,GAAIC;EAAM,CAAA,CAGf;GAAC;AACFG,aAAaD,cAAcN,UAAiBS,MAAMH;AAElD,MAAMI,cAAcT,sBAAMC,YAGvB,EAAEC,WAAW,GAAGC,SAASC,QAC1B,oBAAC,UAAiB,MAAlB;CACOA;CACL,WAAWR,GACT,mDACA,sBACA,0CACA,+BACA,2DACA,6EACA,8BACAM,UACD;CACD,GAAIC;CAEP,CAAA,CAAC;AACFM,YAAYJ,cAAcN,UAAiBW,KAAKL;AAEhD,MAAMM,iBAAiBX,sBAAMC,YAG1BE,OAAOC,QAAQ,oBAAC,UAAiB,SAAlB;CAA+BA;CAAK,GAAID;CAAS,CAAA,CAAC;AACpEQ,eAAeN,cAAcN,UAAiBa,QAAQP;AAEtD,MAAMQ,eAAeb,sBAAMC,YAGxBE,OAAOC,QAAQ,oBAAC,UAAiB,OAAlB;CAA6BA;CAAK,GAAID;CAAS,CAAA,CAAC;AAClEU,aAAaR,cAAcN,UAAiBe,MAAMT;AAElD,MAAMU,eAAef,sBAAMC,YAGxB,EAAEC,WAAW,GAAGC,SAASC,QAC1B,oBAAC,UAAiB,OAAlB;CACOA;CACL,WAAWR,GACT,+BACA,uIACAM,UACD;CACD,GAAIC;CAEP,CAAA,CAAC;AACFY,aAAaV,cAAcN,UAAiBiB,MAAMX;AAElD,MAAMY,cAAcjB,sBAAMC,YAGvB,EAAEC,WAAW,GAAGC,SAASC,QAC1B,oBAAC,UAAiB,MAAlB;CACOA;CACL,WAAWR,GACT,0DACA,6CACA,sCACA,iDACA,4CACA,+DACAM,UACD;CACD,GAAIC;CAEP,CAAA,CAAC;AACFc,YAAYZ,cAAcN,UAAiBmB,KAAKb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as EnumFieldProps, t as EnumField } from "../../../enum-field-
|
|
1
|
+
import { n as EnumFieldProps, t as EnumField } from "../../../enum-field-CBFI4x1f.js";
|
|
2
2
|
export { EnumField, EnumFieldProps };
|
|
@@ -3,7 +3,7 @@ import { SelectField } from "../select-field/select-field.js";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/ui/components/enum-field/enum-field.tsx
|
|
6
|
-
const EnumField = React.forwardRef(({ variant = "auto", options = [], ...props }, ref) => {
|
|
6
|
+
const EnumField = /* @__PURE__ */ React.forwardRef(({ variant = "auto", options = [], ...props }, ref) => {
|
|
7
7
|
const radio = /* @__PURE__ */ jsx(RadioGroupField, {
|
|
8
8
|
options,
|
|
9
9
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum-field.js","names":[],"sources":["../../../../src/ui/components/enum-field/enum-field.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n RadioGroupField,\n type RadioGroupFieldProps,\n} from \"../radio-group-field/radio-group-field.js\";\nimport {\n SelectField,\n type SelectFieldProps,\n} from \"../select-field/select-field.js\";\n\nexport type EnumFieldProps =\n | ({\n variant?: \"auto\";\n } & (RadioGroupFieldProps | SelectFieldProps))\n | ({\n variant: \"RadioGroup\";\n } & RadioGroupFieldProps)\n | ({\n variant: \"Select\";\n } & SelectFieldProps);\n\nexport const EnumField = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n EnumFieldProps\n>(({ variant = \"auto\", options = [], ...props }, ref) => {\n const radio = (\n <RadioGroupField\n options={options}\n {...(props as RadioGroupFieldProps)}\n ref={ref as React.ForwardedRef<HTMLDivElement>}\n />\n );\n const select = (\n <SelectField\n options={options}\n {...(props as SelectFieldProps)}\n ref={ref as React.ForwardedRef<HTMLButtonElement>}\n />\n );\n\n switch (variant) {\n case \"RadioGroup\":\n return radio;\n case \"Select\":\n return select;\n case \"auto\":\n return options.length < 6 ? radio : select;\n }\n});\n\nEnumField.displayName = \"EnumField\";\n"],"mappings":";;;;;AAqBA,
|
|
1
|
+
{"version":3,"file":"enum-field.js","names":["React","RadioGroupField","SelectField","EnumField","forwardRef","variant","options","props","ref","radio","select","length","displayName"],"sources":["../../../../src/ui/components/enum-field/enum-field.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n RadioGroupField,\n type RadioGroupFieldProps,\n} from \"../radio-group-field/radio-group-field.js\";\nimport {\n SelectField,\n type SelectFieldProps,\n} from \"../select-field/select-field.js\";\n\nexport type EnumFieldProps =\n | ({\n variant?: \"auto\";\n } & (RadioGroupFieldProps | SelectFieldProps))\n | ({\n variant: \"RadioGroup\";\n } & RadioGroupFieldProps)\n | ({\n variant: \"Select\";\n } & SelectFieldProps);\n\nexport const EnumField = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n EnumFieldProps\n>(({ variant = \"auto\", options = [], ...props }, ref) => {\n const radio = (\n <RadioGroupField\n options={options}\n {...(props as RadioGroupFieldProps)}\n ref={ref as React.ForwardedRef<HTMLDivElement>}\n />\n );\n const select = (\n <SelectField\n options={options}\n {...(props as SelectFieldProps)}\n ref={ref as React.ForwardedRef<HTMLButtonElement>}\n />\n );\n\n switch (variant) {\n case \"RadioGroup\":\n return radio;\n case \"Select\":\n return select;\n case \"auto\":\n return options.length < 6 ? radio : select;\n }\n});\n\nEnumField.displayName = \"EnumField\";\n"],"mappings":";;;;;AAqBA,MAAaG,YAAYH,sBAAMI,YAG5B,EAAEC,UAAU,QAAQC,UAAU,EAAE,EAAE,GAAGC,SAASC,QAAQ;CACvD,MAAMC,QACJ,oBAAC,iBAAD;EACWH;EACT,GAAKC;EACAC;EAER,CAAA;CACD,MAAME,SACJ,oBAAC,aAAD;EACWJ;EACT,GAAKC;EACAC;EAER,CAAA;AAED,SAAQH,SAAR;EACE,KAAK,aACH,QAAOI;EACT,KAAK,SACH,QAAOC;EACT,KAAK,OACH,QAAOJ,QAAQK,SAAS,IAAIF,QAAQC;;EAExC;AAEFP,UAAUS,cAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as SelectProps, S as SelectOption, b as RadioGroupProps, x as SelectBaseProps } from "../../../index-
|
|
1
|
+
import { C as SelectProps, S as SelectOption, b as RadioGroupProps, x as SelectBaseProps } from "../../../index-B6YyDoT1.js";
|
|
2
2
|
export { RadioGroupProps, SelectBaseProps, SelectOption, SelectProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Form } from "../../../form-
|
|
1
|
+
import { t as Form } from "../../../form-CKRKn0TQ.js";
|
|
2
2
|
export { Form };
|
|
@@ -41,7 +41,7 @@ import { FormProvider, useForm } from "react-hook-form";
|
|
|
41
41
|
* </Form>
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
const Form = forwardRef(({ children, onSubmit, resetOnSuccessfulSubmit = false, submitChangesOnly = false, defaultValues, renderSubmitErrorsManually = false, submissionErrorMatcher = defaultOnError, className, extraFormProps }, ref) => {
|
|
44
|
+
const Form = /* @__PURE__ */ forwardRef(({ children, onSubmit, resetOnSuccessfulSubmit = false, submitChangesOnly = false, defaultValues, renderSubmitErrorsManually = false, submissionErrorMatcher = defaultOnError, className, extraFormProps }, ref) => {
|
|
45
45
|
const formId = useId();
|
|
46
46
|
const methods = useForm({
|
|
47
47
|
defaultValues,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","names":[],"sources":["../../../../src/ui/components/form/form.tsx"],"sourcesContent":["import type { ValueCast } from \"#design-system/ui/lib\";\nimport { castValue, deepEqual, isEmpty } from \"#design-system/ui/lib\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n} from \"react\";\nimport type { UseFormProps, UseFormReturn } from \"react-hook-form\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { FormServerErrorMessage } from \"../form-message/form-server-error-message.js\";\nimport { defaultOnError } from \"./utils.js\";\n\ntype FormMethods = UseFormReturn & {\n /**\n * Trigger the form submit event\n */\n triggerSubmit: () => void;\n\n /**\n * The id of the form in the DOM\n */\n formId: string;\n};\ninterface FormProps {\n /**\n * Content of the form. Can be either React nodes or a render function that receives form methods\n * and returns React nodes. The render function approach is useful when you need access to form state\n * or methods (e.g., to disable submit button while submitting).\n */\n children: React.ReactNode | ((methods: FormMethods) => React.ReactNode);\n\n /**\n * Handler called when the form is submitted. Receives the form data as an argument.\n * The data structure will match the names of your form fields.\n *\n * @param data - An object containing the form values, keyed by field names\n */\n onSubmit: (data: any) => void | Promise<void>;\n\n /**\n * Whether to reset the form after a successful submit.\n *\n * @default false\n */\n resetOnSuccessfulSubmit?: boolean;\n\n /**\n * Whether to submit only changed values.\n *\n * When enabled, the `onSubmit` callback will only receive fields whose values differ from their\n * corresponding `defaultValues`.\n *\n * @default false\n */\n submitChangesOnly?: boolean;\n\n /**\n * Initial values for the form fields. Keys should match the 'name' props of your form fields.\n * Useful for editing existing data or setting initial state.\n */\n defaultValues?: Record<string, any>;\n\n /**\n * Whether to handle errors that happen during the submit process manually instead of showing\n * them automatically.\n *\n * @default false The errors will be rendered automatically on top of the form.\n */\n renderSubmitErrorsManually?: boolean;\n\n /**\n * Additional props to pass to the form config from react-hook-form.\n *\n * Note: this could affect the form behavior, use with caution.\n */\n extraFormProps?: UseFormProps;\n\n /**\n * Callback to match a submission error with one or more form fields or form level errors.\n *\n * @default defaultOnError The form tries to match the error with a field name by default and if it\n * doesn't match any field name, then an generic error or the error message will be shown as a form\n * level error.\n *\n * @returns An object where each key should be a field name or \"root.serverError\" for form level errors.\n * If the keys doesn't match any field name, then the UI error should be handled manually using the form\n * error state to get the message.\n */\n submissionErrorMatcher?: (\n error: Error,\n fieldNames: string[],\n ) => Record<string, string>;\n\n /**\n * Additional CSS class name to apply to the form element.\n * Use this to customize the form's styling.\n */\n className?: string;\n}\n\n/**\n * A form component that integrates with react-hook-form for form state management and validation.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <Form onSubmit={handleSubmit}>\n * <StringField name=\"email\" label=\"Email\" />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n *\n * // With form methods access\n * <Form onSubmit={handleSubmit}>\n * {({ formState: { isSubmitting } }) => (\n * <>\n * <StringField name=\"email\" label=\"Email\" />\n * <Button type=\"submit\" disabled={isSubmitting}>\n * {isSubmitting ? 'Submitting...' : 'Submit'}\n * </Button>\n * </>\n * )}\n * </Form>\n *\n * // With default values\n * <Form\n * onSubmit={handleSubmit}\n * defaultValues={{\n * email: 'user@example.com'\n * }}\n * >\n * <StringField name=\"email\" label=\"Email\" />\n * </Form>\n * ```\n */\nexport const Form = forwardRef<UseFormReturn, FormProps>(\n (\n {\n children,\n onSubmit,\n resetOnSuccessfulSubmit = false,\n submitChangesOnly = false,\n defaultValues,\n renderSubmitErrorsManually = false,\n submissionErrorMatcher = defaultOnError,\n className,\n extraFormProps,\n },\n ref,\n ) => {\n const formId = useId();\n const methods = useForm({\n defaultValues,\n criteriaMode: \"all\", // display all errors at once\n ...extraFormProps,\n });\n useImperativeHandle(ref, () => methods, [methods]);\n\n useEffect(() => {\n if (resetOnSuccessfulSubmit && methods.formState.isSubmitSuccessful) {\n methods.reset({ ...(defaultValues ?? {}) });\n }\n }, [\n resetOnSuccessfulSubmit,\n methods,\n methods.formState.isSubmitSuccessful,\n defaultValues,\n ]);\n\n const wrappedOnSubmit = useCallback(\n async (rawData: Record<string, any>) => {\n try {\n let data = rawData;\n // we should make sure that empty fields are submitted as `null`\n // react-hook-form doesn't submit fields with `undefined` values\n // so we need to add them to the data as `null`\n Object.keys(methods.control._fields).forEach((fieldName) => {\n if (!Object.keys(data).includes(fieldName)) {\n data[fieldName] = null;\n }\n });\n\n if (submitChangesOnly && !!defaultValues) {\n // remove fields that didn't change it's value\n data = Object.fromEntries(\n Object.entries(rawData).filter(\n ([fieldName, value]) =>\n !deepEqual(value, defaultValues[fieldName]),\n ),\n );\n }\n\n // at this point all the fields that need to be submitted are in the data\n // we just need to make sure that \"empty\" values are submitted as `null`\n data = Object.fromEntries(\n Object.entries(data).map(([fieldName, value]) => [\n fieldName,\n isEmpty(value) ? null : value,\n ]),\n );\n\n // cast data if needed to prevent submitting wrong data type\n const form = document.getElementById(formId);\n Object.keys(data).map((key) => {\n try {\n const value: unknown = data[key];\n if (value !== null) {\n const field = form?.querySelector(`[name=\"${key}\"]`);\n const dataCast = field?.getAttribute(\"data-cast\");\n if (dataCast) {\n data[key] = castValue(\n value,\n dataCast as ValueCast,\n ) as unknown;\n }\n }\n } catch (error) {\n // print out the error but continue the execution\n console.error(error);\n }\n });\n\n // we need to return the promise from the onSubmit callback if there is one\n // so react-hook-form can wait for it to resolve and update the form state correctly\n return await onSubmit(data);\n } catch (error: any) {\n const errors = submissionErrorMatcher(\n error as Error,\n Object.keys(methods.control._fields),\n );\n\n Object.entries(errors).forEach(([key, value]) => {\n methods.setError(key, {\n type: \"serverError\",\n message: value,\n types: {\n serverError: value,\n },\n });\n });\n }\n },\n [\n methods,\n submitChangesOnly,\n defaultValues,\n formId,\n onSubmit,\n submissionErrorMatcher,\n ],\n );\n\n const triggerSubmit = useCallback(() => {\n // trigger form submit event\n const form = document.getElementById(formId);\n if (form) {\n form.dispatchEvent(new Event(\"submit\", { bubbles: true }));\n }\n }, [formId]);\n\n return (\n <FormProvider {...methods}>\n {!renderSubmitErrorsManually &&\n methods.formState.errors.root?.serverError.message && (\n <div className=\"mb-2\">\n <FormServerErrorMessage />\n </div>\n )}\n\n <form\n id={formId}\n onSubmit={methods.handleSubmit(wrappedOnSubmit)}\n className={className}\n noValidate\n >\n {typeof children === \"function\"\n ? children({\n ...methods,\n triggerSubmit,\n formId,\n })\n : children}\n </form>\n </FormProvider>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwIA,MAAa,OAAO,YAEhB,EACE,UACA,UACA,0BAA0B,OAC1B,oBAAoB,OACpB,eACA,6BAA6B,OAC7B,yBAAyB,gBACzB,WACA,kBAEF,QACG;CACH,MAAM,SAAS,OAAO;CACtB,MAAM,UAAU,QAAQ;EACtB;EACA,cAAc;EACd,GAAG;EACJ,CAAC;AACF,qBAAoB,WAAW,SAAS,CAAC,QAAQ,CAAC;AAElD,iBAAgB;AACd,MAAI,2BAA2B,QAAQ,UAAU,mBAC/C,SAAQ,MAAM,EAAE,GAAI,iBAAiB,EAAE,EAAG,CAAC;IAE5C;EACD;EACA;EACA,QAAQ,UAAU;EAClB;EACD,CAAC;CAEF,MAAM,kBAAkB,YACtB,OAAO,YAAiC;AACtC,MAAI;GACF,IAAI,OAAO;AAIX,UAAO,KAAK,QAAQ,QAAQ,QAAQ,CAAC,SAAS,cAAc;AAC1D,QAAI,CAAC,OAAO,KAAK,KAAK,CAAC,SAAS,UAAU,CACxC,MAAK,aAAa;KAEpB;AAEF,OAAI,qBAAqB,CAAC,CAAC,cAEzB,QAAO,OAAO,YACZ,OAAO,QAAQ,QAAQ,CAAC,QACrB,CAAC,WAAW,WACX,CAAC,UAAU,OAAO,cAAc,WAAW,CAC9C,CACF;AAKH,UAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,CAAC,KAAK,CAAC,WAAW,WAAW,CAC/C,WACA,QAAQ,MAAM,GAAG,OAAO,MACzB,CAAC,CACH;GAGD,MAAM,OAAO,SAAS,eAAe,OAAO;AAC5C,UAAO,KAAK,KAAK,CAAC,KAAK,QAAQ;AAC7B,QAAI;KACF,MAAM,QAAiB,KAAK;AAC5B,SAAI,UAAU,MAAM;MAElB,MAAM,YADQ,MAAM,cAAc,UAAU,IAAI,IAAI,GAC5B,aAAa,YAAY;AACjD,UAAI,SACF,MAAK,OAAO,UACV,OACA,SACD;;aAGE,OAAO;AAEd,aAAQ,MAAM,MAAM;;KAEtB;AAIF,UAAO,MAAM,SAAS,KAAK;WACpB,OAAY;GACnB,MAAM,SAAS,uBACb,OACA,OAAO,KAAK,QAAQ,QAAQ,QAAQ,CACrC;AAED,UAAO,QAAQ,OAAO,CAAC,SAAS,CAAC,KAAK,WAAW;AAC/C,YAAQ,SAAS,KAAK;KACpB,MAAM;KACN,SAAS;KACT,OAAO,EACL,aAAa,OACd;KACF,CAAC;KACF;;IAGN;EACE;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAED,MAAM,gBAAgB,kBAAkB;EAEtC,MAAM,OAAO,SAAS,eAAe,OAAO;AAC5C,MAAI,KACF,MAAK,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,MAAM,CAAC,CAAC;IAE3D,CAAC,OAAO,CAAC;AAEZ,QACE,qBAAC,cAAD;EAAc,GAAI;YAAlB,CACG,CAAC,8BACA,QAAQ,UAAU,OAAO,MAAM,YAAY,WACzC,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,wBAAD,EAA0B,CAAA;GACtB,CAAA,EAGV,oBAAC,QAAD;GACE,IAAI;GACJ,UAAU,QAAQ,aAAa,gBAAgB;GACpC;GACX,YAAA;aAEC,OAAO,aAAa,aACjB,SAAS;IACP,GAAG;IACH;IACA;IACD,CAAC,GACF;GACC,CAAA,CACM;;EAGpB"}
|
|
1
|
+
{"version":3,"file":"form.js","names":["castValue","deepEqual","isEmpty","forwardRef","useCallback","useEffect","useId","useImperativeHandle","FormProvider","useForm","FormServerErrorMessage","defaultOnError","Form","children","onSubmit","resetOnSuccessfulSubmit","submitChangesOnly","defaultValues","renderSubmitErrorsManually","submissionErrorMatcher","className","extraFormProps","ref","formId","methods","criteriaMode","formState","isSubmitSuccessful","reset","wrappedOnSubmit","rawData","data","Object","keys","control","_fields","forEach","fieldName","includes","fromEntries","entries","filter","value","map","form","document","getElementById","key","field","querySelector","dataCast","getAttribute","error","console","errors","setError","type","message","types","serverError","triggerSubmit","dispatchEvent","Event","bubbles","root","handleSubmit"],"sources":["../../../../src/ui/components/form/form.tsx"],"sourcesContent":["import type { ValueCast } from \"#design-system/ui/lib\";\nimport { castValue, deepEqual, isEmpty } from \"#design-system/ui/lib\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n} from \"react\";\nimport type { UseFormProps, UseFormReturn } from \"react-hook-form\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { FormServerErrorMessage } from \"../form-message/form-server-error-message.js\";\nimport { defaultOnError } from \"./utils.js\";\n\ntype FormMethods = UseFormReturn & {\n /**\n * Trigger the form submit event\n */\n triggerSubmit: () => void;\n\n /**\n * The id of the form in the DOM\n */\n formId: string;\n};\ninterface FormProps {\n /**\n * Content of the form. Can be either React nodes or a render function that receives form methods\n * and returns React nodes. The render function approach is useful when you need access to form state\n * or methods (e.g., to disable submit button while submitting).\n */\n children: React.ReactNode | ((methods: FormMethods) => React.ReactNode);\n\n /**\n * Handler called when the form is submitted. Receives the form data as an argument.\n * The data structure will match the names of your form fields.\n *\n * @param data - An object containing the form values, keyed by field names\n */\n onSubmit: (data: any) => void | Promise<void>;\n\n /**\n * Whether to reset the form after a successful submit.\n *\n * @default false\n */\n resetOnSuccessfulSubmit?: boolean;\n\n /**\n * Whether to submit only changed values.\n *\n * When enabled, the `onSubmit` callback will only receive fields whose values differ from their\n * corresponding `defaultValues`.\n *\n * @default false\n */\n submitChangesOnly?: boolean;\n\n /**\n * Initial values for the form fields. Keys should match the 'name' props of your form fields.\n * Useful for editing existing data or setting initial state.\n */\n defaultValues?: Record<string, any>;\n\n /**\n * Whether to handle errors that happen during the submit process manually instead of showing\n * them automatically.\n *\n * @default false The errors will be rendered automatically on top of the form.\n */\n renderSubmitErrorsManually?: boolean;\n\n /**\n * Additional props to pass to the form config from react-hook-form.\n *\n * Note: this could affect the form behavior, use with caution.\n */\n extraFormProps?: UseFormProps;\n\n /**\n * Callback to match a submission error with one or more form fields or form level errors.\n *\n * @default defaultOnError The form tries to match the error with a field name by default and if it\n * doesn't match any field name, then an generic error or the error message will be shown as a form\n * level error.\n *\n * @returns An object where each key should be a field name or \"root.serverError\" for form level errors.\n * If the keys doesn't match any field name, then the UI error should be handled manually using the form\n * error state to get the message.\n */\n submissionErrorMatcher?: (\n error: Error,\n fieldNames: string[],\n ) => Record<string, string>;\n\n /**\n * Additional CSS class name to apply to the form element.\n * Use this to customize the form's styling.\n */\n className?: string;\n}\n\n/**\n * A form component that integrates with react-hook-form for form state management and validation.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <Form onSubmit={handleSubmit}>\n * <StringField name=\"email\" label=\"Email\" />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n *\n * // With form methods access\n * <Form onSubmit={handleSubmit}>\n * {({ formState: { isSubmitting } }) => (\n * <>\n * <StringField name=\"email\" label=\"Email\" />\n * <Button type=\"submit\" disabled={isSubmitting}>\n * {isSubmitting ? 'Submitting...' : 'Submit'}\n * </Button>\n * </>\n * )}\n * </Form>\n *\n * // With default values\n * <Form\n * onSubmit={handleSubmit}\n * defaultValues={{\n * email: 'user@example.com'\n * }}\n * >\n * <StringField name=\"email\" label=\"Email\" />\n * </Form>\n * ```\n */\nexport const Form = forwardRef<UseFormReturn, FormProps>(\n (\n {\n children,\n onSubmit,\n resetOnSuccessfulSubmit = false,\n submitChangesOnly = false,\n defaultValues,\n renderSubmitErrorsManually = false,\n submissionErrorMatcher = defaultOnError,\n className,\n extraFormProps,\n },\n ref,\n ) => {\n const formId = useId();\n const methods = useForm({\n defaultValues,\n criteriaMode: \"all\", // display all errors at once\n ...extraFormProps,\n });\n useImperativeHandle(ref, () => methods, [methods]);\n\n useEffect(() => {\n if (resetOnSuccessfulSubmit && methods.formState.isSubmitSuccessful) {\n methods.reset({ ...(defaultValues ?? {}) });\n }\n }, [\n resetOnSuccessfulSubmit,\n methods,\n methods.formState.isSubmitSuccessful,\n defaultValues,\n ]);\n\n const wrappedOnSubmit = useCallback(\n async (rawData: Record<string, any>) => {\n try {\n let data = rawData;\n // we should make sure that empty fields are submitted as `null`\n // react-hook-form doesn't submit fields with `undefined` values\n // so we need to add them to the data as `null`\n Object.keys(methods.control._fields).forEach((fieldName) => {\n if (!Object.keys(data).includes(fieldName)) {\n data[fieldName] = null;\n }\n });\n\n if (submitChangesOnly && !!defaultValues) {\n // remove fields that didn't change it's value\n data = Object.fromEntries(\n Object.entries(rawData).filter(\n ([fieldName, value]) =>\n !deepEqual(value, defaultValues[fieldName]),\n ),\n );\n }\n\n // at this point all the fields that need to be submitted are in the data\n // we just need to make sure that \"empty\" values are submitted as `null`\n data = Object.fromEntries(\n Object.entries(data).map(([fieldName, value]) => [\n fieldName,\n isEmpty(value) ? null : value,\n ]),\n );\n\n // cast data if needed to prevent submitting wrong data type\n const form = document.getElementById(formId);\n Object.keys(data).map((key) => {\n try {\n const value: unknown = data[key];\n if (value !== null) {\n const field = form?.querySelector(`[name=\"${key}\"]`);\n const dataCast = field?.getAttribute(\"data-cast\");\n if (dataCast) {\n data[key] = castValue(\n value,\n dataCast as ValueCast,\n ) as unknown;\n }\n }\n } catch (error) {\n // print out the error but continue the execution\n console.error(error);\n }\n });\n\n // we need to return the promise from the onSubmit callback if there is one\n // so react-hook-form can wait for it to resolve and update the form state correctly\n return await onSubmit(data);\n } catch (error: any) {\n const errors = submissionErrorMatcher(\n error as Error,\n Object.keys(methods.control._fields),\n );\n\n Object.entries(errors).forEach(([key, value]) => {\n methods.setError(key, {\n type: \"serverError\",\n message: value,\n types: {\n serverError: value,\n },\n });\n });\n }\n },\n [\n methods,\n submitChangesOnly,\n defaultValues,\n formId,\n onSubmit,\n submissionErrorMatcher,\n ],\n );\n\n const triggerSubmit = useCallback(() => {\n // trigger form submit event\n const form = document.getElementById(formId);\n if (form) {\n form.dispatchEvent(new Event(\"submit\", { bubbles: true }));\n }\n }, [formId]);\n\n return (\n <FormProvider {...methods}>\n {!renderSubmitErrorsManually &&\n methods.formState.errors.root?.serverError.message && (\n <div className=\"mb-2\">\n <FormServerErrorMessage />\n </div>\n )}\n\n <form\n id={formId}\n onSubmit={methods.handleSubmit(wrappedOnSubmit)}\n className={className}\n noValidate\n >\n {typeof children === \"function\"\n ? children({\n ...methods,\n triggerSubmit,\n formId,\n })\n : children}\n </form>\n </FormProvider>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwIA,MAAaY,OAAOT,4BAEhB,EACEU,UACAC,UACAC,0BAA0B,OAC1BC,oBAAoB,OACpBC,eACAC,6BAA6B,OAC7BC,yBAAyBR,gBACzBS,WACAC,kBAEFC,QACG;CACH,MAAMC,SAASjB,OAAO;CACtB,MAAMkB,UAAUf,QAAQ;EACtBQ;EACAQ,cAAc;EACd,GAAGJ;EACJ,CAAC;AACFd,qBAAoBe,WAAWE,SAAS,CAACA,QAAQ,CAAC;AAElDnB,iBAAgB;AACd,MAAIU,2BAA2BS,QAAQE,UAAUC,mBAC/CH,SAAQI,MAAM,EAAE,GAAIX,iBAAiB,EAAE,EAAG,CAAC;IAE5C;EACDF;EACAS;EACAA,QAAQE,UAAUC;EAClBV;EACD,CAAC;CAEF,MAAMY,kBAAkBzB,YACtB,OAAO0B,YAAiC;AACtC,MAAI;GACF,IAAIC,OAAOD;AAIXE,UAAOC,KAAKT,QAAQU,QAAQC,QAAQ,CAACC,SAASC,cAAc;AAC1D,QAAI,CAACL,OAAOC,KAAKF,KAAK,CAACO,SAASD,UAAU,CACxCN,MAAKM,aAAa;KAEpB;AAEF,OAAIrB,qBAAqB,CAAC,CAACC,cAEzBc,QAAOC,OAAOO,YACZP,OAAOQ,QAAQV,QAAQ,CAACW,QACrB,CAACJ,WAAWK,WACX,CAACzC,UAAUyC,OAAOzB,cAAcoB,WACpC,CACF,CAAC;AAKHN,UAAOC,OAAOO,YACZP,OAAOQ,QAAQT,KAAK,CAACY,KAAK,CAACN,WAAWK,WAAW,CAC/CL,WACAnC,QAAQwC,MAAM,GAAG,OAAOA,MACzB,CACH,CAAC;GAGD,MAAME,OAAOC,SAASC,eAAevB,OAAO;AAC5CS,UAAOC,KAAKF,KAAK,CAACY,KAAKI,QAAQ;AAC7B,QAAI;KACF,MAAML,QAAiBX,KAAKgB;AAC5B,SAAIL,UAAU,MAAM;MAElB,MAAMQ,YADQN,MAAMK,cAAc,UAAUF,IAAG,IAAK,GAC5BI,aAAa,YAAY;AACjD,UAAID,SACFnB,MAAKgB,OAAO/C,UACV0C,OACAQ,SACU;;aAGTE,OAAO;AAEdC,aAAQD,MAAMA,MAAM;;KAEtB;AAIF,UAAO,MAAMtC,SAASiB,KAAK;WACpBqB,OAAY;GACnB,MAAME,SAASnC,uBACbiC,OACApB,OAAOC,KAAKT,QAAQU,QAAQC,QAC9B,CAAC;AAEDH,UAAOQ,QAAQc,OAAO,CAAClB,SAAS,CAACW,KAAKL,WAAW;AAC/ClB,YAAQ+B,SAASR,KAAK;KACpBS,MAAM;KACNC,SAASf;KACTgB,OAAO,EACLC,aAAajB,OACf;KACD,CAAC;KACF;;IAGN;EACElB;EACAR;EACAC;EACAM;EACAT;EACAK;EAEJ,CAAC;CAED,MAAMyC,gBAAgBxD,kBAAkB;EAEtC,MAAMwC,OAAOC,SAASC,eAAevB,OAAO;AAC5C,MAAIqB,KACFA,MAAKiB,cAAc,IAAIC,MAAM,UAAU,EAAEC,SAAS,MAAM,CAAC,CAAC;IAE3D,CAACxC,OAAO,CAAC;AAEZ,QACE,qBAAC,cAAD;EAAc,GAAIC;YAAlB,CACG,CAACN,8BACAM,QAAQE,UAAU4B,OAAOU,MAAML,YAAYF,WACzC,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,wBAAD,EAAuB,CAAA;GAE1B,CAAA,EAEH,oBAAC,QAAD;GACE,IAAIlC;GACJ,UAAUC,QAAQyC,aAAapC,gBAAgB;GACpCT;GACX,YAAA;aAEC,OAAOP,aAAa,aACjBA,SAAS;IACP,GAAGW;IACHoC;IACArC;IACD,CAAC,GACFV;GACA,CAAA,CACO;;EAGpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../../src/ui/components/form/utils.ts"],"sourcesContent":["export interface SupportedErrorObject extends Error {\n data: {\n path?: string;\n message?: string;\n }[];\n}\n\nexport const isSupportedErrorObject = (\n error: object,\n): error is SupportedErrorObject => {\n return (\n typeof error === \"object\" &&\n Object.hasOwn(error, \"data\") &&\n Array.isArray((error as { data?: unknown }).data)\n );\n};\n\nexport const defaultOnError = (\n error: Error,\n fieldNames: string[],\n): Record<string, string> => {\n let message = \"An error occurred while submitting the data\";\n let formErrorPath = \"root.serverError\"; // form level error by default\n\n if (typeof error === \"object\" && isSupportedErrorObject(error)) {\n const path = error.data[0]?.path;\n if (error.data[0]?.message) {\n message = error.data[0].message;\n }\n if (Array.isArray(path)) {\n // maybe we can reconciliate this error with a form field\n if (path.length === 1 && fieldNames.includes(path[0] as string)) {\n formErrorPath = path[0] as string;\n }\n }\n }\n\n return {\n [formErrorPath]: message,\n };\n};\n"],"mappings":";AAOA,
|
|
1
|
+
{"version":3,"file":"utils.js","names":["isSupportedErrorObject","error","Object","hasOwn","Array","isArray","data","defaultOnError","fieldNames","message","formErrorPath","path","length","includes"],"sources":["../../../../src/ui/components/form/utils.ts"],"sourcesContent":["export interface SupportedErrorObject extends Error {\n data: {\n path?: string;\n message?: string;\n }[];\n}\n\nexport const isSupportedErrorObject = (\n error: object,\n): error is SupportedErrorObject => {\n return (\n typeof error === \"object\" &&\n Object.hasOwn(error, \"data\") &&\n Array.isArray((error as { data?: unknown }).data)\n );\n};\n\nexport const defaultOnError = (\n error: Error,\n fieldNames: string[],\n): Record<string, string> => {\n let message = \"An error occurred while submitting the data\";\n let formErrorPath = \"root.serverError\"; // form level error by default\n\n if (typeof error === \"object\" && isSupportedErrorObject(error)) {\n const path = error.data[0]?.path;\n if (error.data[0]?.message) {\n message = error.data[0].message;\n }\n if (Array.isArray(path)) {\n // maybe we can reconciliate this error with a form field\n if (path.length === 1 && fieldNames.includes(path[0] as string)) {\n formErrorPath = path[0] as string;\n }\n }\n }\n\n return {\n [formErrorPath]: message,\n };\n};\n"],"mappings":";AAOA,MAAaA,0BACXC,UACkC;AAClC,QACE,OAAOA,UAAU,YACjBC,OAAOC,OAAOF,OAAO,OAAO,IAC5BG,MAAMC,QAASJ,MAA6BK,KAAK;;AAIrD,MAAaC,kBACXN,OACAO,eAC2B;CAC3B,IAAIC,UAAU;CACd,IAAIC,gBAAgB;AAEpB,KAAI,OAAOT,UAAU,YAAYD,uBAAuBC,MAAM,EAAE;EAC9D,MAAMU,OAAOV,MAAMK,KAAK,IAAIK;AAC5B,MAAIV,MAAMK,KAAK,IAAIG,QACjBA,WAAUR,MAAMK,KAAK,GAAGG;AAE1B,MAAIL,MAAMC,QAAQM,KAAK;OAEjBA,KAAKC,WAAW,KAAKJ,WAAWK,SAASF,KAAK,GAAa,CAC7DD,iBAAgBC,KAAK;;;AAK3B,QAAO,GACJD,gBAAgBD,SAClB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FormDescriptionProps, t as FormDescription } from "../../../form-description-
|
|
1
|
+
import { n as FormDescriptionProps, t as FormDescription } from "../../../form-description-CYkcMEzm.js";
|
|
2
2
|
export { FormDescription, FormDescriptionProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as cn } from "../../../src-
|
|
1
|
+
import { t as cn } from "../../../src-8xf1ueaA.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/ui/components/form-description/form-description.tsx
|
|
4
4
|
const FormDescription = ({ children, as, className }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-description.js","names":[],"sources":["../../../../src/ui/components/form-description/form-description.tsx"],"sourcesContent":["import { cn } from \"#design-system\";\n\nexport interface FormDescriptionProps extends React.PropsWithChildren {\n as?: React.ElementType;\n className?: string;\n}\n\nconst FormDescription: React.FC<FormDescriptionProps> = ({\n children,\n as,\n className,\n}) => {\n const Component = as ?? \"p\";\n\n return (\n <Component\n className={cn(\n \"font-sans text-sm font-normal leading-5 text-gray-600 dark:text-gray-500\",\n className,\n )}\n >\n {children}\n </Component>\n );\n};\n\nexport { FormDescription };\n"],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"form-description.js","names":["cn","FormDescription","children","as","className","Component"],"sources":["../../../../src/ui/components/form-description/form-description.tsx"],"sourcesContent":["import { cn } from \"#design-system\";\n\nexport interface FormDescriptionProps extends React.PropsWithChildren {\n as?: React.ElementType;\n className?: string;\n}\n\nconst FormDescription: React.FC<FormDescriptionProps> = ({\n children,\n as,\n className,\n}) => {\n const Component = as ?? \"p\";\n\n return (\n <Component\n className={cn(\n \"font-sans text-sm font-normal leading-5 text-gray-600 dark:text-gray-500\",\n className,\n )}\n >\n {children}\n </Component>\n );\n};\n\nexport { FormDescription };\n"],"mappings":";;;AAOA,MAAMC,mBAAmD,EACvDC,UACAC,IACAC,gBACI;AAGJ,QACE,oBAHgBD,MAAM,KAGtB;EACE,WAAWH,GACT,4EACAI,UACD;EAEAF;EACS,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as FormGroup } from "../../../form-group-
|
|
1
|
+
import { t as FormGroup } from "../../../form-group-C8kL6pdZ.js";
|
|
2
2
|
export { FormGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-group.js","names":[],"sources":["../../../../src/ui/components/form-group/form-group.tsx"],"sourcesContent":["export const FormGroup: React.FC<React.PropsWithChildren> = ({ children }) => {\n return <div className=\"flex flex-col gap-2\">{children}</div>;\n};\n"],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"form-group.js","names":["FormGroup","children"],"sources":["../../../../src/ui/components/form-group/form-group.tsx"],"sourcesContent":["export const FormGroup: React.FC<React.PropsWithChildren> = ({ children }) => {\n return <div className=\"flex flex-col gap-2\">{children}</div>;\n};\n"],"mappings":";;AAAA,MAAaA,aAAgD,EAAEC,eAAe;AAC5E,QAAO,oBAAC,OAAD;EAAK,WAAU;EAAuBA;EAAe,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FormLabelProps, t as FormLabel } from "../../../form-label-
|
|
1
|
+
import { n as FormLabelProps, t as FormLabel } from "../../../form-label-b6nQi0XO.js";
|
|
2
2
|
export { FormLabel, FormLabelProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as Icon, t as cn } from "../../../src-
|
|
1
|
+
import { h as Icon, t as cn } from "../../../src-8xf1ueaA.js";
|
|
2
2
|
import { Tooltip, TooltipProvider as Provider } from "../tooltip/tooltip.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/ui/components/form-label/form-label.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-label.js","names":["TooltipProvider"],"sources":["../../../../src/ui/components/form-label/form-label.tsx"],"sourcesContent":["import { cn, Icon } from \"#design-system\";\nimport { Tooltip, TooltipProvider } from \"../tooltip/tooltip.js\";\n\nexport interface FormLabelProps\n extends React.PropsWithChildren, React.LabelHTMLAttributes<HTMLLabelElement> {\n required?: boolean;\n disabled?: boolean;\n description?: string;\n hasError?: boolean;\n inline?: boolean;\n className?: string;\n}\n\nexport const FormLabel: React.FC<FormLabelProps> = ({\n children,\n required,\n disabled,\n description,\n hasError,\n inline,\n className,\n ...htmlLabelProps\n}) => {\n const classes = cn(\n \"inline-flex items-center text-sm font-medium\",\n inline ? \"leading-[22px]\" : \"leading-4\",\n `text-gray-900 ${inline ? \"dark:text-gray-400\" : \"dark:text-gray-50\"}`,\n hasError && \"group-hover:!text-red-900 dark:group-hover:!text-red-900\",\n hasError && inline && \"text-red-800 dark:text-red-800\",\n hasError && !inline && \"text-red-900 dark:text-red-900\",\n disabled &&\n `cursor-not-allowed text-gray-700 ${\n inline ? \"dark:text-gray-600\" : \"dark:text-gray-300\"\n }`,\n inline\n ? !disabled && \"group-hover:text-gray-900 dark:group-hover:text-slate-50\"\n : \"mb-[3px]\",\n className,\n );\n\n if (!children) {\n // no label provided\n return null;\n }\n\n const extraProps = {\n ...htmlLabelProps,\n };\n\n return (\n <label className={classes} {...extraProps}>\n {children}\n {required && (\n <span\n className={cn(\n \"ml-1 text-gray-800 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-slate-50\",\n hasError &&\n `${inline ? \"!text-red-800\" : \"!text-red-900\"} group-hover:!text-red-900`,\n )}\n >\n *\n </span>\n )}\n\n {description && (\n <TooltipProvider>\n <Tooltip content={description}>\n <Icon\n name=\"CircleInfo\"\n size={16}\n className={cn(\n \"ml-1 cursor-pointer text-gray-600 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-500\",\n disabled && \"text-gray-500\",\n )}\n />\n </Tooltip>\n </TooltipProvider>\n )}\n </label>\n );\n};\n"],"mappings":";;;;AAaA,
|
|
1
|
+
{"version":3,"file":"form-label.js","names":["cn","Icon","Tooltip","TooltipProvider","FormLabel","children","required","disabled","description","hasError","inline","className","htmlLabelProps","classes","extraProps"],"sources":["../../../../src/ui/components/form-label/form-label.tsx"],"sourcesContent":["import { cn, Icon } from \"#design-system\";\nimport { Tooltip, TooltipProvider } from \"../tooltip/tooltip.js\";\n\nexport interface FormLabelProps\n extends React.PropsWithChildren, React.LabelHTMLAttributes<HTMLLabelElement> {\n required?: boolean;\n disabled?: boolean;\n description?: string;\n hasError?: boolean;\n inline?: boolean;\n className?: string;\n}\n\nexport const FormLabel: React.FC<FormLabelProps> = ({\n children,\n required,\n disabled,\n description,\n hasError,\n inline,\n className,\n ...htmlLabelProps\n}) => {\n const classes = cn(\n \"inline-flex items-center text-sm font-medium\",\n inline ? \"leading-[22px]\" : \"leading-4\",\n `text-gray-900 ${inline ? \"dark:text-gray-400\" : \"dark:text-gray-50\"}`,\n hasError && \"group-hover:!text-red-900 dark:group-hover:!text-red-900\",\n hasError && inline && \"text-red-800 dark:text-red-800\",\n hasError && !inline && \"text-red-900 dark:text-red-900\",\n disabled &&\n `cursor-not-allowed text-gray-700 ${\n inline ? \"dark:text-gray-600\" : \"dark:text-gray-300\"\n }`,\n inline\n ? !disabled && \"group-hover:text-gray-900 dark:group-hover:text-slate-50\"\n : \"mb-[3px]\",\n className,\n );\n\n if (!children) {\n // no label provided\n return null;\n }\n\n const extraProps = {\n ...htmlLabelProps,\n };\n\n return (\n <label className={classes} {...extraProps}>\n {children}\n {required && (\n <span\n className={cn(\n \"ml-1 text-gray-800 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-slate-50\",\n hasError &&\n `${inline ? \"!text-red-800\" : \"!text-red-900\"} group-hover:!text-red-900`,\n )}\n >\n *\n </span>\n )}\n\n {description && (\n <TooltipProvider>\n <Tooltip content={description}>\n <Icon\n name=\"CircleInfo\"\n size={16}\n className={cn(\n \"ml-1 cursor-pointer text-gray-600 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-500\",\n disabled && \"text-gray-500\",\n )}\n />\n </Tooltip>\n </TooltipProvider>\n )}\n </label>\n );\n};\n"],"mappings":";;;;AAaA,MAAaI,aAAuC,EAClDC,UACAC,UACAC,UACAC,aACAC,UACAC,QACAC,WACA,GAAGC,qBACC;CACJ,MAAMC,UAAUb,GACd,gDACAU,SAAS,mBAAmB,aAC5B,iBAAiBA,SAAS,uBAAuB,uBACjDD,YAAY,4DACZA,YAAYC,UAAU,kCACtBD,YAAY,CAACC,UAAU,kCACvBH,YACE,oCACEG,SAAS,uBAAuB,wBAEpCA,SACI,CAACH,YAAY,6DACb,YACJI,UACD;AAED,KAAI,CAACN,SAEH,QAAO;AAOT,QACE,qBAAC,SAAD;EAAO,WAAWQ;EAJlB,GAAGD;YAIH;GACGP;GACAC,YACC,oBAAC,QAAD;IACE,WAAWN,GACT,kGACAS,YACE,GAAGC,SAAS,kBAAkB,gBAAe,4BAChD;cAAC;IAIL,CAAA;GAEAF,eACC,oBAAC,UAAD,EAAA,UACE,oBAAC,SAAD;IAAS,SAASA;cAChB,oBAAC,MAAD;KACE,MAAK;KACL,MAAM;KACN,WAAWR,GACT,qGACAO,YAAY,gBACb;KAAC,CAAA;IAEG,CAAA,EAEZ,CAAA;GACK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FormMessageProps, r as FormMessageType, t as FormMessage } from "../../../form-message-
|
|
1
|
+
import { n as FormMessageProps, r as FormMessageType, t as FormMessage } from "../../../form-message-Dq72nBXz.js";
|
|
2
2
|
export { FormMessage, FormMessageProps, FormMessageType };
|