@g4rcez/components 5.0.2 → 5.0.3
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/AnimatePresence-j36AYeOQ.js +181 -0
- package/dist/AnimatePresence-j36AYeOQ.js.map +1 -0
- package/dist/Calendar.es-xICmgvjq.js +23 -0
- package/dist/Calendar.es-xICmgvjq.js.map +1 -0
- package/dist/Funnel.es-DjKVl8Nj.js +23 -0
- package/dist/Funnel.es-DjKVl8Nj.js.map +1 -0
- package/dist/{MotionConfig-DKKYqBH2.js → MotionConfig-CXHoPGbK.js} +2 -2
- package/dist/{MotionConfig-DKKYqBH2.js.map → MotionConfig-CXHoPGbK.js.map} +1 -1
- package/dist/Plus.es-DbyRkEE2.js +23 -0
- package/dist/Plus.es-DbyRkEE2.js.map +1 -0
- package/dist/Trash.es-BFAc8PMf.js +23 -0
- package/dist/Trash.es-BFAc8PMf.js.map +1 -0
- package/dist/{calendar-PCCZDUIL.js → calendar-DEPkz8sw.js} +364 -502
- package/dist/calendar-DEPkz8sw.js.map +1 -0
- package/dist/calendar-header-Dfr-CwkY.js +174 -0
- package/dist/calendar-header-Dfr-CwkY.js.map +1 -0
- package/dist/chunk-jwUa06l-.js +23 -0
- package/dist/components/core/button.js +1 -1
- package/dist/components/core/heading.js +11 -0
- package/dist/components/core/heading.js.map +1 -0
- package/dist/{polymorph-BLXhrn9n.js → components/core/polymorph.js} +2 -2
- package/dist/components/core/polymorph.js.map +1 -0
- package/dist/components/core/render-on-view.js +29 -0
- package/dist/components/core/render-on-view.js.map +1 -0
- package/dist/components/core/resizable.d.ts +7 -1
- package/dist/components/core/resizable.d.ts.map +1 -1
- package/dist/components/core/resizable.js +60 -0
- package/dist/components/core/resizable.js.map +1 -0
- package/dist/components/core/resizable.jsx +46 -40
- package/dist/{slot-pC8kH9De.js → components/core/slot.js} +2 -2
- package/dist/components/core/slot.js.map +1 -0
- package/dist/components/core/tag.js +1 -1
- package/dist/components/core/typography.js +40 -0
- package/dist/components/core/typography.js.map +1 -0
- package/dist/components/display/alert.d.ts.map +1 -1
- package/dist/components/display/alert.js +83 -102
- package/dist/components/display/alert.js.map +1 -1
- package/dist/components/display/alert.jsx +26 -29
- package/dist/components/display/calendar.d.ts.map +1 -1
- package/dist/components/display/calendar.js +1 -1
- package/dist/components/display/calendar.jsx +15 -10
- package/dist/components/display/card.js +2 -2
- package/dist/components/display/empty.d.ts.map +1 -1
- package/dist/components/display/empty.js +25 -0
- package/dist/components/display/empty.js.map +1 -0
- package/dist/components/display/empty.jsx +3 -1
- package/dist/components/display/list.d.ts.map +1 -1
- package/dist/components/display/list.js +132 -122
- package/dist/components/display/list.js.map +1 -1
- package/dist/components/display/list.jsx +30 -25
- package/dist/components/display/notifications.d.ts.map +1 -1
- package/dist/components/display/notifications.js +1 -1
- package/dist/components/display/notifications.jsx +8 -6
- package/dist/components/display/progress.d.ts.map +1 -1
- package/dist/components/display/progress.js +3 -0
- package/dist/components/display/progress.jsx +6 -8
- package/dist/components/display/shortcut.js +2 -0
- package/dist/components/display/skeleton.js +41 -0
- package/dist/components/display/skeleton.js.map +1 -0
- package/dist/components/display/spinner.js +17 -0
- package/dist/components/display/spinner.js.map +1 -0
- package/dist/components/display/step.d.ts.map +1 -1
- package/dist/components/display/step.js +3 -0
- package/dist/components/display/step.jsx +5 -5
- package/dist/components/display/tabs.js +1 -1
- package/dist/components/display/timeline.js +1 -1
- package/dist/components/floating/command-palette.d.ts.map +1 -1
- package/dist/components/floating/command-palette.js +255 -0
- package/dist/components/floating/command-palette.js.map +1 -0
- package/dist/components/floating/command-palette.jsx +34 -25
- package/dist/components/floating/dropdown.js +1 -1
- package/dist/components/floating/dropdown.js.map +1 -1
- package/dist/components/floating/dropdown.jsx +1 -1
- package/dist/components/floating/expand.js +15 -14
- package/dist/components/floating/expand.js.map +1 -1
- package/dist/components/floating/menu.js +1 -1
- package/dist/components/floating/modal.d.ts +14 -11
- package/dist/components/floating/modal.d.ts.map +1 -1
- package/dist/components/floating/modal.js +1 -1
- package/dist/components/floating/modal.jsx +56 -17
- package/dist/components/floating/toolbar.d.ts +3 -3
- package/dist/components/floating/toolbar.d.ts.map +1 -1
- package/dist/components/floating/toolbar.js +20 -0
- package/dist/components/floating/toolbar.js.map +1 -0
- package/dist/components/floating/toolbar.jsx +7 -3
- package/dist/components/floating/tooltip.js +2 -2
- package/dist/components/floating/tooltip.js.map +1 -1
- package/dist/components/floating/tooltip.jsx +1 -1
- package/dist/components/floating/wizard.js +3 -0
- package/dist/components/form/autocomplete.d.ts.map +1 -1
- package/dist/components/form/autocomplete.js +344 -2
- package/dist/components/form/autocomplete.js.map +1 -0
- package/dist/components/form/autocomplete.jsx +27 -18
- package/dist/components/form/checkbox.d.ts.map +1 -1
- package/dist/components/form/checkbox.js +29 -27
- package/dist/components/form/checkbox.js.map +1 -1
- package/dist/components/form/checkbox.jsx +21 -6
- package/dist/components/form/date-picker.js +1 -1
- package/dist/components/form/date-picker.jsx +1 -1
- package/dist/components/form/file-upload.d.ts +6 -1
- package/dist/components/form/file-upload.d.ts.map +1 -1
- package/dist/components/form/file-upload.js +1 -1
- package/dist/components/form/file-upload.jsx +34 -12
- package/dist/components/form/formReset.js +10 -0
- package/dist/components/form/formReset.js.map +1 -0
- package/dist/components/form/free-text.js +70 -0
- package/dist/components/form/free-text.js.map +1 -0
- package/dist/components/form/free-text.jsx +1 -1
- package/dist/components/form/input-field.d.ts.map +1 -1
- package/dist/components/form/input-field.js +3 -0
- package/dist/components/form/input-field.jsx +14 -8
- package/dist/components/form/input.js +1 -1
- package/dist/components/form/multi-select.d.ts.map +1 -1
- package/dist/components/form/multi-select.js +420 -0
- package/dist/components/form/multi-select.js.map +1 -0
- package/dist/components/form/multi-select.jsx +41 -33
- package/dist/components/form/select.d.ts.map +1 -1
- package/dist/components/form/select.js +55 -51
- package/dist/components/form/select.js.map +1 -1
- package/dist/components/form/select.jsx +8 -5
- package/dist/components/form/slider.js +3 -0
- package/dist/components/form/switch.d.ts +2 -1
- package/dist/components/form/switch.d.ts.map +1 -1
- package/dist/components/form/switch.js +32 -26
- package/dist/components/form/switch.js.map +1 -1
- package/dist/components/form/switch.jsx +26 -13
- package/dist/components/form/textarea.js +19 -0
- package/dist/components/form/textarea.js.map +1 -0
- package/dist/components/page-calendar/calendar-header.d.ts.map +1 -1
- package/dist/components/page-calendar/calendar-header.js +2 -0
- package/dist/components/page-calendar/calendar-header.jsx +6 -4
- package/dist/components/page-calendar/day-view.js +124 -0
- package/dist/components/page-calendar/day-view.js.map +1 -0
- package/dist/components/page-calendar/event-pill.js +44 -0
- package/dist/components/page-calendar/event-pill.js.map +1 -0
- package/dist/components/page-calendar/month-view.d.ts.map +1 -1
- package/dist/components/page-calendar/month-view.js +109 -0
- package/dist/components/page-calendar/month-view.js.map +1 -0
- package/dist/components/page-calendar/month-view.jsx +78 -31
- package/dist/components/page-calendar/page-calendar.d.ts.map +1 -1
- package/dist/components/page-calendar/page-calendar.js +75 -0
- package/dist/components/page-calendar/page-calendar.js.map +1 -0
- package/dist/components/page-calendar/page-calendar.jsx +2 -2
- package/dist/components/page-calendar/week-view.js +88 -0
- package/dist/components/page-calendar/week-view.js.map +1 -0
- package/dist/components/table/filter.d.ts.map +1 -1
- package/dist/components/table/filter.js +239 -0
- package/dist/components/table/filter.js.map +1 -0
- package/dist/components/table/filter.jsx +9 -4
- package/dist/components/table/group.d.ts.map +1 -1
- package/dist/components/table/group.js +3 -0
- package/dist/components/table/group.jsx +5 -3
- package/dist/components/table/index.js +102 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/inner-table.js +2 -0
- package/dist/components/table/inner-table.jsx +1 -1
- package/dist/components/table/metadata.js +73 -0
- package/dist/components/table/metadata.js.map +1 -0
- package/dist/components/table/metadata.jsx +1 -1
- package/dist/components/table/pagination.js +70 -0
- package/dist/components/table/pagination.js.map +1 -0
- package/dist/components/table/row.js +58 -0
- package/dist/components/table/row.js.map +1 -0
- package/dist/components/table/sort.d.ts.map +1 -1
- package/dist/components/table/sort.js +3 -0
- package/dist/components/table/sort.jsx +3 -1
- package/dist/components/table/thead.js +3 -0
- package/dist/config/default-translations.d.ts +18 -0
- package/dist/config/default-translations.d.ts.map +1 -1
- package/dist/config/default-translations.jsx +18 -0
- package/dist/{use-translations-DTLfPE3_.js → context-CsnUsfeP.js} +55 -40
- package/dist/context-CsnUsfeP.js.map +1 -0
- package/dist/{date-picker-BhKEFZew.js → date-picker-DNzupG8R.js} +301 -317
- package/dist/date-picker-DNzupG8R.js.map +1 -0
- package/dist/dict-CisoYSMO.js +28 -0
- package/dist/dict-CisoYSMO.js.map +1 -0
- package/dist/dist-ChfJ5LO9.js +498 -0
- package/dist/dist-ChfJ5LO9.js.map +1 -0
- package/dist/{dist-BrGpYRaj.js → dist-DIjUECx9.js} +56 -56
- package/dist/{dist-BrGpYRaj.js.map → dist-DIjUECx9.js.map} +1 -1
- package/dist/dom-Bn4wY_Zx.js.map +1 -1
- package/dist/{file-upload-DWbZfeG5.js → file-upload-C2zNnv9n.js} +501 -481
- package/dist/{file-upload-DWbZfeG5.js.map → file-upload-C2zNnv9n.js.map} +1 -1
- package/dist/fzf-CPGDDCoU.js +64 -0
- package/dist/fzf-CPGDDCoU.js.map +1 -0
- package/dist/getISOWeek-EcB4Ebqp.js +72 -0
- package/dist/getISOWeek-EcB4Ebqp.js.map +1 -0
- package/dist/group-Dl14TJXO.js +222 -0
- package/dist/group-Dl14TJXO.js.map +1 -0
- package/dist/hooks/use-translations.d.ts +18 -0
- package/dist/hooks/use-translations.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inner-table-CeDX60cL.js +151 -0
- package/dist/inner-table-CeDX60cL.js.map +1 -0
- package/dist/input-Cmyuea4Y.js +412 -0
- package/dist/input-Cmyuea4Y.js.map +1 -0
- package/dist/{input-field-B_whI66Q.js → input-field-ffx1MbHo.js} +29 -16
- package/dist/input-field-ffx1MbHo.js.map +1 -0
- package/dist/isSameMonth-C3lsSwcg.js +10 -0
- package/dist/isSameMonth-C3lsSwcg.js.map +1 -0
- package/dist/isToday-COXfxFui.js +32 -0
- package/dist/isToday-COXfxFui.js.map +1 -0
- package/dist/lib/dom.d.ts.map +1 -1
- package/dist/modal-Df8-6i-o.js +408 -0
- package/dist/modal-Df8-6i-o.js.map +1 -0
- package/dist/notifications-NhCESJUV.js +1697 -0
- package/dist/notifications-NhCESJUV.js.map +1 -0
- package/dist/page-calendar.utils-Bd0PHktL.js +102 -0
- package/dist/page-calendar.utils-Bd0PHktL.js.map +1 -0
- package/dist/preset/preset.tailwind.d.ts.map +1 -1
- package/dist/preset/preset.tailwind.js +6 -7
- package/dist/preset/src/styles/dark.js +1 -1
- package/dist/progress-8LO5gWLp.js +104 -0
- package/dist/progress-8LO5gWLp.js.map +1 -0
- package/dist/{proxy-BcJ_5Dwq.js → proxy-fP2NxmhM.js} +658 -844
- package/dist/proxy-fP2NxmhM.js.map +1 -0
- package/dist/shim-Czv-YhKR.js +93 -0
- package/dist/shim-Czv-YhKR.js.map +1 -0
- package/dist/shortcut-CQCmgmlU.js +100 -0
- package/dist/shortcut-CQCmgmlU.js.map +1 -0
- package/dist/slider-TX9hiHO-.js +1196 -0
- package/dist/slider-TX9hiHO-.js.map +1 -0
- package/dist/sort-DGmiselV.js +195 -0
- package/dist/sort-DGmiselV.js.map +1 -0
- package/dist/step-DFpJ7zCG.js +185 -0
- package/dist/step-DFpJ7zCG.js.map +1 -0
- package/dist/styles/dark.js +1 -1
- package/dist/subMonths-QcCnE3Yh.js +43 -0
- package/dist/subMonths-QcCnE3Yh.js.map +1 -0
- package/dist/table-lib-1bkYSklk.js +174 -0
- package/dist/table-lib-1bkYSklk.js.map +1 -0
- package/dist/{tabs-Ciy0l9OF.js → tabs-Brc963EW.js} +2 -2
- package/dist/{tabs-Ciy0l9OF.js.map → tabs-Brc963EW.js.map} +1 -1
- package/dist/thead-B6WELJZ-.js +211 -0
- package/dist/thead-B6WELJZ-.js.map +1 -0
- package/dist/use-locale-DPM_sg4s.js +12 -0
- package/dist/use-locale-DPM_sg4s.js.map +1 -0
- package/dist/use-remove-scroll-pAgC09Sq.js +38 -0
- package/dist/use-remove-scroll-pAgC09Sq.js.map +1 -0
- package/dist/use-translations-BE4PuhLm.js +11 -0
- package/dist/use-translations-BE4PuhLm.js.map +1 -0
- package/dist/useAnimationFrame-DnKbaXfi.js +223 -0
- package/dist/useAnimationFrame-DnKbaXfi.js.map +1 -0
- package/dist/valueToPercent-DZc_m1tm.js +43 -0
- package/dist/valueToPercent-DZc_m1tm.js.map +1 -0
- package/dist/visuallyHidden-B7wI86yi.js +303 -0
- package/dist/visuallyHidden-B7wI86yi.js.map +1 -0
- package/dist/with-selector-BFW5n-pb.js +102 -0
- package/dist/with-selector-BFW5n-pb.js.map +1 -0
- package/dist/wizard-7u_qZ-78.js +218 -0
- package/dist/wizard-7u_qZ-78.js.map +1 -0
- package/package.json +19 -11
- package/dist/autocomplete-D3VOTihi.js +0 -415
- package/dist/autocomplete-D3VOTihi.js.map +0 -1
- package/dist/calendar-PCCZDUIL.js.map +0 -1
- package/dist/components/table/table.js +0 -3
- package/dist/date-picker-BhKEFZew.js.map +0 -1
- package/dist/input-B7jqwPG4.js +0 -473
- package/dist/input-B7jqwPG4.js.map +0 -1
- package/dist/input-field-B_whI66Q.js.map +0 -1
- package/dist/modal-Bz-61ays.js +0 -373
- package/dist/modal-Bz-61ays.js.map +0 -1
- package/dist/notifications-MT4XkLov.js +0 -2203
- package/dist/notifications-MT4XkLov.js.map +0 -1
- package/dist/polymorph-BLXhrn9n.js.map +0 -1
- package/dist/proxy-BcJ_5Dwq.js.map +0 -1
- package/dist/skeleton-CBYEq3lM.js +0 -26
- package/dist/skeleton-CBYEq3lM.js.map +0 -1
- package/dist/slot-pC8kH9De.js.map +0 -1
- package/dist/table-CUFbAI2k.js +0 -1914
- package/dist/table-CUFbAI2k.js.map +0 -1
- package/dist/use-translations-DTLfPE3_.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../src/components/form/checkbox.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { css } from \"../../lib/dom\";\nimport { Override } from \"../../types\";\n\nexport type CheckboxProps = Override<\n React.PropsWithChildren<React.ComponentProps<\"input\">>,\n {\n error?: string;\n asTask?: boolean;\n loading?: boolean;\n container?: string;\n labelClassName?: string;\n size?: \"medium\" | \"large\";\n }\n>;\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n ({ children, asTask = false, labelClassName, loading, error, className = \"\", size: _size, container, ...props }: CheckboxProps, ref) => {\n const d = props.disabled || loading;\n return (\n <label\n
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../src/components/form/checkbox.tsx"],"sourcesContent":["import React, { forwardRef, useId } from \"react\";\nimport { css } from \"../../lib/dom\";\nimport { Override } from \"../../types\";\n\nexport type CheckboxProps = Override<\n React.PropsWithChildren<React.ComponentProps<\"input\">>,\n {\n error?: string;\n asTask?: boolean;\n loading?: boolean;\n container?: string;\n labelClassName?: string;\n size?: \"medium\" | \"large\";\n }\n>;\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n ({ children, asTask = false, labelClassName, loading, error, className = \"\", size: _size, container, ...props }: CheckboxProps, ref) => {\n const d = props.disabled || loading;\n const generatedId = useId();\n const id = props.id ?? props.name ?? generatedId;\n const errorId = error ? `${id}-error` : undefined;\n const describedBy = [props[\"aria-describedby\"], errorId].filter(Boolean).join(\" \") || undefined;\n const ariaInvalid = error ? true : props[\"aria-invalid\"];\n return (\n <>\n <label\n aria-disabled={d}\n data-disabled={d}\n data-task={asTask}\n data-component=\"checkbox\"\n className={css(\n \"group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed\",\n asTask ? \"group-checkbox-checked:line-through\" : \"\",\n container\n )}\n >\n <input\n {...props}\n ref={ref}\n disabled={d}\n type=\"checkbox\"\n data-task={asTask}\n aria-invalid={ariaInvalid}\n aria-describedby={describedBy}\n onKeyDown={(event) => {\n props.onKeyDown?.(event);\n\n if (event.defaultPrevented) return;\n if (event.key === \" \" || event.key === \"Space\" || event.code === \"Space\" || event.key === \"Enter\") {\n event.preventDefault();\n event.currentTarget.click();\n }\n }}\n className={css(\n \"form-checkbox mr-checkbox-gap inline-block size-checkbox-size appearance-none rounded-checkbox-radius border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed\",\n className\n )}\n />\n {children}\n </label>\n <span\n id={errorId}\n data-name=\"checkbox-label\"\n className={css(\"min-w-full flex-1 text-checkbox-hint-text text-danger empty:mt-0 empty:hidden\", labelClassName)}\n >\n {error}\n </span>\n </>\n );\n }\n);\n"],"mappings":";;;;AAgBA,IAAa,IAAW,GACnB,EAAE,aAAU,YAAS,IAAO,mBAAgB,YAAS,UAAO,eAAY,IAAI,MAAM,GAAO,cAAW,GAAG,KAAwB,MAAQ;CACpI,IAAM,IAAI,EAAM,YAAY,GACtB,IAAc,EAAM,GACpB,IAAK,EAAM,MAAM,EAAM,QAAQ,GAC/B,IAAU,IAAQ,GAAG,EAAG,UAAU,KAAA,GAClC,IAAc,CAAC,EAAM,qBAAqB,CAAO,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,KAAK,KAAA,GAChF,IAAc,IAAQ,KAAO,EAAM;CACzC,OACI,kBAAA,GAAA,EAAA,UAAA,CACI,kBAAC,SAAD;EACI,iBAAe;EACf,iBAAe;EACf,aAAW;EACX,kBAAe;EACf,WAAW,EACP,+FACA,IAAS,wCAAwC,IACjD,CACJ;YATJ,CAWI,kBAAC,SAAD;GACI,GAAI;GACC;GACL,UAAU;GACV,MAAK;GACL,aAAW;GACX,gBAAc;GACd,oBAAkB;GAClB,YAAY,MAAU;IAClB,EAAM,YAAY,CAAK,GAEnB,GAAM,qBACN,EAAM,QAAQ,OAAO,EAAM,QAAQ,WAAW,EAAM,SAAS,WAAW,EAAM,QAAQ,aACtF,EAAM,eAAe,GACrB,EAAM,cAAc,MAAM;GAElC;GACA,WAAW,EACP,wOACA,CACJ;EACH,CAAA,GACA,CACE;KACP,kBAAC,QAAD;EACI,IAAI;EACJ,aAAU;EACV,WAAW,EAAI,iFAAiF,CAAc;YAE7G;CACC,CAAA,CACR,EAAA,CAAA;AAEV,CACJ"}
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
1
|
+
import React, { forwardRef, useId } from "react";
|
|
2
2
|
import { css } from "../../lib/dom";
|
|
3
3
|
export const Checkbox = forwardRef(({ children, asTask = false, labelClassName, loading, error, className = "", size: _size, container, ...props }, ref) => {
|
|
4
4
|
const d = props.disabled || loading;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const generatedId = useId();
|
|
6
|
+
const id = props.id ?? props.name ?? generatedId;
|
|
7
|
+
const errorId = error ? `${id}-error` : undefined;
|
|
8
|
+
const describedBy = [props["aria-describedby"], errorId].filter(Boolean).join(" ") || undefined;
|
|
9
|
+
const ariaInvalid = error ? true : props["aria-invalid"];
|
|
10
|
+
return (<>
|
|
11
|
+
<label aria-disabled={d} data-disabled={d} data-task={asTask} data-component="checkbox" className={css("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed", asTask ? "group-checkbox-checked:line-through" : "", container)}>
|
|
12
|
+
<input {...props} ref={ref} disabled={d} type="checkbox" data-task={asTask} aria-invalid={ariaInvalid} aria-describedby={describedBy} onKeyDown={(event) => {
|
|
13
|
+
props.onKeyDown?.(event);
|
|
14
|
+
if (event.defaultPrevented)
|
|
15
|
+
return;
|
|
16
|
+
if (event.key === " " || event.key === "Space" || event.code === "Space" || event.key === "Enter") {
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
event.currentTarget.click();
|
|
19
|
+
}
|
|
20
|
+
}} className={css("form-checkbox mr-checkbox-gap inline-block size-checkbox-size appearance-none rounded-checkbox-radius border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed", className)}/>
|
|
21
|
+
{children}
|
|
22
|
+
</label>
|
|
23
|
+
<span id={errorId} data-name="checkbox-label" className={css("min-w-full flex-1 text-checkbox-hint-text text-danger empty:mt-0 empty:hidden", labelClassName)}>
|
|
9
24
|
{error}
|
|
10
25
|
</span>
|
|
11
|
-
|
|
26
|
+
</>);
|
|
12
27
|
});
|
|
@@ -106,7 +106,7 @@ export const DatePicker = forwardRef(({ date, locale: inputLocal, disabledDate,
|
|
|
106
106
|
<span id={labelId} className="sr-only">
|
|
107
107
|
{translation.datePickerCalendarButtonLabel}
|
|
108
108
|
</span>
|
|
109
|
-
<CalendarIcon />
|
|
109
|
+
<CalendarIcon size={16}/>
|
|
110
110
|
</span>}>
|
|
111
111
|
{CalendarComponent}
|
|
112
112
|
</Dropdown>
|
|
@@ -3,13 +3,18 @@ import { DropzoneProps } from "react-dropzone";
|
|
|
3
3
|
import { Override } from "sidekicker";
|
|
4
4
|
type Props = Override<React.ComponentProps<"input">, DropzoneProps> & {
|
|
5
5
|
files?: File[];
|
|
6
|
-
idle?: React.ReactElement
|
|
6
|
+
idle?: React.ReactElement<IdleProps>;
|
|
7
7
|
File?: React.FC<{
|
|
8
8
|
file: File;
|
|
9
9
|
}>;
|
|
10
10
|
onDrop?: (file: File[]) => void;
|
|
11
11
|
onDeleteFile?: (file: File) => void;
|
|
12
12
|
};
|
|
13
|
+
type IdleProps = {
|
|
14
|
+
dragging: boolean;
|
|
15
|
+
files?: File[];
|
|
16
|
+
onUpload?: () => void;
|
|
17
|
+
};
|
|
13
18
|
export declare const FileUpload: ({ idle, onDeleteFile, File, onDrop, ...props }: Props) => React.JSX.Element;
|
|
14
19
|
export {};
|
|
15
20
|
//# sourceMappingURL=file-upload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../src/components/form/file-upload.tsx"],"names":[],"mappings":"AAcA,OAAO,
|
|
1
|
+
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../src/components/form/file-upload.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAiF,MAAM,OAAO,CAAC;AACtG,OAAO,EAAmB,aAAa,EAAe,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAatC,KAAK,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG;IAClE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACvC,CAAC;AAgGF,KAAK,SAAS,GAAG;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAiFF,eAAO,MAAM,UAAU,GAAI,gDAA8D,KAAK,sBAwC7F,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { WaveformIcon, FileIcon, FileCodeIcon, FileTextIcon, FileVideoIcon, FolderIcon, FolderOpenIcon, TableIcon, XIcon, } from "@phosphor-icons/react";
|
|
3
3
|
import prettyBytes from "pretty-bytes";
|
|
4
|
-
import React, { createContext, Fragment, useContext, useEffect, useState } from "react";
|
|
4
|
+
import React, { cloneElement, createContext, Fragment, useContext, useEffect, useState } from "react";
|
|
5
5
|
import { useDropzone } from "react-dropzone";
|
|
6
6
|
import { useTranslations } from "../../hooks/use-translations";
|
|
7
7
|
import { Modal } from "../floating/modal";
|
|
@@ -28,6 +28,7 @@ const extensionMap = {
|
|
|
28
28
|
mp3: WaveformIcon,
|
|
29
29
|
};
|
|
30
30
|
const ItemViewer = (props) => {
|
|
31
|
+
const translations = useTranslations();
|
|
31
32
|
const [, setManager] = useFileManager();
|
|
32
33
|
const [info, setInfo] = useState({ url: "", type: "", size: "" });
|
|
33
34
|
useEffect(() => {
|
|
@@ -52,7 +53,7 @@ const ItemViewer = (props) => {
|
|
|
52
53
|
return (<li className="flex w-full flex-row justify-between gap-file-upload-gap border-b border-card-border last:border-b-transparent">
|
|
53
54
|
<div className="flex flex-col gap-file-upload-gap">
|
|
54
55
|
<div className="flex flex-row items-center gap-file-upload-gap">
|
|
55
|
-
<button type="button" onClick={onViewFile} aria-label={
|
|
56
|
+
<button type="button" onClick={onViewFile} aria-label={translations.fileUploadViewFile(fileName)} className="m-2 flex size-file-upload-thumb-size items-center justify-center overflow-hidden">
|
|
56
57
|
{Element}
|
|
57
58
|
</button>
|
|
58
59
|
<div className="flex flex-col items-start justify-start text-left">
|
|
@@ -65,7 +66,7 @@ const ItemViewer = (props) => {
|
|
|
65
66
|
</div>) : null}
|
|
66
67
|
</div>
|
|
67
68
|
<div className="align-start flex justify-start py-file-upload-delete-py transition-colors duration-300 ease-linear hover:text-danger-hover">
|
|
68
|
-
<button onClick={onDeleteFile} type="button" aria-label={
|
|
69
|
+
<button onClick={onDeleteFile} type="button" aria-label={translations.fileUploadRemoveFile(fileName)} className="flex size-6 items-center justify-center">
|
|
69
70
|
<XIcon size={16} aria-hidden="true"/>
|
|
70
71
|
</button>
|
|
71
72
|
</div>
|
|
@@ -79,13 +80,25 @@ const FilesList = (props) => (<ul className="w-full space-y-8">
|
|
|
79
80
|
const Idle = (props) => {
|
|
80
81
|
const t = useTranslations();
|
|
81
82
|
const Icon = props.dragging ? FolderOpenIcon : FolderIcon;
|
|
83
|
+
const onUpload = (event) => {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
event.stopPropagation();
|
|
86
|
+
props.onUpload?.();
|
|
87
|
+
};
|
|
88
|
+
const onUploadKeyDown = (event) => {
|
|
89
|
+
if (event.key !== "Enter" && event.key !== " ")
|
|
90
|
+
return;
|
|
91
|
+
onUpload(event);
|
|
92
|
+
};
|
|
82
93
|
return (<div className="flex flex-col items-center justify-center">
|
|
83
94
|
<div className="flex flex-col items-center justify-center gap-file-upload-inner-gap">
|
|
84
|
-
<
|
|
95
|
+
<span className="text-primary">
|
|
96
|
+
<Icon size={80} aria-hidden="true"/>
|
|
97
|
+
</span>
|
|
85
98
|
</div>
|
|
86
99
|
<div className="my-file-upload-thumb-my flex flex-col items-center gap-file-upload-thumb-gap">
|
|
87
100
|
<p>{t.uploadIdle}</p>
|
|
88
|
-
<button className="text-primary underline" type="button">
|
|
101
|
+
<button className="text-primary underline" type="button" aria-label={t.fileUploadUploadButtonLabel(t.uploadIdleButton)} onClick={onUpload} onKeyDown={onUploadKeyDown}>
|
|
89
102
|
{t.uploadIdleButton}
|
|
90
103
|
</button>
|
|
91
104
|
</div>
|
|
@@ -93,11 +106,11 @@ const Idle = (props) => {
|
|
|
93
106
|
};
|
|
94
107
|
const InteractiveArea = (props) => {
|
|
95
108
|
if (props.isDragActive)
|
|
96
|
-
return <Idle files={props.files} dragging/>;
|
|
109
|
+
return <Idle files={props.files} dragging onUpload={props.onUpload}/>;
|
|
97
110
|
if (props.files.length > 0) {
|
|
98
111
|
return <FilesList File={props.File} onDeleteFile={props.onDeleteFile} files={props.files}/>;
|
|
99
112
|
}
|
|
100
|
-
return <Fragment>{props.idle}</Fragment>;
|
|
113
|
+
return <Fragment>{cloneElement(props.idle, { onUpload: props.onUpload })}</Fragment>;
|
|
101
114
|
};
|
|
102
115
|
const DefaultIdle = <Idle dragging={false}/>;
|
|
103
116
|
const FileViewer = (props) => {
|
|
@@ -123,16 +136,25 @@ export const FileUpload = ({ idle = DefaultIdle, onDeleteFile, File, onDrop, ...
|
|
|
123
136
|
onDrop?.(x);
|
|
124
137
|
setFiles((prev) => prev.concat(x));
|
|
125
138
|
};
|
|
126
|
-
const
|
|
139
|
+
const dropzoneOptions = {
|
|
140
|
+
multiple: props.multiple,
|
|
141
|
+
onDragEnter: props.onDragEnter,
|
|
142
|
+
onDragOver: props.onDragOver,
|
|
143
|
+
onDragLeave: props.onDragLeave,
|
|
127
144
|
onDrop: drop,
|
|
128
|
-
}
|
|
145
|
+
};
|
|
146
|
+
const { getRootProps, getInputProps, isDragActive, open } = useDropzone(dropzoneOptions);
|
|
129
147
|
return (<Context.Provider value={state}>
|
|
130
148
|
<Modal overlayClickClose title={t.uploadDialogTitle} ariaTitle={t.uploadDialogTitle} open={state[0] !== null} onChange={close}>
|
|
131
149
|
{state[0] ? <FileViewer item={state[0]}/> : null}
|
|
132
150
|
</Modal>
|
|
133
|
-
<div {...getRootProps(
|
|
134
|
-
|
|
135
|
-
|
|
151
|
+
<div {...getRootProps({
|
|
152
|
+
"aria-label": t.fileUploadZoneLabel,
|
|
153
|
+
"data-active": items ? items.length > 0 : false,
|
|
154
|
+
className: "flex flex-col items-center justify-center rounded-file-upload-radius border border-card-border p-file-upload-p text-foreground data-[active=true]:border-solid data-[active=false]:border-dashed data-[active=true]:border-transparent data-[active=true]:bg-card-background",
|
|
155
|
+
})}>
|
|
156
|
+
<input {...getInputProps()} aria-label={t.fileUploadZoneLabel} name={props.name} id={props.name}/>
|
|
157
|
+
<InteractiveArea File={File} onDeleteFile={onDeleteFile} isDragActive={isDragActive} idle={idle} files={items} onUpload={open}/>
|
|
136
158
|
</div>
|
|
137
159
|
</Context.Provider>);
|
|
138
160
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/components/form/formReset.tsx
|
|
2
|
+
var e = ["INPUT", "SELECT"], t = (t) => {
|
|
3
|
+
t && Array.from(t.elements).forEach((t) => {
|
|
4
|
+
e.includes(t.tagName) && (t.tagName === "INPUT" && (t.value = t.defaultValue), t.tagName === "SELECT" && (t.value = ""), t.setAttribute("data-initialized", "false"));
|
|
5
|
+
});
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as formReset };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=formReset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formReset.js","names":[],"sources":["../../../src/components/form/formReset.tsx"],"sourcesContent":["const inputFields = [\"INPUT\", \"SELECT\"];\n\nexport const formReset = (form?: HTMLFormElement | null) => {\n if (!form) return;\n const elements = Array.from(form.elements);\n elements.forEach((field) => {\n if (!inputFields.includes(field.tagName)) return;\n if (field.tagName === \"INPUT\") {\n (field as HTMLInputElement).value = (field as HTMLInputElement).defaultValue;\n }\n if (field.tagName === \"SELECT\") {\n (field as HTMLSelectElement).value = \"\";\n }\n field.setAttribute(\"data-initialized\", \"false\");\n });\n};\n"],"mappings":";AAAA,IAAM,IAAc,CAAC,SAAS,QAAQ,GAEzB,KAAa,MAAkC;CACnD,KAEL,MADuB,KAAK,EAAK,QACjC,EAAS,SAAS,MAAU;EACnB,EAAY,SAAS,EAAM,OAAO,MACnC,EAAM,YAAY,YAClB,EAA4B,QAAS,EAA2B,eAEhE,EAAM,YAAY,aAClB,EAA6B,QAAQ,KAEzC,EAAM,aAAa,oBAAoB,OAAO;CAClD,CAAC;AACL"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { o as e, t, u as n } from "../../dom-Bn4wY_Zx.js";
|
|
3
|
+
import { n as r } from "../../input-field-ffx1MbHo.js";
|
|
4
|
+
import { forwardRef as i, useEffect as a, useRef as o } from "react";
|
|
5
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/form/free-text.tsx
|
|
7
|
+
var c = (c, l, u, d) => i(({ info: i, left: f, next: p, error: m, right: h, container: g, rightLabel: _, interactive: v, optionalText: y, type: b = "text", labelClassName: x, feedback: S = null, hideLeft: C = !1, loading: w, hiddenLabel: T, ...E }, D) => {
|
|
8
|
+
let O = c, k = E.id ?? E.name, A = o(null);
|
|
9
|
+
return a(() => {
|
|
10
|
+
if (A.current === null) return;
|
|
11
|
+
let t = A.current, n = e(A.current), r = d?.(t), i = (e) => {
|
|
12
|
+
let n = e;
|
|
13
|
+
if (n.key === "Enter" && t.enterKeyHint === "next") {
|
|
14
|
+
let e = t.getAttribute("data-next");
|
|
15
|
+
if (e) {
|
|
16
|
+
let t = document.getElementById(e);
|
|
17
|
+
if (t) {
|
|
18
|
+
t.focus(), n.preventDefault();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return t.addEventListener("keydown", i), () => {
|
|
25
|
+
r?.(), n(), t.removeEventListener("keydown", i);
|
|
26
|
+
};
|
|
27
|
+
}, []), /* @__PURE__ */ s(r, {
|
|
28
|
+
...u,
|
|
29
|
+
info: i,
|
|
30
|
+
left: f,
|
|
31
|
+
error: m,
|
|
32
|
+
right: h,
|
|
33
|
+
form: E.form,
|
|
34
|
+
loading: w,
|
|
35
|
+
name: E.name,
|
|
36
|
+
feedback: S,
|
|
37
|
+
hideLeft: C,
|
|
38
|
+
title: E.title,
|
|
39
|
+
rightLabel: _,
|
|
40
|
+
disabled: E.disabled,
|
|
41
|
+
hiddenLabel: T,
|
|
42
|
+
interactive: v,
|
|
43
|
+
required: E.required,
|
|
44
|
+
componentName: l,
|
|
45
|
+
id: E.name || E.id,
|
|
46
|
+
optionalText: y,
|
|
47
|
+
labelClassName: x,
|
|
48
|
+
placeholder: E.placeholder,
|
|
49
|
+
container: t(g, u.container),
|
|
50
|
+
children: /* @__PURE__ */ s(O, {
|
|
51
|
+
...u,
|
|
52
|
+
...E,
|
|
53
|
+
id: k,
|
|
54
|
+
name: k,
|
|
55
|
+
type: b,
|
|
56
|
+
"data-next": p,
|
|
57
|
+
"aria-busy": w,
|
|
58
|
+
"aria-invalid": !!m,
|
|
59
|
+
"aria-disabled": E.disabled,
|
|
60
|
+
"aria-readonly": E.readOnly,
|
|
61
|
+
"aria-describedby": m ? `${k}-error` : void 0,
|
|
62
|
+
ref: n(D, A),
|
|
63
|
+
className: t("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-input-radius bg-transparent px-input-padding-x py-input-padding-y text-input-text text-foreground", "outline-none transition-colors", "group-error:text-danger group-error:placeholder-input-mask-error", "resize-y group-focus-within:border-primary group-hover:border-primary", "disabled:cursor-not-allowed disabled:text-disabled", E.className)
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { c as createFreeText };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=free-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"free-text.js","names":[],"sources":["../../../src/components/form/free-text.tsx"],"sourcesContent":["\"use client\";\nimport React, { forwardRef, useEffect, useRef } from \"react\";\nimport MaskInput, { InputTypes } from \"the-mask-input\";\nimport { css, initializeInputDataset, mergeRefs } from \"../../lib/dom\";\nimport { Any, Override, ReactComponent } from \"../../types\";\nimport { FeedbackProps, InputField, InputFieldProps } from \"./input-field\";\n\ntype FreeTextTag = \"input\" | \"textarea\";\n\nexport type FreeTextProps<T extends FreeTextTag, ExtraProps extends Any> = Override<\n InputFieldProps<T> & FeedbackProps & Partial<{ next: string; type: InputTypes }>,\n ExtraProps\n>;\n\nexport const createFreeText = <const T extends FreeTextTag, const Html extends HTMLInputElement | HTMLTextAreaElement, Extra extends Any>(\n Element: \"input\" | \"textarea\" | typeof MaskInput,\n elementName: \"input\" | \"textarea\",\n defaultProps: FreeTextProps<T, Extra>,\n register?: (el: Html) => () => void\n) => {\n const FreeText: ReactComponent<FreeTextProps<T, Extra>> = forwardRef<Html, FreeTextProps<T, Extra>>(\n (\n {\n info,\n left,\n next,\n error,\n right,\n container,\n rightLabel,\n interactive,\n optionalText,\n type = \"text\",\n labelClassName,\n feedback = null,\n hideLeft = false,\n loading,\n hiddenLabel,\n ...props\n },\n ref\n ): React.ReactElement => {\n const Render: React.ElementType = Element;\n const id = props.id ?? props.name;\n const inputRef = useRef<Html>(null);\n\n useEffect(() => {\n if (inputRef.current === null) return;\n const input = inputRef.current;\n const focus = initializeInputDataset(inputRef.current);\n const registered = register?.(input);\n const goNextInputImpl = (e: Event) => {\n const event = e as KeyboardEvent;\n if (event.key === \"Enter\" && input.enterKeyHint === \"next\") {\n const focusNext = input.getAttribute(\"data-next\");\n if (focusNext) {\n const el = document.getElementById(focusNext);\n if (el) {\n el.focus();\n return void event.preventDefault();\n }\n }\n }\n };\n input.addEventListener(\"keydown\", goNextInputImpl);\n return () => {\n registered?.();\n focus();\n input.removeEventListener(\"keydown\", goNextInputImpl);\n };\n }, []);\n\n return (\n <InputField\n {...(defaultProps as unknown as InputFieldProps<T>)}\n info={info}\n left={left}\n error={error}\n right={right}\n form={props.form}\n loading={loading}\n name={props.name}\n feedback={feedback}\n hideLeft={hideLeft}\n title={props.title}\n rightLabel={rightLabel}\n disabled={props.disabled}\n hiddenLabel={hiddenLabel}\n interactive={interactive}\n required={props.required}\n componentName={elementName}\n id={props.name || props.id}\n optionalText={optionalText}\n labelClassName={labelClassName}\n placeholder={props.placeholder}\n container={css(container, defaultProps.container)}\n >\n <Render\n {...defaultProps}\n {...props}\n id={id}\n name={id}\n type={type}\n data-next={next}\n aria-busy={loading}\n aria-invalid={!!error}\n aria-disabled={props.disabled}\n aria-readonly={props.readOnly}\n aria-describedby={error ? `${id}-error` : undefined}\n ref={mergeRefs(ref, inputRef) as unknown as React.Ref<Html>}\n className={css(\n \"input placeholder-input-mask group h-input-height w-full flex-1\",\n \"rounded-input-radius bg-transparent px-input-padding-x py-input-padding-y text-input-text text-foreground\",\n \"outline-none transition-colors\",\n \"group-error:text-danger group-error:placeholder-input-mask-error\",\n \"resize-y group-focus-within:border-primary group-hover:border-primary\",\n \"disabled:cursor-not-allowed disabled:text-disabled\",\n props.className\n )}\n />\n </InputField>\n );\n }\n ) as unknown as ReactComponent<FreeTextProps<T, Extra>>;\n return FreeText;\n};\n"],"mappings":";;;;;;AAcA,IAAa,KACT,GACA,GACA,GACA,MAE0D,GAElD,EACI,SACA,SACA,SACA,UACA,UACA,cACA,eACA,gBACA,iBACA,UAAO,QACP,mBACA,cAAW,MACX,cAAW,IACX,YACA,gBACA,GAAG,KAEP,MACqB;CACrB,IAAM,IAA4B,GAC5B,IAAK,EAAM,MAAM,EAAM,MACvB,IAAW,EAAa,IAAI;CA4BlC,OA1BA,QAAgB;EACZ,IAAI,EAAS,YAAY,MAAM;EAC/B,IAAM,IAAQ,EAAS,SACjB,IAAQ,EAAuB,EAAS,OAAO,GAC/C,IAAa,IAAW,CAAK,GAC7B,KAAmB,MAAa;GAClC,IAAM,IAAQ;GACd,IAAI,EAAM,QAAQ,WAAW,EAAM,iBAAiB,QAAQ;IACxD,IAAM,IAAY,EAAM,aAAa,WAAW;IAChD,IAAI,GAAW;KACX,IAAM,IAAK,SAAS,eAAe,CAAS;KAC5C,IAAI,GAAI;MAEG,AADP,EAAG,MAAM,GACF,EAAW,eAAe;MAAjC;KACJ;IACJ;GACJ;EACJ;EAEA,OADA,EAAM,iBAAiB,WAAW,CAAe,SACpC;GAGT,AAFA,IAAa,GACb,EAAM,GACN,EAAM,oBAAoB,WAAW,CAAe;EACxD;CACJ,GAAG,CAAC,CAAC,GAGD,kBAAC,GAAD;EACI,GAAK;EACC;EACA;EACC;EACA;EACP,MAAM,EAAM;EACH;EACT,MAAM,EAAM;EACF;EACA;EACV,OAAO,EAAM;EACD;EACZ,UAAU,EAAM;EACH;EACA;EACb,UAAU,EAAM;EAChB,eAAe;EACf,IAAI,EAAM,QAAQ,EAAM;EACV;EACE;EAChB,aAAa,EAAM;EACnB,WAAW,EAAI,GAAW,EAAa,SAAS;YAEhD,kBAAC,GAAD;GACI,GAAI;GACJ,GAAI;GACA;GACJ,MAAM;GACA;GACN,aAAW;GACX,aAAW;GACX,gBAAc,CAAC,CAAC;GAChB,iBAAe,EAAM;GACrB,iBAAe,EAAM;GACrB,oBAAkB,IAAQ,GAAG,EAAG,UAAU,KAAA;GAC1C,KAAK,EAAU,GAAK,CAAQ;GAC5B,WAAW,EACP,mEACA,6GACA,kCACA,oEACA,yEACA,sDACA,EAAM,SACV;EACH,CAAA;CACO,CAAA;AAEpB,CAEG"}
|
|
@@ -34,7 +34,7 @@ export const createFreeText = (Element, elementName, defaultProps, register) =>
|
|
|
34
34
|
};
|
|
35
35
|
}, []);
|
|
36
36
|
return (<InputField {...defaultProps} info={info} left={left} error={error} right={right} form={props.form} loading={loading} name={props.name} feedback={feedback} hideLeft={hideLeft} title={props.title} rightLabel={rightLabel} disabled={props.disabled} hiddenLabel={hiddenLabel} interactive={interactive} required={props.required} componentName={elementName} id={props.name || props.id} optionalText={optionalText} labelClassName={labelClassName} placeholder={props.placeholder} container={css(container, defaultProps.container)}>
|
|
37
|
-
<Render {...defaultProps} {...props} id={id} name={id} type={type} data-next={next} aria-busy={loading} aria-invalid={!!error} aria-disabled={props.disabled} aria-readonly={props.readOnly} aria-describedby={error ? `${id}-error` : undefined} ref={mergeRefs(ref, inputRef)} className={css("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-input-radius bg-transparent px-input-padding-x py-input-padding-y text-input-text text-foreground", "outline-none transition-colors
|
|
37
|
+
<Render {...defaultProps} {...props} id={id} name={id} type={type} data-next={next} aria-busy={loading} aria-invalid={!!error} aria-disabled={props.disabled} aria-readonly={props.readOnly} aria-describedby={error ? `${id}-error` : undefined} ref={mergeRefs(ref, inputRef)} className={css("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-input-radius bg-transparent px-input-padding-x py-input-padding-y text-input-text text-foreground", "outline-none transition-colors", "group-error:text-danger group-error:placeholder-input-mask-error", "resize-y group-focus-within:border-primary group-hover:border-primary", "disabled:cursor-not-allowed disabled:text-disabled", props.className)}/>
|
|
38
38
|
</InputField>);
|
|
39
39
|
});
|
|
40
40
|
return FreeText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../src/components/form/input-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAwB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EAAE,KAAK,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,CAC/C,OAAO,CAAC;IACJ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACxB,CAAC,CACL,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,kEAA0E,aAAa,
|
|
1
|
+
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../src/components/form/input-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAwB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EAAE,KAAK,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,CAC/C,OAAO,CAAC;IACJ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACxB,CAAC,CACL,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,kEAA0E,aAAa,sBA6CpH,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,GAAG,UAAU,IAAI,gBAAgB,CACrF,OAAO,CACH,QAAQ,CACJ,aAAa,EACb;IACI,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CAC1B,CACJ,CACJ,EACD,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,GAAG,UAAU,EAAE,KAAK,EAAE,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,YAiHG,CAAC"}
|
|
@@ -7,18 +7,24 @@ import { css } from "../../lib/dom";
|
|
|
7
7
|
import { Tooltip } from "../floating/tooltip";
|
|
8
8
|
export const InputFeedback = ({ reportStatus, id, hideLeft = false, className, info, children, title }) => (<span className={css("w-full justify-between", hideLeft && children === null ? "hidden" : "flex", className)}>
|
|
9
9
|
{hideLeft ? null : (<span className="flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-disabled:text-disabled group-error:text-danger">
|
|
10
|
-
{title}
|
|
10
|
+
<span id={id ? `${id}-label` : undefined}>{title}</span>
|
|
11
11
|
{reportStatus || info ? (<span className="flex items-center justify-center gap-1">
|
|
12
12
|
{info ? (<Tooltip as="button" type="button" aria-label={typeof info === "string" ? info : undefined} aria-describedby={typeof info === "string" ? undefined : id ? `tooltip-info-content-${id}` : undefined} title={<span className="cursor-help">
|
|
13
|
-
<
|
|
13
|
+
<span className="flex aspect-square size-3 items-center justify-center">
|
|
14
|
+
<InfoIcon aria-hidden="true" size={16}/>
|
|
15
|
+
</span>
|
|
14
16
|
</span>}>
|
|
15
17
|
<div id={id ? `tooltip-info-content-${id}` : undefined} className="w-full max-w-48 whitespace-break-spaces break-words">
|
|
16
18
|
{info}
|
|
17
19
|
</div>
|
|
18
20
|
</Tooltip>) : null}
|
|
19
21
|
{reportStatus ? (<span className="flex h-3 min-w-6 items-center">
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
+
<span className="hidden aspect-square size-3 opacity-0 transition-opacity group-assert:block group-assert:text-success group-assert:opacity-100">
|
|
23
|
+
<CheckCircleIcon aria-hidden="true" size={16}/>
|
|
24
|
+
</span>
|
|
25
|
+
<span className="hidden aspect-square size-3 opacity-0 transition-opacity group-error:block group-error:opacity-100">
|
|
26
|
+
<XCircleIcon aria-hidden="true" size={16}/>
|
|
27
|
+
</span>
|
|
22
28
|
</span>) : null}
|
|
23
29
|
</span>) : null}
|
|
24
30
|
</span>)}
|
|
@@ -33,8 +39,8 @@ export const InputField = forwardRef(({ optionalText: _optionalText, left, right
|
|
|
33
39
|
return (<fieldset ref={ref} form={form} disabled={disabled} data-error={!!error} aria-disabled={disabled} data-component={componentName} data-interactive={!!interactive} className={css("group flex min-h-0 min-w-0 max-w-full flex-col items-start", container)}>
|
|
34
40
|
<label form={form} htmlFor={ID} className={css("relative inline-flex w-full max-w-full cursor-text flex-row flex-wrap justify-between gap-input-label-mb text-input-label-text transition-colors empty:hidden group-disabled:cursor-not-allowed group-error:text-danger")}>
|
|
35
41
|
{hiddenLabel ? (<span className="sr-only">
|
|
36
|
-
<InputFeedback info={info} hideLeft={hideLeft} reportStatus={reportStatusDefault} title={title} placeholder={placeholder}/>
|
|
37
|
-
</span>) : (<InputFeedback info={info} title={title} hideLeft={hideLeft} placeholder={placeholder} reportStatus={reportStatusDefault}>
|
|
42
|
+
<InputFeedback id={ID} info={info} hideLeft={hideLeft} reportStatus={reportStatusDefault} title={title} placeholder={placeholder}/>
|
|
43
|
+
</span>) : (<InputFeedback id={ID} info={info} title={title} hideLeft={hideLeft} placeholder={placeholder} reportStatus={reportStatusDefault}>
|
|
38
44
|
{optionalText || rightLabel ? (<Fragment>
|
|
39
45
|
{!required ? (<span aria-disabled={disabled} className="text-opacity-70 transition-colors group-focus-within:text-primary group-hover:text-primary aria-disabled:text-disabled">
|
|
40
46
|
{optionalText}
|
|
@@ -48,10 +54,10 @@ export const InputField = forwardRef(({ optionalText: _optionalText, left, right
|
|
|
48
54
|
{right ? <span className="flex flex-nowrap gap-input-slot-gap whitespace-nowrap pr-input-slot-pr">{right}</span> : null}
|
|
49
55
|
</div>
|
|
50
56
|
</label>
|
|
51
|
-
<p id={`${ID}-error`} role="alert" className="mt-input-hint-mt hidden whitespace-pre-wrap text-wrap text-input-hint-text empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:flex group-error:flex group-error:text-danger">
|
|
57
|
+
<p id={ID ? `${ID}-error` : undefined} role="alert" className="mt-input-hint-mt hidden whitespace-pre-wrap text-wrap text-input-hint-text empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:flex group-error:flex group-error:text-danger">
|
|
52
58
|
{error}
|
|
53
59
|
</p>
|
|
54
|
-
<p className="mt-input-hint-mt text-input-hint-text empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden">
|
|
60
|
+
<p id={ID ? `${ID}-feedback` : undefined} className="mt-input-hint-mt text-input-hint-text empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden">
|
|
55
61
|
{feedback}
|
|
56
62
|
</p>
|
|
57
63
|
</fieldset>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../src/components/form/multi-select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../src/components/form/multi-select.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAoG,MAAM,OAAO,CAAC;AAQzH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAC7C,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CACnC,eAAe,CAAC,OAAO,CAAC,EACxB;IACI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACjD,CACJ,CAAC;AA8DF,eAAO,MAAM,WAAW,wGAsevB,CAAC"}
|