@televet/kibble-ui 4.0.0-beta.42 → 4.0.0-beta.43
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/chunks/{buttonGroup.component-DNfCCrv0.js → buttonGroup.component-BCCxeFx_.js} +2 -2
- package/dist/chunks/{buttonGroup.component-DNfCCrv0.js.map → buttonGroup.component-BCCxeFx_.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-BW2Axhrx.js → buttonGroup.component-Cpwnw5G3.js} +2 -2
- package/dist/chunks/{buttonGroup.component-BW2Axhrx.js.map → buttonGroup.component-Cpwnw5G3.js.map} +1 -1
- package/dist/chunks/{checkbox.component-BTG2oHN_.js → checkbox.component-C8IPf20R.js} +2 -2
- package/dist/chunks/{checkbox.component-BTG2oHN_.js.map → checkbox.component-C8IPf20R.js.map} +1 -1
- package/dist/chunks/{checkbox.component-WA8Y2Cfq.js → checkbox.component-CvuE1PVR.js} +2 -2
- package/dist/chunks/{checkbox.component-WA8Y2Cfq.js.map → checkbox.component-CvuE1PVR.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-DMSg9Hzt.js → checkboxGroup.component-CQEwY2Fu.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-DMSg9Hzt.js.map → checkboxGroup.component-CQEwY2Fu.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-CoUMqdnh.js → checkboxGroup.component-CaHesQT7.js} +3 -3
- package/dist/chunks/{checkboxGroup.component-CoUMqdnh.js.map → checkboxGroup.component-CaHesQT7.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-CgwVfDma.js → conversationCard.component-C_gj2TZd.js} +2 -2
- package/dist/chunks/{conversationCard.component-CgwVfDma.js.map → conversationCard.component-C_gj2TZd.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-ayXnLFsK.js → conversationCard.component-p1vrl1L3.js} +2 -2
- package/dist/chunks/{conversationCard.component-ayXnLFsK.js.map → conversationCard.component-p1vrl1L3.js.map} +1 -1
- package/dist/chunks/{datePicker.component-D4Sge9Xp.js → datePicker.component-CwQ7lbgj.js} +2 -2
- package/dist/chunks/{datePicker.component-D4Sge9Xp.js.map → datePicker.component-CwQ7lbgj.js.map} +1 -1
- package/dist/chunks/{datePicker.component-D5TadaSO.js → datePicker.component-DLbm9VYf.js} +3 -3
- package/dist/chunks/{datePicker.component-D5TadaSO.js.map → datePicker.component-DLbm9VYf.js.map} +1 -1
- package/dist/chunks/{menu.component-CTehgjjv.js → menu.component-D_eoL8VD.js} +2 -2
- package/dist/chunks/{menu.component-CTehgjjv.js.map → menu.component-D_eoL8VD.js.map} +1 -1
- package/dist/chunks/{menu.component-CSpIl19i.js → menu.component-toq-fDY8.js} +3 -3
- package/dist/chunks/{menu.component-CSpIl19i.js.map → menu.component-toq-fDY8.js.map} +1 -1
- package/dist/chunks/{modal.types-0p23sZIR.js → modal.types-BhM9guMA.js} +2 -2
- package/dist/chunks/{modal.types-0p23sZIR.js.map → modal.types-BhM9guMA.js.map} +1 -1
- package/dist/chunks/{modal.types-BGqtuJeQ.js → modal.types-Dz2IFuc7.js} +2 -1
- package/dist/chunks/{modal.types-BGqtuJeQ.js.map → modal.types-Dz2IFuc7.js.map} +1 -1
- package/dist/chunks/{pinInput.types-PLeb9Wy4.js → pinInput.types-BPnWNbwp.js} +2 -2
- package/dist/chunks/{pinInput.types-PLeb9Wy4.js.map → pinInput.types-BPnWNbwp.js.map} +1 -1
- package/dist/chunks/{pinInput.types-DDODRsaX.js → pinInput.types-GAEfMLAv.js} +2 -2
- package/dist/chunks/{pinInput.types-DDODRsaX.js.map → pinInput.types-GAEfMLAv.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-O06WADTy.js → radioGroup.component-B3pl5h2h.js} +2 -2
- package/dist/chunks/{radioGroup.component-O06WADTy.js.map → radioGroup.component-B3pl5h2h.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-Cisdr-Ir.js → radioGroup.component-DyE_o-Fx.js} +3 -3
- package/dist/chunks/{radioGroup.component-Cisdr-Ir.js.map → radioGroup.component-DyE_o-Fx.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-Bgh1iv_C.js → ratingDots.component-BesDpg8x.js} +2 -2
- package/dist/chunks/{ratingDots.component-Bgh1iv_C.js.map → ratingDots.component-BesDpg8x.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-3aUZ-7-n.js → ratingDots.component-C8eBoN9v.js} +2 -2
- package/dist/chunks/{ratingDots.component-3aUZ-7-n.js.map → ratingDots.component-C8eBoN9v.js.map} +1 -1
- package/dist/chunks/{select.component-C-D415HK.js → select.component-BCFraNbc.js} +2 -2
- package/dist/chunks/{select.component-C-D415HK.js.map → select.component-BCFraNbc.js.map} +1 -1
- package/dist/chunks/{select.component-CceQLD7L.js → select.component-GTm2laeB.js} +2 -2
- package/dist/chunks/{select.component-CceQLD7L.js.map → select.component-GTm2laeB.js.map} +1 -1
- package/dist/chunks/{switch.component-8Ksb8br3.js → switch.component-CSGFEF3I.js} +2 -2
- package/dist/chunks/{switch.component-8Ksb8br3.js.map → switch.component-CSGFEF3I.js.map} +1 -1
- package/dist/chunks/{switch.component-BkifDkJ0.js → switch.component-DjHknb_4.js} +2 -2
- package/dist/chunks/{switch.component-BkifDkJ0.js.map → switch.component-DjHknb_4.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-P4wTaTqP.js → tagBlock.component-BWbEe9VL.js} +2 -2
- package/dist/chunks/{tagBlock.component-P4wTaTqP.js.map → tagBlock.component-BWbEe9VL.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-CglDWBFU.js → tagBlock.component-DGGkSE8s.js} +2 -2
- package/dist/chunks/{tagBlock.component-CglDWBFU.js.map → tagBlock.component-DGGkSE8s.js.map} +1 -1
- package/dist/chunks/{textInput.component-c9ySCd-c.js → textInput.component-D2StzwsH.js} +2 -2
- package/dist/chunks/{textInput.component-c9ySCd-c.js.map → textInput.component-D2StzwsH.js.map} +1 -1
- package/dist/chunks/{textInput.component-7QTnQmYu.js → textInput.component-db5JWDOn.js} +2 -2
- package/dist/chunks/{textInput.component-7QTnQmYu.js.map → textInput.component-db5JWDOn.js.map} +1 -1
- package/dist/chunks/{textarea.component-7yXlR6OD.js → textarea.component-DvA5vzjS.js} +2 -2
- package/dist/chunks/{textarea.component-7yXlR6OD.js.map → textarea.component-DvA5vzjS.js.map} +1 -1
- package/dist/chunks/{textarea.component-Bbf7OmgY.js → textarea.component-VN5A4zVD.js} +2 -2
- package/dist/chunks/{textarea.component-Bbf7OmgY.js.map → textarea.component-VN5A4zVD.js.map} +1 -1
- package/dist/chunks/{timePicker.component-CWQsy1FJ.js → timePicker.component-Cm2roPxJ.js} +2 -2
- package/dist/chunks/{timePicker.component-CWQsy1FJ.js.map → timePicker.component-Cm2roPxJ.js.map} +1 -1
- package/dist/chunks/{timePicker.component-DayAeaAE.js → timePicker.component-sttSyiVV.js} +2 -2
- package/dist/chunks/{timePicker.component-DayAeaAE.js.map → timePicker.component-sttSyiVV.js.map} +1 -1
- package/dist/chunks/{timeRange.component-kKGWfXnG.js → timeRange.component-BuLsK6ed.js} +2 -2
- package/dist/chunks/{timeRange.component-kKGWfXnG.js.map → timeRange.component-BuLsK6ed.js.map} +1 -1
- package/dist/chunks/{timeRange.component-BMIZhDDZ.js → timeRange.component-OH7hVSwj.js} +2 -2
- package/dist/chunks/{timeRange.component-BMIZhDDZ.js.map → timeRange.component-OH7hVSwj.js.map} +1 -1
- package/dist/chunks/{withFormControl-BldbKXiV.js → withFormControl-Chelruxy.js} +55 -55
- package/dist/chunks/{withFormControl-BldbKXiV.js.map → withFormControl-Chelruxy.js.map} +1 -1
- package/dist/chunks/{withFormControl-C35JkDEH.js → withFormControl-CvsBPk94.js} +2 -2
- package/dist/chunks/{withFormControl-C35JkDEH.js.map → withFormControl-CvsBPk94.js.map} +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/index.cjs +1 -1
- package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/Modal/index.cjs +1 -1
- package/dist/cjs/components/PinInput/index.cjs +1 -1
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/RatingDots/index.cjs +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/Switch/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/TextInput/index.cjs +1 -1
- package/dist/cjs/components/Textarea/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/Checkbox/index.js +1 -1
- package/dist/esm/components/CheckboxGroup/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/Modal/index.js +1 -1
- package/dist/esm/components/PinInput/index.js +1 -1
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/RatingDots/index.js +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/Switch/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/TextInput/index.js +1 -1
- package/dist/esm/components/Textarea/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/index.js +17 -17
- package/dist/esm/index.js +17 -17
- package/dist/types/hocs/withFormControl/withFormControl.d.ts +1 -1
- package/package.json +1 -1
package/dist/chunks/{timePicker.component-DayAeaAE.js.map → timePicker.component-sttSyiVV.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timePicker.component-DayAeaAE.js","sources":["../../src/components/TimePicker/components/TimeOption/timeOption.recipe.ts","../../src/components/TimePicker/components/TimeOption/timeOption.component.tsx","../../src/components/TimePicker/timePicker.recipe.ts","../../src/components/TimePicker/components/TimeList/timeList.component.tsx","../../src/components/TimePicker/timePicker.types.ts","../../src/components/TimePicker/timePicker.component.tsx"],"sourcesContent":["import { defineRecipe } from \"@chakra-ui/react/styled-system\";\n\nexport const timeOptionRecipe = defineRecipe({\n base: {\n borderRadius: \"4px\",\n cursor: \"pointer\",\n fontSize: \"sm\",\n px: 3,\n py: 1,\n textAlign: \"center\",\n },\n variants: {\n selected: {\n true: {\n background: \"background.secondary\",\n color: \"text.contrast\",\n _hover: {\n background: \"background.secondary.hover\",\n },\n },\n false: {\n background: \"background\",\n color: \"text.subtle\",\n _hover: {\n background: \"background.secondaryAlpha.hover\",\n },\n },\n },\n },\n defaultVariants: {\n selected: false,\n },\n});\n","import React, { useCallback } from \"react\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { timeOptionRecipe } from \"./timeOption.recipe\";\n\ninterface TimeOptionProps {\n innerRef?: React.RefObject<HTMLDivElement | null> | null;\n onClick: (selectedValue: string) => void;\n selected: boolean;\n value: string;\n}\n\nexport const TimeOption = ({\n value,\n innerRef,\n onClick,\n selected,\n}: TimeOptionProps): React.JSX.Element => {\n const recipe = useRecipe({ recipe: timeOptionRecipe });\n const styles = recipe({ selected });\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedValue = event.currentTarget.textContent || \"\";\n onClick(selectedValue);\n },\n [onClick],\n );\n\n return (\n <Box\n className=\"TimePicker__Option\"\n data-testid=\"kibble-timepicker-option\"\n ref={innerRef}\n onClick={handleClick}\n css={styles}\n >\n {value}\n </Box>\n );\n};\n","import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\nexport const timePickerRecipe = defineSlotRecipe({\n slots: [\"trigger\", \"container\", \"list\"],\n base: {\n trigger: {\n width: \"100%\",\n },\n container: {\n display: \"flex\",\n gap: 1.5,\n height: \"186px\",\n overflow: \"hidden\",\n },\n list: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 1,\n overflowY: \"auto\",\n \"&::webkit-scrollbar\": {\n display: \"none\",\n },\n },\n },\n});\n","import React, { useEffect, useRef } from \"react\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { TimeOption } from \"../TimeOption/timeOption.component\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { timePickerRecipe } from \"../../timePicker.recipe\";\n\ninterface ScrollContainerProps {\n options: string[];\n optionType: \"hour\" | \"minute\" | \"meridiem\";\n selectedValue?: string;\n onClick: (value: string) => void;\n open: boolean;\n}\n\nexport const TimeList = ({\n options,\n optionType,\n selectedValue,\n onClick,\n open = false,\n}: ScrollContainerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: timePickerRecipe });\n const styles = recipe();\n const itemRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (open && containerRef.current && itemRef.current) {\n containerRef.current.scrollTop =\n itemRef.current?.offsetTop - containerRef.current?.offsetTop;\n }\n }, [open]);\n\n return (\n <Box\n className=\"TimePicker__List\"\n data-testid={`kibble-timepicker-${optionType}-list`}\n css={styles.list}\n >\n {options.map((option) => {\n return (\n <TimeOption\n key={`${optionType}-option-${option}`}\n innerRef={option === selectedValue ? itemRef : null}\n value={option}\n selected={option === selectedValue}\n onClick={onClick}\n data-testid={option}\n />\n );\n })}\n </Box>\n );\n};\n","export enum Meridiem {\n AM = \"AM\",\n PM = \"PM\",\n}\n","import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport {\n TextInput,\n TextInputProps,\n} from \"components/TextInput/textInput.component\";\nimport { Popover } from \"components/Popover/popover.component\";\nimport { Icon } from \"components/Icon/icon.component\";\nimport { useIconTextSizeMap } from \"hooks/useIconTextSizeMap\";\nimport format from \"date-fns/format\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { TimeList } from \"./components/TimeList/timeList.component\";\nimport { Meridiem } from \"./timePicker.types\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { timePickerRecipe } from \"./timePicker.recipe\";\nimport { Placement } from \"shared/types/placement\";\n\nexport interface TimePickerProps {\n initialTime?: Date;\n inputProps?: Omit<\n TextInputProps,\n \"onChange\" | \"value\" | \"isClearable\" | \"onClear\"\n >;\n minuteInterval?: number;\n onTimeChange?: (time: Date) => void;\n placement?: Placement;\n}\n\nexport const TimePicker = ({\n initialTime,\n inputProps,\n minuteInterval = 5,\n onTimeChange,\n placement = \"bottom\",\n}: TimePickerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: timePickerRecipe });\n const styles = recipe();\n const [isOpen, setIsOpen] = useState(false);\n const [selectedTime, setSelectedTime] = useState(initialTime);\n const [selectedHour, setSelectedHour] = useState<string | undefined>();\n const [selectedMinute, setSelectedMinute] = useState<string | undefined>();\n const [selectedMeridiem, setSelectedMeridiem] = useState<\n string | undefined\n >();\n\n const formattedTime = useMemo(() => {\n if (!selectedTime) return \"\";\n return format(selectedTime, \"h:mm aa\");\n }, [selectedTime]);\n\n const formatNumber = (number: number | string): string => {\n const formattedValue = number.toString();\n if (formattedValue.length === 1) {\n return `0${formattedValue}`;\n }\n\n return formattedValue;\n };\n\n const hourOptions = useMemo(() => {\n return [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((hour) =>\n hour.toString(),\n );\n }, []);\n\n const minuteOptions = useMemo(() => {\n const minutes = [];\n for (let i = 0; i < 60; i += minuteInterval) {\n minutes.push(i);\n }\n\n return minutes.map(formatNumber);\n }, [minuteInterval]);\n\n const meridiemOptions = [Meridiem.AM, Meridiem.PM];\n\n const handleTimeChange = useCallback(\n (hour?: string, minute?: string, meridiem?: string) => {\n const _hour = hour || \"12\";\n const _minute = minute || \"00\";\n const _meridiem = meridiem || \"AM\";\n let meridiemAdjustment = 0;\n\n if (!hour) {\n setSelectedHour(\"12\");\n }\n if (!minute) {\n setSelectedMinute(\"00\");\n }\n if (!meridiem) {\n setSelectedMeridiem(\"AM\");\n }\n\n // set 1-11pm to 13-23. Don't set 12pm to 24\n if (_meridiem === Meridiem.PM && Number(_hour) < 12) {\n meridiemAdjustment = 12;\n }\n\n // set 12am to 00\n if (_meridiem === Meridiem.AM && Number(_hour) === 12) {\n meridiemAdjustment = -12;\n }\n\n const hours = Number(_hour) + meridiemAdjustment;\n const time = new Date().setHours(hours, Number(_minute), 0, 0);\n const date = new Date(time);\n setSelectedTime(date);\n\n if (onTimeChange) {\n onTimeChange(date);\n }\n },\n [onTimeChange],\n );\n\n const handleHourClick = useCallback(\n (value: string) => {\n setSelectedHour(value);\n handleTimeChange(value, selectedMinute, selectedMeridiem);\n },\n [handleTimeChange, selectedMeridiem, selectedMinute],\n );\n\n const handleMinuteClick = useCallback(\n (value: string) => {\n setSelectedMinute(value);\n handleTimeChange(selectedHour, value, selectedMeridiem);\n },\n [handleTimeChange, selectedHour, selectedMeridiem],\n );\n\n const handleMeridiemClick = useCallback(\n (value: string) => {\n setSelectedMeridiem(value);\n handleTimeChange(selectedHour, selectedMinute, value);\n },\n [handleTimeChange, selectedHour, selectedMinute],\n );\n\n useEffect(() => {\n // Set default selections based on value passed in\n if (initialTime) {\n const localTime = new Date(initialTime);\n\n // calculate hours\n const hours = localTime.getHours();\n const adjustedHours = hours % 12 || 12;\n\n setSelectedTime(initialTime);\n setSelectedHour(adjustedHours.toString());\n setSelectedMinute(localTime.getMinutes().toString());\n setSelectedMeridiem(\n localTime.getHours() > 11 ? Meridiem.PM : Meridiem.AM,\n );\n }\n }, [initialTime]);\n\n return (\n <Popover\n open={isOpen}\n onOpenChange={({ open }) => setIsOpen(open)}\n anchor={\n <Box\n className=\"TimePicker__Trigger\"\n data-testid=\"kibble-timepicker-trigger\"\n css={styles.trigger}\n >\n <TextInput\n placeholder=\"12:00 AM\"\n rightElement={\n <Icon\n size={useIconTextSizeMap(inputProps?.size || \"md\")}\n name=\"clock\"\n />\n }\n value={formattedTime}\n readOnly\n cursor=\"pointer\"\n {...inputProps}\n {...(isOpen && { \"data-focus\": \"true\" })}\n />\n </Box>\n }\n contentProps={{ w: \"max-content\" }}\n variant=\"default\"\n placement={placement}\n >\n <Box\n className=\"TimePicker__Container\"\n data-testid=\"kibble-timepicker-container\"\n css={styles.container}\n >\n <TimeList\n options={hourOptions}\n optionType=\"hour\"\n selectedValue={selectedHour}\n onClick={handleHourClick}\n open={isOpen}\n />\n <TimeList\n options={minuteOptions}\n optionType=\"minute\"\n selectedValue={\n selectedMinute ? formatNumber(selectedMinute) : undefined\n }\n onClick={handleMinuteClick}\n open={isOpen}\n />\n <TimeList\n options={meridiemOptions}\n optionType=\"meridiem\"\n selectedValue={selectedMeridiem}\n onClick={handleMeridiemClick}\n open={isOpen}\n />\n </Box>\n </Popover>\n );\n};\n"],"names":["timeOptionRecipe","defineRecipe","TimeOption","value","innerRef","onClick","selected","styles","useRecipe","handleClick","useCallback","event","selectedValue","jsx","Box","timePickerRecipe","defineSlotRecipe","TimeList","options","optionType","open","useSlotRecipe","itemRef","useRef","containerRef","useEffect","option","Meridiem","TimePicker","initialTime","inputProps","minuteInterval","onTimeChange","placement","isOpen","setIsOpen","useState","selectedTime","setSelectedTime","selectedHour","setSelectedHour","selectedMinute","setSelectedMinute","selectedMeridiem","setSelectedMeridiem","formattedTime","useMemo","format","formatNumber","number","formattedValue","hourOptions","hour","minuteOptions","minutes","i","meridiemOptions","handleTimeChange","minute","meridiem","_hour","_minute","_meridiem","meridiemAdjustment","hours","time","date","handleHourClick","handleMinuteClick","handleMeridiemClick","localTime","adjustedHours","Popover","TextInput","Icon","useIconTextSizeMap","jsxs"],"mappings":";;;;;;;;;;;AAEO,MAAMA,KAAmBC,EAAa;AAAA,EAC3C,MAAM;AAAA,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;AAAA,gBACT,YAAW;AAAA,gBACX,eAAeb;AAAA,gBACf,SAAS0B;AAAA,gBACT,MAAMnC;AAAA,cAAA;AAAA,YAAA;AAAA,UACR;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"timePicker.component-sttSyiVV.js","sources":["../../src/components/TimePicker/components/TimeOption/timeOption.recipe.ts","../../src/components/TimePicker/components/TimeOption/timeOption.component.tsx","../../src/components/TimePicker/timePicker.recipe.ts","../../src/components/TimePicker/components/TimeList/timeList.component.tsx","../../src/components/TimePicker/timePicker.types.ts","../../src/components/TimePicker/timePicker.component.tsx"],"sourcesContent":["import { defineRecipe } from \"@chakra-ui/react/styled-system\";\n\nexport const timeOptionRecipe = defineRecipe({\n base: {\n borderRadius: \"4px\",\n cursor: \"pointer\",\n fontSize: \"sm\",\n px: 3,\n py: 1,\n textAlign: \"center\",\n },\n variants: {\n selected: {\n true: {\n background: \"background.secondary\",\n color: \"text.contrast\",\n _hover: {\n background: \"background.secondary.hover\",\n },\n },\n false: {\n background: \"background\",\n color: \"text.subtle\",\n _hover: {\n background: \"background.secondaryAlpha.hover\",\n },\n },\n },\n },\n defaultVariants: {\n selected: false,\n },\n});\n","import React, { useCallback } from \"react\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { timeOptionRecipe } from \"./timeOption.recipe\";\n\ninterface TimeOptionProps {\n innerRef?: React.RefObject<HTMLDivElement | null> | null;\n onClick: (selectedValue: string) => void;\n selected: boolean;\n value: string;\n}\n\nexport const TimeOption = ({\n value,\n innerRef,\n onClick,\n selected,\n}: TimeOptionProps): React.JSX.Element => {\n const recipe = useRecipe({ recipe: timeOptionRecipe });\n const styles = recipe({ selected });\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedValue = event.currentTarget.textContent || \"\";\n onClick(selectedValue);\n },\n [onClick],\n );\n\n return (\n <Box\n className=\"TimePicker__Option\"\n data-testid=\"kibble-timepicker-option\"\n ref={innerRef}\n onClick={handleClick}\n css={styles}\n >\n {value}\n </Box>\n );\n};\n","import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\nexport const timePickerRecipe = defineSlotRecipe({\n slots: [\"trigger\", \"container\", \"list\"],\n base: {\n trigger: {\n width: \"100%\",\n },\n container: {\n display: \"flex\",\n gap: 1.5,\n height: \"186px\",\n overflow: \"hidden\",\n },\n list: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 1,\n overflowY: \"auto\",\n \"&::webkit-scrollbar\": {\n display: \"none\",\n },\n },\n },\n});\n","import React, { useEffect, useRef } from \"react\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { TimeOption } from \"../TimeOption/timeOption.component\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { timePickerRecipe } from \"../../timePicker.recipe\";\n\ninterface ScrollContainerProps {\n options: string[];\n optionType: \"hour\" | \"minute\" | \"meridiem\";\n selectedValue?: string;\n onClick: (value: string) => void;\n open: boolean;\n}\n\nexport const TimeList = ({\n options,\n optionType,\n selectedValue,\n onClick,\n open = false,\n}: ScrollContainerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: timePickerRecipe });\n const styles = recipe();\n const itemRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (open && containerRef.current && itemRef.current) {\n containerRef.current.scrollTop =\n itemRef.current?.offsetTop - containerRef.current?.offsetTop;\n }\n }, [open]);\n\n return (\n <Box\n className=\"TimePicker__List\"\n data-testid={`kibble-timepicker-${optionType}-list`}\n css={styles.list}\n >\n {options.map((option) => {\n return (\n <TimeOption\n key={`${optionType}-option-${option}`}\n innerRef={option === selectedValue ? itemRef : null}\n value={option}\n selected={option === selectedValue}\n onClick={onClick}\n data-testid={option}\n />\n );\n })}\n </Box>\n );\n};\n","export enum Meridiem {\n AM = \"AM\",\n PM = \"PM\",\n}\n","import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport {\n TextInput,\n TextInputProps,\n} from \"components/TextInput/textInput.component\";\nimport { Popover } from \"components/Popover/popover.component\";\nimport { Icon } from \"components/Icon/icon.component\";\nimport { useIconTextSizeMap } from \"hooks/useIconTextSizeMap\";\nimport format from \"date-fns/format\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { TimeList } from \"./components/TimeList/timeList.component\";\nimport { Meridiem } from \"./timePicker.types\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { timePickerRecipe } from \"./timePicker.recipe\";\nimport { Placement } from \"shared/types/placement\";\n\nexport interface TimePickerProps {\n initialTime?: Date;\n inputProps?: Omit<\n TextInputProps,\n \"onChange\" | \"value\" | \"isClearable\" | \"onClear\"\n >;\n minuteInterval?: number;\n onTimeChange?: (time: Date) => void;\n placement?: Placement;\n}\n\nexport const TimePicker = ({\n initialTime,\n inputProps,\n minuteInterval = 5,\n onTimeChange,\n placement = \"bottom\",\n}: TimePickerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: timePickerRecipe });\n const styles = recipe();\n const [isOpen, setIsOpen] = useState(false);\n const [selectedTime, setSelectedTime] = useState(initialTime);\n const [selectedHour, setSelectedHour] = useState<string | undefined>();\n const [selectedMinute, setSelectedMinute] = useState<string | undefined>();\n const [selectedMeridiem, setSelectedMeridiem] = useState<\n string | undefined\n >();\n\n const formattedTime = useMemo(() => {\n if (!selectedTime) return \"\";\n return format(selectedTime, \"h:mm aa\");\n }, [selectedTime]);\n\n const formatNumber = (number: number | string): string => {\n const formattedValue = number.toString();\n if (formattedValue.length === 1) {\n return `0${formattedValue}`;\n }\n\n return formattedValue;\n };\n\n const hourOptions = useMemo(() => {\n return [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((hour) =>\n hour.toString(),\n );\n }, []);\n\n const minuteOptions = useMemo(() => {\n const minutes = [];\n for (let i = 0; i < 60; i += minuteInterval) {\n minutes.push(i);\n }\n\n return minutes.map(formatNumber);\n }, [minuteInterval]);\n\n const meridiemOptions = [Meridiem.AM, Meridiem.PM];\n\n const handleTimeChange = useCallback(\n (hour?: string, minute?: string, meridiem?: string) => {\n const _hour = hour || \"12\";\n const _minute = minute || \"00\";\n const _meridiem = meridiem || \"AM\";\n let meridiemAdjustment = 0;\n\n if (!hour) {\n setSelectedHour(\"12\");\n }\n if (!minute) {\n setSelectedMinute(\"00\");\n }\n if (!meridiem) {\n setSelectedMeridiem(\"AM\");\n }\n\n // set 1-11pm to 13-23. Don't set 12pm to 24\n if (_meridiem === Meridiem.PM && Number(_hour) < 12) {\n meridiemAdjustment = 12;\n }\n\n // set 12am to 00\n if (_meridiem === Meridiem.AM && Number(_hour) === 12) {\n meridiemAdjustment = -12;\n }\n\n const hours = Number(_hour) + meridiemAdjustment;\n const time = new Date().setHours(hours, Number(_minute), 0, 0);\n const date = new Date(time);\n setSelectedTime(date);\n\n if (onTimeChange) {\n onTimeChange(date);\n }\n },\n [onTimeChange],\n );\n\n const handleHourClick = useCallback(\n (value: string) => {\n setSelectedHour(value);\n handleTimeChange(value, selectedMinute, selectedMeridiem);\n },\n [handleTimeChange, selectedMeridiem, selectedMinute],\n );\n\n const handleMinuteClick = useCallback(\n (value: string) => {\n setSelectedMinute(value);\n handleTimeChange(selectedHour, value, selectedMeridiem);\n },\n [handleTimeChange, selectedHour, selectedMeridiem],\n );\n\n const handleMeridiemClick = useCallback(\n (value: string) => {\n setSelectedMeridiem(value);\n handleTimeChange(selectedHour, selectedMinute, value);\n },\n [handleTimeChange, selectedHour, selectedMinute],\n );\n\n useEffect(() => {\n // Set default selections based on value passed in\n if (initialTime) {\n const localTime = new Date(initialTime);\n\n // calculate hours\n const hours = localTime.getHours();\n const adjustedHours = hours % 12 || 12;\n\n setSelectedTime(initialTime);\n setSelectedHour(adjustedHours.toString());\n setSelectedMinute(localTime.getMinutes().toString());\n setSelectedMeridiem(\n localTime.getHours() > 11 ? Meridiem.PM : Meridiem.AM,\n );\n }\n }, [initialTime]);\n\n return (\n <Popover\n open={isOpen}\n onOpenChange={({ open }) => setIsOpen(open)}\n anchor={\n <Box\n className=\"TimePicker__Trigger\"\n data-testid=\"kibble-timepicker-trigger\"\n css={styles.trigger}\n >\n <TextInput\n placeholder=\"12:00 AM\"\n rightElement={\n <Icon\n size={useIconTextSizeMap(inputProps?.size || \"md\")}\n name=\"clock\"\n />\n }\n value={formattedTime}\n readOnly\n cursor=\"pointer\"\n {...inputProps}\n {...(isOpen && { \"data-focus\": \"true\" })}\n />\n </Box>\n }\n contentProps={{ w: \"max-content\" }}\n variant=\"default\"\n placement={placement}\n >\n <Box\n className=\"TimePicker__Container\"\n data-testid=\"kibble-timepicker-container\"\n css={styles.container}\n >\n <TimeList\n options={hourOptions}\n optionType=\"hour\"\n selectedValue={selectedHour}\n onClick={handleHourClick}\n open={isOpen}\n />\n <TimeList\n options={minuteOptions}\n optionType=\"minute\"\n selectedValue={\n selectedMinute ? formatNumber(selectedMinute) : undefined\n }\n onClick={handleMinuteClick}\n open={isOpen}\n />\n <TimeList\n options={meridiemOptions}\n optionType=\"meridiem\"\n selectedValue={selectedMeridiem}\n onClick={handleMeridiemClick}\n open={isOpen}\n />\n </Box>\n </Popover>\n );\n};\n"],"names":["timeOptionRecipe","defineRecipe","TimeOption","value","innerRef","onClick","selected","styles","useRecipe","handleClick","useCallback","event","selectedValue","jsx","Box","timePickerRecipe","defineSlotRecipe","TimeList","options","optionType","open","useSlotRecipe","itemRef","useRef","containerRef","useEffect","option","Meridiem","TimePicker","initialTime","inputProps","minuteInterval","onTimeChange","placement","isOpen","setIsOpen","useState","selectedTime","setSelectedTime","selectedHour","setSelectedHour","selectedMinute","setSelectedMinute","selectedMeridiem","setSelectedMeridiem","formattedTime","useMemo","format","formatNumber","number","formattedValue","hourOptions","hour","minuteOptions","minutes","i","meridiemOptions","handleTimeChange","minute","meridiem","_hour","_minute","_meridiem","meridiemAdjustment","hours","time","date","handleHourClick","handleMinuteClick","handleMeridiemClick","localTime","adjustedHours","Popover","TextInput","Icon","useIconTextSizeMap","jsxs"],"mappings":";;;;;;;;;;;AAEO,MAAMA,KAAmBC,EAAa;AAAA,EAC3C,MAAM;AAAA,IACJ,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,WAAW;AAAA,EACb;AAAA,EACA,UAAU;AAAA,IACR,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,QAAQ;AAAA,UACN,YAAY;AAAA,QAAA;AAAA,MAEhB;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,QAAQ;AAAA,UACN,YAAY;AAAA,QAAA;AAAA,MACd;AAAA,IACF;AAAA,EAEJ;AAAA,EACA,iBAAiB;AAAA,IACf,UAAU;AAAA,EAAA;AAEd,CAAC,GCpBYC,KAAa,CAAC;AAAA,EACzB,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,MAA0C;AAExC,QAAMC,IADSC,GAAU,EAAE,QAAQR,IAAkB,EAC/B,EAAE,UAAAM,GAAU,GAE5BG,IAAcC;AAAA,IAClB,CAACC,MAA4C;AACrC,YAAAC,IAAgBD,EAAM,cAAc,eAAe;AACzD,MAAAN,EAAQO,CAAa;AAAA,IACvB;AAAA,IACA,CAACP,CAAO;AAAA,EACV;AAGE,SAAAQ,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,KAAKV;AAAA,MACL,SAASK;AAAA,MACT,KAAKF;AAAA,MAEJ,UAAAJ;AAAA,IAAA;AAAA,EACH;AAEJ,GCtCaY,IAAmBC,EAAiB;AAAA,EAC/C,OAAO,CAAC,WAAW,aAAa,MAAM;AAAA,EACtC,MAAM;AAAA,IACJ,SAAS;AAAA,MACP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AAc,IAAI;AAAA,gBAElD,SAAS2B;AAAA,gBACT,MAAMlC;AAAA,cAAA;AAAA,YACR;AAAA,YACArB,gBAAAA,EAAA;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,SAASuC;AAAA,gBACT,YAAW;AAAA,gBACX,eAAeb;AAAA,gBACf,SAAS0B;AAAA,gBACT,MAAMnC;AAAA,cAAA;AAAA,YAAA;AAAA,UACR;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BjDatQAs.js"),i=require("./timePicker.component-
|
|
2
|
-
//# sourceMappingURL=timeRange.component-
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-BjDatQAs.js"),i=require("./timePicker.component-Cm2roPxJ.js"),x=require("./flex-DKWxn8hO.js"),m=require("./box-ca2FvcWF.js"),c=({endTimePickerProps:s,separator:t,startTimePickerProps:r,...n})=>e.jsxRuntimeExports.jsxs(x.Flex,{className:"TimeRange","data-testid":"kibble-time-range",...n,children:[e.jsxRuntimeExports.jsx(i.TimePicker,{...r}),e.jsxRuntimeExports.jsx(m.Box,{alignSelf:"center",mx:1,children:t||"-"}),e.jsxRuntimeExports.jsx(i.TimePicker,{...s})]});exports.TimeRange=c;
|
|
2
|
+
//# sourceMappingURL=timeRange.component-BuLsK6ed.js.map
|
package/dist/chunks/{timeRange.component-kKGWfXnG.js.map → timeRange.component-BuLsK6ed.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeRange.component-
|
|
1
|
+
{"version":3,"file":"timeRange.component-BuLsK6ed.js","sources":["../../src/components/TimeRange/timeRange.component.tsx"],"sourcesContent":["import React from \"react\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { Flex, FlexProps } from \"@chakra-ui/react/flex\";\nimport {\n TimePicker,\n TimePickerProps,\n} from \"components/TimePicker/timePicker.component\";\n\nexport interface TimeRangeProps extends FlexProps {\n separator?: React.ReactNode;\n endTimePickerProps: TimePickerProps;\n startTimePickerProps: TimePickerProps;\n}\n\nexport const TimeRange = ({\n endTimePickerProps,\n separator,\n startTimePickerProps,\n ...rest\n}: TimeRangeProps): React.JSX.Element => {\n return (\n <Flex className=\"TimeRange\" data-testid=\"kibble-time-range\" {...rest}>\n <TimePicker {...startTimePickerProps} />\n <Box alignSelf=\"center\" mx={1}>\n {separator || \"-\"}\n </Box>\n <TimePicker {...endTimePickerProps} />\n </Flex>\n );\n};\n"],"names":["TimeRange","endTimePickerProps","separator","startTimePickerProps","rest","Flex","jsx","TimePicker","Box"],"mappings":"yKAcaA,EAAY,CAAC,CACxB,mBAAAC,EACA,UAAAC,EACA,qBAAAC,EACA,GAAGC,CACL,6BAEKC,OAAK,CAAA,UAAU,YAAY,cAAY,oBAAqB,GAAGD,EAC9D,SAAA,CAACE,EAAAA,kBAAAA,IAAAC,EAAA,WAAA,CAAY,GAAGJ,EAAsB,0BACrCK,EAAAA,IAAI,CAAA,UAAU,SAAS,GAAI,EACzB,YAAa,IAChB,EACAF,wBAACC,EAAAA,WAAY,CAAA,GAAGN,CAAoB,CAAA,CAAA,EACtC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { T as r } from "./timePicker.component-
|
|
2
|
+
import { T as r } from "./timePicker.component-sttSyiVV.js";
|
|
3
3
|
import { F as a } from "./flex-C2d2LH-K.js";
|
|
4
4
|
import { B as o } from "./box-y05hq0PT.js";
|
|
5
5
|
const j = ({
|
|
@@ -15,4 +15,4 @@ const j = ({
|
|
|
15
15
|
export {
|
|
16
16
|
j as T
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=timeRange.component-
|
|
18
|
+
//# sourceMappingURL=timeRange.component-OH7hVSwj.js.map
|
package/dist/chunks/{timeRange.component-BMIZhDDZ.js.map → timeRange.component-OH7hVSwj.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeRange.component-
|
|
1
|
+
{"version":3,"file":"timeRange.component-OH7hVSwj.js","sources":["../../src/components/TimeRange/timeRange.component.tsx"],"sourcesContent":["import React from \"react\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { Flex, FlexProps } from \"@chakra-ui/react/flex\";\nimport {\n TimePicker,\n TimePickerProps,\n} from \"components/TimePicker/timePicker.component\";\n\nexport interface TimeRangeProps extends FlexProps {\n separator?: React.ReactNode;\n endTimePickerProps: TimePickerProps;\n startTimePickerProps: TimePickerProps;\n}\n\nexport const TimeRange = ({\n endTimePickerProps,\n separator,\n startTimePickerProps,\n ...rest\n}: TimeRangeProps): React.JSX.Element => {\n return (\n <Flex className=\"TimeRange\" data-testid=\"kibble-time-range\" {...rest}>\n <TimePicker {...startTimePickerProps} />\n <Box alignSelf=\"center\" mx={1}>\n {separator || \"-\"}\n </Box>\n <TimePicker {...endTimePickerProps} />\n </Flex>\n );\n};\n"],"names":["TimeRange","endTimePickerProps","separator","startTimePickerProps","rest","Flex","jsx","TimePicker","Box"],"mappings":";;;;AAcO,MAAMA,IAAY,CAAC;AAAA,EACxB,oBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,GAAGC;AACL,6BAEKC,GAAK,EAAA,WAAU,aAAY,eAAY,qBAAqB,GAAGD,GAC9D,UAAA;AAAA,EAACE,gBAAAA,EAAAA,IAAAC,GAAA,EAAY,GAAGJ,GAAsB;AAAA,wBACrCK,GAAI,EAAA,WAAU,UAAS,IAAI,GACzB,eAAa,KAChB;AAAA,EACAF,gBAAAA,MAACC,GAAY,EAAA,GAAGN,EAAoB,CAAA;AAAA,GACtC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as o } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { W as K } from "./text.component-DZkwd4C0.js";
|
|
3
3
|
import { p as g, f as Q } from "./typography.records-DA6XZIsX.js";
|
|
4
4
|
import { I as V } from "./icon.component-BmcWaysM.js";
|
|
@@ -10,20 +10,20 @@ import { c as oe } from "./create-slot-recipe-context-DJkLYvCT.js";
|
|
|
10
10
|
import { c as ae } from "./create-recipe-context-BcvaE0iS.js";
|
|
11
11
|
import { u as v, F as le } from "./use-field-context-B8ygn96q.js";
|
|
12
12
|
import { f as I, a as ne, b as ie, h as de } from "./use-locale-context-zakBNK5b.js";
|
|
13
|
-
import { U as
|
|
14
|
-
const B = P((
|
|
15
|
-
const r = v(), e =
|
|
16
|
-
return r?.invalid ? /* @__PURE__ */
|
|
13
|
+
import { U as j, _ as ce, e as u, u as fe } from "./index-DLvqBeH6.js";
|
|
14
|
+
const B = P((l, t) => {
|
|
15
|
+
const r = v(), e = j(r.getErrorTextProps(), l);
|
|
16
|
+
return r?.invalid ? /* @__PURE__ */ o.jsx(I.span, { ...e, ref: t }) : null;
|
|
17
17
|
});
|
|
18
18
|
B.displayName = "FieldErrorText";
|
|
19
|
-
const O = P((
|
|
20
|
-
const r = v(), e =
|
|
21
|
-
return /* @__PURE__ */
|
|
19
|
+
const O = P((l, t) => {
|
|
20
|
+
const r = v(), e = j(r?.getHelperTextProps(), l);
|
|
21
|
+
return /* @__PURE__ */ o.jsx(I.span, { ...e, ref: t });
|
|
22
22
|
});
|
|
23
23
|
O.displayName = "FieldHelperText";
|
|
24
|
-
const W = P((
|
|
25
|
-
const r = v(), e =
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
const W = P((l, t) => {
|
|
25
|
+
const r = v(), e = j(r?.getLabelProps(), l);
|
|
26
|
+
return /* @__PURE__ */ o.jsx(I.label, { ...e, ref: t });
|
|
27
27
|
});
|
|
28
28
|
W.displayName = "FieldLabel";
|
|
29
29
|
const me = typeof window < "u" ? Y : ee, [Me, ue] = ne({
|
|
@@ -31,8 +31,8 @@ const me = typeof window < "u" ? Y : ee, [Me, ue] = ne({
|
|
|
31
31
|
hookName: "useFieldsetContext",
|
|
32
32
|
providerName: "<FieldsetProvider />",
|
|
33
33
|
strict: !1
|
|
34
|
-
}), pe = (
|
|
35
|
-
const t = ue(), { ids: r, disabled: e = !!t?.disabled, invalid: s = !1, readOnly:
|
|
34
|
+
}), pe = (l = {}) => {
|
|
35
|
+
const t = ue(), { ids: r, disabled: e = !!t?.disabled, invalid: s = !1, readOnly: a = !1, required: n = !1 } = l, [i, F] = q(!1), [T, N] = q(!1), d = l.id ?? te(), f = re(null), C = r?.control ?? `field::${d}`, c = r?.errorText ?? `field::${d}::error-text`, p = r?.helperText ?? `field::${d}::helper-text`, h = r?.label ?? `field::${d}::label`;
|
|
36
36
|
me(() => {
|
|
37
37
|
const b = f.current;
|
|
38
38
|
if (!b) return;
|
|
@@ -46,7 +46,7 @@ const me = typeof window < "u" ? Y : ee, [Me, ue] = ne({
|
|
|
46
46
|
const y = m(() => {
|
|
47
47
|
const b = [];
|
|
48
48
|
return i && s && b.push(c), T && b.push(p), b.join(" ") || void 0;
|
|
49
|
-
}, [s, c, p, i, T]),
|
|
49
|
+
}, [s, c, p, i, T]), w = m(
|
|
50
50
|
() => () => ({
|
|
51
51
|
...g.root.attrs,
|
|
52
52
|
id: C,
|
|
@@ -54,32 +54,32 @@ const me = typeof window < "u" ? Y : ee, [Me, ue] = ne({
|
|
|
54
54
|
role: "group",
|
|
55
55
|
"data-disabled": u(e),
|
|
56
56
|
"data-invalid": u(s),
|
|
57
|
-
"data-readonly": u(
|
|
57
|
+
"data-readonly": u(a)
|
|
58
58
|
}),
|
|
59
|
-
[e, s,
|
|
59
|
+
[e, s, a, C]
|
|
60
60
|
), R = m(
|
|
61
61
|
() => () => ({
|
|
62
62
|
...g.label.attrs,
|
|
63
63
|
id: h,
|
|
64
64
|
"data-disabled": u(e),
|
|
65
65
|
"data-invalid": u(s),
|
|
66
|
-
"data-readonly": u(
|
|
66
|
+
"data-readonly": u(a),
|
|
67
67
|
htmlFor: d
|
|
68
68
|
}),
|
|
69
|
-
[e, s,
|
|
69
|
+
[e, s, a, d, h]
|
|
70
70
|
), x = m(
|
|
71
71
|
() => () => ({
|
|
72
72
|
"aria-describedby": y,
|
|
73
73
|
"aria-invalid": fe(s),
|
|
74
74
|
"data-invalid": u(s),
|
|
75
75
|
"data-required": u(n),
|
|
76
|
-
"data-readonly": u(
|
|
76
|
+
"data-readonly": u(a),
|
|
77
77
|
id: d,
|
|
78
78
|
required: n,
|
|
79
79
|
disabled: e,
|
|
80
|
-
readOnly:
|
|
80
|
+
readOnly: a
|
|
81
81
|
}),
|
|
82
|
-
[y, s, n,
|
|
82
|
+
[y, s, n, a, d, e]
|
|
83
83
|
), E = m(
|
|
84
84
|
() => () => ({
|
|
85
85
|
...x(),
|
|
@@ -133,10 +133,10 @@ const me = typeof window < "u" ? Y : ee, [Me, ue] = ne({
|
|
|
133
133
|
},
|
|
134
134
|
disabled: e,
|
|
135
135
|
invalid: s,
|
|
136
|
-
readOnly:
|
|
136
|
+
readOnly: a,
|
|
137
137
|
required: n,
|
|
138
138
|
getLabelProps: R,
|
|
139
|
-
getRootProps:
|
|
139
|
+
getRootProps: w,
|
|
140
140
|
getInputProps: E,
|
|
141
141
|
getTextareaProps: D,
|
|
142
142
|
getSelectProps: Z,
|
|
@@ -144,16 +144,16 @@ const me = typeof window < "u" ? Y : ee, [Me, ue] = ne({
|
|
|
144
144
|
getErrorTextProps: G,
|
|
145
145
|
getRequiredIndicatorProps: J
|
|
146
146
|
};
|
|
147
|
-
}, z = P((
|
|
148
|
-
const [r, e] = ie()(
|
|
147
|
+
}, z = P((l, t) => {
|
|
148
|
+
const [r, e] = ie()(l, [
|
|
149
149
|
"id",
|
|
150
150
|
"ids",
|
|
151
151
|
"disabled",
|
|
152
152
|
"invalid",
|
|
153
153
|
"readOnly",
|
|
154
154
|
"required"
|
|
155
|
-
]), s = pe(r),
|
|
156
|
-
return /* @__PURE__ */
|
|
155
|
+
]), s = pe(r), a = j(s.getRootProps(), e);
|
|
156
|
+
return /* @__PURE__ */ o.jsx(le, { value: s, children: /* @__PURE__ */ o.jsx(I.div, { ...a, ref: de(t, s.refs.rootRef) }) });
|
|
157
157
|
});
|
|
158
158
|
z.displayName = "FieldRoot";
|
|
159
159
|
const { useRecipeResult: xe } = ae({ key: "icon" }), he = X.forwardRef(
|
|
@@ -161,28 +161,28 @@ const { useRecipeResult: xe } = ae({ key: "icon" }), he = X.forwardRef(
|
|
|
161
161
|
const {
|
|
162
162
|
styles: e,
|
|
163
163
|
className: s,
|
|
164
|
-
props:
|
|
164
|
+
props: a
|
|
165
165
|
} = xe({ asChild: !t.as, ...t });
|
|
166
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ o.jsx(
|
|
167
167
|
L.svg,
|
|
168
168
|
{
|
|
169
169
|
ref: r,
|
|
170
170
|
focusable: !1,
|
|
171
171
|
"aria-hidden": "true",
|
|
172
|
-
...
|
|
172
|
+
...a,
|
|
173
173
|
css: [e, t.css],
|
|
174
174
|
className: M(s, t.className)
|
|
175
175
|
}
|
|
176
176
|
);
|
|
177
177
|
}
|
|
178
178
|
);
|
|
179
|
-
function ge(
|
|
179
|
+
function ge(l) {
|
|
180
180
|
const {
|
|
181
181
|
viewBox: t = "0 0 24 24",
|
|
182
182
|
d: r,
|
|
183
183
|
displayName: e,
|
|
184
184
|
defaultProps: s = {}
|
|
185
|
-
} =
|
|
185
|
+
} = l, a = se.toArray(l.path), n = P((i, F) => /* @__PURE__ */ o.jsx(
|
|
186
186
|
he,
|
|
187
187
|
{
|
|
188
188
|
ref: F,
|
|
@@ -190,7 +190,7 @@ function ge(a) {
|
|
|
190
190
|
viewBox: t,
|
|
191
191
|
...s,
|
|
192
192
|
...i,
|
|
193
|
-
children:
|
|
193
|
+
children: a.length ? a : /* @__PURE__ */ o.jsx("path", { fill: "currentColor", d: r })
|
|
194
194
|
}
|
|
195
195
|
));
|
|
196
196
|
return n.displayName = e, n;
|
|
@@ -217,13 +217,13 @@ ge({
|
|
|
217
217
|
d: "M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"
|
|
218
218
|
});
|
|
219
219
|
const ve = P(function(t, r) {
|
|
220
|
-
const { fallback: e, children: s = "*", ...
|
|
221
|
-
return n?.required ? /* @__PURE__ */
|
|
220
|
+
const { fallback: e, children: s = "*", ...a } = t, n = v(), i = Te(), F = be();
|
|
221
|
+
return n?.required ? /* @__PURE__ */ o.jsx(
|
|
222
222
|
L.span,
|
|
223
223
|
{
|
|
224
224
|
ref: r,
|
|
225
225
|
"aria-hidden": "true",
|
|
226
|
-
...
|
|
226
|
+
...a,
|
|
227
227
|
className: M(i.requiredIndicator, t.className),
|
|
228
228
|
css: [F.requiredIndicator, t.css],
|
|
229
229
|
children: s
|
|
@@ -233,12 +233,12 @@ const ve = P(function(t, r) {
|
|
|
233
233
|
sm: 10,
|
|
234
234
|
md: 12,
|
|
235
235
|
lg: 14
|
|
236
|
-
}, Be = (
|
|
236
|
+
}, Be = (l) => {
|
|
237
237
|
const t = ({
|
|
238
238
|
disabled: r = !1,
|
|
239
239
|
errorText: e = "Field is invalid",
|
|
240
240
|
formControlStyle: s,
|
|
241
|
-
helperText:
|
|
241
|
+
helperText: a,
|
|
242
242
|
inlineField: n = !1,
|
|
243
243
|
invalid: i = !1,
|
|
244
244
|
invalidIconColor: F = "warning",
|
|
@@ -248,13 +248,13 @@ const ve = P(function(t, r) {
|
|
|
248
248
|
onContrast: f = !1,
|
|
249
249
|
readOnly: C = !1,
|
|
250
250
|
required: c = !1,
|
|
251
|
-
|
|
251
|
+
showOptionalElement: p = !1,
|
|
252
252
|
size: h = "md",
|
|
253
253
|
useInvalidIcon: y = !1,
|
|
254
|
-
useInvalidText:
|
|
254
|
+
useInvalidText: w = !0,
|
|
255
255
|
...R
|
|
256
256
|
}) => {
|
|
257
|
-
const x = /* @__PURE__ */
|
|
257
|
+
const x = /* @__PURE__ */ o.jsxs(
|
|
258
258
|
Pe,
|
|
259
259
|
{
|
|
260
260
|
className: "FormControl__Label",
|
|
@@ -266,13 +266,13 @@ const ve = P(function(t, r) {
|
|
|
266
266
|
},
|
|
267
267
|
children: [
|
|
268
268
|
T,
|
|
269
|
-
|
|
269
|
+
/* @__PURE__ */ o.jsx(
|
|
270
270
|
ve,
|
|
271
271
|
{
|
|
272
272
|
className: "FormControl__RequiredIndicator",
|
|
273
273
|
color: f ? "text.danger.contrast" : "text.danger",
|
|
274
274
|
...!c && {
|
|
275
|
-
fallback: /* @__PURE__ */
|
|
275
|
+
fallback: p ? /* @__PURE__ */ o.jsxs(
|
|
276
276
|
K,
|
|
277
277
|
{
|
|
278
278
|
variant: f ? "subtleOnContrast" : "subtle",
|
|
@@ -282,14 +282,14 @@ const ve = P(function(t, r) {
|
|
|
282
282
|
"(Optional)"
|
|
283
283
|
]
|
|
284
284
|
}
|
|
285
|
-
)
|
|
285
|
+
) : /* @__PURE__ */ o.jsx(o.Fragment, {})
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
)
|
|
289
289
|
]
|
|
290
290
|
}
|
|
291
291
|
);
|
|
292
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ o.jsxs(
|
|
293
293
|
Ce,
|
|
294
294
|
{
|
|
295
295
|
className: "FormControl group",
|
|
@@ -300,7 +300,7 @@ const ve = P(function(t, r) {
|
|
|
300
300
|
width: "auto",
|
|
301
301
|
...s,
|
|
302
302
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ o.jsxs(
|
|
304
304
|
k,
|
|
305
305
|
{
|
|
306
306
|
className: "FormControl__Container",
|
|
@@ -309,7 +309,7 @@ const ve = P(function(t, r) {
|
|
|
309
309
|
gap: 2,
|
|
310
310
|
children: [
|
|
311
311
|
T && N === "start" && x,
|
|
312
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ o.jsxs(
|
|
313
313
|
k,
|
|
314
314
|
{
|
|
315
315
|
className: "FormControl__Content",
|
|
@@ -317,8 +317,8 @@ const ve = P(function(t, r) {
|
|
|
317
317
|
gap: 2,
|
|
318
318
|
w: n ? "max-content" : "100%",
|
|
319
319
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
|
|
320
|
+
/* @__PURE__ */ o.jsx(
|
|
321
|
+
l,
|
|
322
322
|
{
|
|
323
323
|
disabled: r,
|
|
324
324
|
invalid: i,
|
|
@@ -329,7 +329,7 @@ const ve = P(function(t, r) {
|
|
|
329
329
|
...R
|
|
330
330
|
}
|
|
331
331
|
),
|
|
332
|
-
y && i && /* @__PURE__ */
|
|
332
|
+
y && i && /* @__PURE__ */ o.jsx(
|
|
333
333
|
V,
|
|
334
334
|
{
|
|
335
335
|
className: "FormControl__InvalidIcon",
|
|
@@ -345,7 +345,7 @@ const ve = P(function(t, r) {
|
|
|
345
345
|
]
|
|
346
346
|
}
|
|
347
347
|
),
|
|
348
|
-
|
|
348
|
+
w && i && /* @__PURE__ */ o.jsx(
|
|
349
349
|
Ne,
|
|
350
350
|
{
|
|
351
351
|
className: "FormControl__ErrorText",
|
|
@@ -354,22 +354,22 @@ const ve = P(function(t, r) {
|
|
|
354
354
|
children: e
|
|
355
355
|
}
|
|
356
356
|
),
|
|
357
|
-
|
|
357
|
+
a && /* @__PURE__ */ o.jsx(
|
|
358
358
|
ye,
|
|
359
359
|
{
|
|
360
360
|
className: "FormControl__HelperText",
|
|
361
361
|
fontSize: "xs",
|
|
362
362
|
color: f ? "text.subtle.contrast" : "text.subtle",
|
|
363
|
-
children:
|
|
363
|
+
children: a
|
|
364
364
|
}
|
|
365
365
|
)
|
|
366
366
|
]
|
|
367
367
|
}
|
|
368
368
|
);
|
|
369
369
|
};
|
|
370
|
-
return t.displayName = `withFormControl(${
|
|
370
|
+
return t.displayName = `withFormControl(${l.displayName || l.name}`, t;
|
|
371
371
|
};
|
|
372
372
|
export {
|
|
373
373
|
Be as w
|
|
374
374
|
};
|
|
375
|
-
//# sourceMappingURL=withFormControl-
|
|
375
|
+
//# sourceMappingURL=withFormControl-Chelruxy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withFormControl-BldbKXiV.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const id = props.id ?? useId();\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const win = getWindow(rootNode);\n const doc = win.document;\n const checkTextElements = () => {\n setHasErrorText(!!doc.getElementById(errorTextId));\n setHasHelperText(!!doc.getElementById(helperTextId));\n };\n checkTextElements();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from \"./withFormControl.types\";\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from \"react\";\nimport { Field } from \"@chakra-ui/react/field\";\nimport {\n FormControlLabelPosition,\n FormControlSize,\n} from \"./withFormControl.types\";\nimport { SystemStyleObject } from \"@chakra-ui/react/styled-system\";\nimport { TypographyVariant } from \"shared/types/typography\";\nimport { Text } from \"components/Text/text.component\";\nimport { optionalTextSizeMap } from \"./withFormControl.records\";\nimport { fontSizes } from \"theme/tokens/typography/typography.records\";\nimport { Flex } from \"@chakra-ui/react/flex\";\nimport { Icon } from \"components/Icon/icon.component\";\n\nexport interface WithFormControlProps {\n disabled?: boolean;\n errorText?: string;\n formControlStyle?: SystemStyleObject;\n helperText?: string;\n inlineField?: boolean;\n invalid?: boolean;\n invalidIconColor?: TypographyVariant;\n label?: string | React.ReactNode;\n labelPosition?: FormControlLabelPosition;\n labelStyle?: SystemStyleObject;\n onContrast?: boolean;\n readOnly?: boolean;\n required?: boolean;\n showRequiredElement?: boolean;\n size?: FormControlSize;\n useInvalidIcon?: boolean;\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = \"Field is invalid\",\n formControlStyle,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = \"warning\",\n label,\n labelPosition = \"start\",\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showRequiredElement = false,\n size = \"md\",\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? \"text.contrast\" : \"text\"}\n fontSize={fontSizes[size]}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {label}\n {showRequiredElement && (\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n {...(!required && {\n fallback: (\n <Text\n variant={onContrast ? \"subtleOnContrast\" : \"subtle\"}\n fontSize={optionalTextSizeMap[size]}\n >\n {\" \"}\n (Optional)\n </Text>\n ),\n })}\n />\n )}\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width=\"auto\"\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? \"row\" : \"column\"}\n w={inlineField ? \"max-content\" : \"100%\"}\n gap={2}\n >\n {label && labelPosition === \"start\" && labelComponent}\n <Flex\n className=\"FormControl__Content\"\n alignItems=\"center\"\n gap={2}\n w={inlineField ? \"max-content\" : \"100%\"}\n >\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon\n className=\"FormControl__InvalidIcon\"\n name=\"warningSign\"\n variant={invalidIconColor}\n size={size}\n />\n )}\n </Flex>\n {label && labelPosition === \"end\" && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.subtle.contrast\" : \"text.subtle\"}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","id","useId","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","win","getWindow","doc","checkTextElements","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showRequiredElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Field.RequiredIndicator","Text","Flex"],"mappings":";;;;;;;;;;;;;AAOA,MAAMA,IAAiBC,EAAW,CAACC,GAAOC,MAAQ;AAChD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,EAAM,kBAAiB,GAAIF,CAAK;AAC/D,SAAIE,GAAO,UACcI,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK,IAEvD;AACT,CAAC;AACDH,EAAe,cAAc;ACR7B,MAAMU,IAAkBT,EAAW,CAACC,GAAOC,MAAQ;AACjD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,mBAAkB,GAAIF,CAAK;AACjE,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC9D,CAAC;AACDO,EAAgB,cAAc;ACL9B,MAAMC,IAAaV,EAAW,CAACC,GAAOC,MAAQ;AAC5C,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,cAAa,GAAIF,CAAK;AAC5D,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,OAAO,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC/D,CAAC;AACDQ,EAAW,cAAc;ACTzB,MAAMC,KAAsB,OAAO,SAAW,MAAcC,IAAkBC,ICAxE,CAACC,IAAkBC,EAAkB,IAAIC,GAAc;AAAA,EAC3D,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAAA,EACd,QAAQ;AACV,CAAC,GCDKC,KAAW,CAAChB,IAAQ,OAAO;AAC/B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,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,OAAOmB,IAAa,yBAAyB;AAAA,cAE5C,UAAAN;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ;AACA,SAAAH,EAAgB,cAAc,mBAAmBD,EAAU,eAAeA,EAAU,IAAI,IAEjFC;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
|
1
|
+
{"version":3,"file":"withFormControl-Chelruxy.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const id = props.id ?? useId();\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const win = getWindow(rootNode);\n const doc = win.document;\n const checkTextElements = () => {\n setHasErrorText(!!doc.getElementById(errorTextId));\n setHasHelperText(!!doc.getElementById(helperTextId));\n };\n checkTextElements();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from \"./withFormControl.types\";\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from \"react\";\nimport { Field } from \"@chakra-ui/react/field\";\nimport {\n FormControlLabelPosition,\n FormControlSize,\n} from \"./withFormControl.types\";\nimport { SystemStyleObject } from \"@chakra-ui/react/styled-system\";\nimport { TypographyVariant } from \"shared/types/typography\";\nimport { Text } from \"components/Text/text.component\";\nimport { optionalTextSizeMap } from \"./withFormControl.records\";\nimport { fontSizes } from \"theme/tokens/typography/typography.records\";\nimport { Flex } from \"@chakra-ui/react/flex\";\nimport { Icon } from \"components/Icon/icon.component\";\n\nexport interface WithFormControlProps {\n disabled?: boolean;\n errorText?: string;\n formControlStyle?: SystemStyleObject;\n helperText?: string;\n inlineField?: boolean;\n invalid?: boolean;\n invalidIconColor?: TypographyVariant;\n label?: string | React.ReactNode;\n labelPosition?: FormControlLabelPosition;\n labelStyle?: SystemStyleObject;\n onContrast?: boolean;\n readOnly?: boolean;\n required?: boolean;\n showOptionalElement?: boolean;\n size?: FormControlSize;\n useInvalidIcon?: boolean;\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = \"Field is invalid\",\n formControlStyle,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = \"warning\",\n label,\n labelPosition = \"start\",\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = \"md\",\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? \"text.contrast\" : \"text\"}\n fontSize={fontSizes[size]}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {label}\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n variant={onContrast ? \"subtleOnContrast\" : \"subtle\"}\n fontSize={optionalTextSizeMap[size]}\n >\n {\" \"}\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width=\"auto\"\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? \"row\" : \"column\"}\n w={inlineField ? \"max-content\" : \"100%\"}\n gap={2}\n >\n {label && labelPosition === \"start\" && labelComponent}\n <Flex\n className=\"FormControl__Content\"\n alignItems=\"center\"\n gap={2}\n w={inlineField ? \"max-content\" : \"100%\"}\n >\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon\n className=\"FormControl__InvalidIcon\"\n name=\"warningSign\"\n variant={invalidIconColor}\n size={size}\n />\n )}\n </Flex>\n {label && labelPosition === \"end\" && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.subtle.contrast\" : \"text.subtle\"}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","id","useId","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","win","getWindow","doc","checkTextElements","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":";;;;;;;;;;;;;AAOA,MAAMA,IAAiBC,EAAW,CAACC,GAAOC,MAAQ;AAChD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,EAAM,kBAAiB,GAAIF,CAAK;AAC/D,SAAIE,GAAO,UACcI,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK,IAEvD;AACT,CAAC;AACDH,EAAe,cAAc;ACR7B,MAAMU,IAAkBT,EAAW,CAACC,GAAOC,MAAQ;AACjD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,mBAAkB,GAAIF,CAAK;AACjE,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC9D,CAAC;AACDO,EAAgB,cAAc;ACL9B,MAAMC,IAAaV,EAAW,CAACC,GAAOC,MAAQ;AAC5C,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,cAAa,GAAIF,CAAK;AAC5D,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,OAAO,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC/D,CAAC;AACDQ,EAAW,cAAc;ACTzB,MAAMC,KAAsB,OAAO,SAAW,MAAcC,IAAkBC,ICAxE,CAACC,IAAkBC,EAAkB,IAAIC,GAAc;AAAA,EAC3D,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAAA,EACd,QAAQ;AACV,CAAC,GCDKC,KAAW,CAAChB,IAAQ,OAAO;AAC/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