@televet/kibble-ui 5.0.20-alpha.hunter.9 → 5.0.20
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/{avatarGroup.component-BHchH_tF.js → avatarGroup.component-CJCQSIyr.js} +2 -2
- package/dist/chunks/{avatarGroup.component-BHchH_tF.js.map → avatarGroup.component-CJCQSIyr.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-Ba_rfWUg.js → avatarGroup.component-M84HNv2O.js} +2 -2
- package/dist/chunks/{avatarGroup.component-Ba_rfWUg.js.map → avatarGroup.component-M84HNv2O.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-BNOBvOyv.js → buttonGroup.component-HKh7TJ0v.js} +2 -2
- package/dist/chunks/{buttonGroup.component-BNOBvOyv.js.map → buttonGroup.component-HKh7TJ0v.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-BXiKIlPf.js → buttonGroup.component-pR0mvmm7.js} +2 -2
- package/dist/chunks/{buttonGroup.component-BXiKIlPf.js.map → buttonGroup.component-pR0mvmm7.js.map} +1 -1
- package/dist/chunks/{calendar.component-IbKgfA9K.js → calendar.component-BFSyxaB6.js} +2 -2
- package/dist/chunks/{calendar.component-IbKgfA9K.js.map → calendar.component-BFSyxaB6.js.map} +1 -1
- package/dist/chunks/{calendar.component-BG7_Kwgn.js → calendar.component-UUc8d3QQ.js} +2 -2
- package/dist/chunks/{calendar.component-BG7_Kwgn.js.map → calendar.component-UUc8d3QQ.js.map} +1 -1
- package/dist/chunks/{checkbox.component-DdOVYSSc.js → checkbox.component-C132vkan.js} +2 -2
- package/dist/chunks/{checkbox.component-DdOVYSSc.js.map → checkbox.component-C132vkan.js.map} +1 -1
- package/dist/chunks/{checkbox.component-DDsVfE4a.js → checkbox.component-DUJCiZr2.js} +2 -2
- package/dist/chunks/{checkbox.component-DDsVfE4a.js.map → checkbox.component-DUJCiZr2.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-CvHKP7gd.js → checkboxGroup.component-2U0ZW1TD.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-CvHKP7gd.js.map → checkboxGroup.component-2U0ZW1TD.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-Cx2Gvii5.js → checkboxGroup.component-DW9qUlSm.js} +3 -3
- package/dist/chunks/{checkboxGroup.component-Cx2Gvii5.js.map → checkboxGroup.component-DW9qUlSm.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-0D3jmvOf.js → conversationCard.component-CscMIq51.js} +2 -2
- package/dist/chunks/{conversationCard.component-0D3jmvOf.js.map → conversationCard.component-CscMIq51.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-D7hpX-QG.js → conversationCard.component-HYxRoILR.js} +2 -2
- package/dist/chunks/{conversationCard.component-D7hpX-QG.js.map → conversationCard.component-HYxRoILR.js.map} +1 -1
- package/dist/chunks/{datePicker.component-BuHqzdy_.js → datePicker.component-BuGpHTzS.js} +2 -2
- package/dist/chunks/{datePicker.component-BuHqzdy_.js.map → datePicker.component-BuGpHTzS.js.map} +1 -1
- package/dist/chunks/{datePicker.component-BmmxcyyX.js → datePicker.component-Dq2vL7Mk.js} +3 -3
- package/dist/chunks/{datePicker.component-BmmxcyyX.js.map → datePicker.component-Dq2vL7Mk.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-ElRAMKbN.js → datePicker.provider-CavuOZl4.js} +747 -750
- package/dist/chunks/{datePicker.provider-ElRAMKbN.js.map → datePicker.provider-CavuOZl4.js.map} +1 -1
- package/dist/chunks/datePicker.provider-i35-VNAb.js +15 -0
- package/dist/chunks/{datePicker.provider-B7-cWUkv.js.map → datePicker.provider-i35-VNAb.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-CAYI8EOg.js → dateTimePicker.component-BlWhC5aT.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-CAYI8EOg.js.map → dateTimePicker.component-BlWhC5aT.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-Dnqx_xtK.js → dateTimePicker.component-DnYStcAJ.js} +4 -4
- package/dist/chunks/{dateTimePicker.component-Dnqx_xtK.js.map → dateTimePicker.component-DnYStcAJ.js.map} +1 -1
- package/dist/chunks/{menu.component-BEDMybmZ.js → menu.component-CV8eVKYt.js} +3 -3
- package/dist/chunks/{menu.component-BEDMybmZ.js.map → menu.component-CV8eVKYt.js.map} +1 -1
- package/dist/chunks/{menu.component-DypBuCwv.js → menu.component-D2V9Q1Y5.js} +2 -2
- package/dist/chunks/{menu.component-DypBuCwv.js.map → menu.component-D2V9Q1Y5.js.map} +1 -1
- package/dist/chunks/{numberInput.component-DG6IWAHs.js → numberInput.component-DGPEz0Fv.js} +2 -2
- package/dist/chunks/{numberInput.component-DG6IWAHs.js.map → numberInput.component-DGPEz0Fv.js.map} +1 -1
- package/dist/chunks/{numberInput.component-DFK4EYLV.js → numberInput.component-V6NQs14b.js} +2 -2
- package/dist/chunks/{numberInput.component-DFK4EYLV.js.map → numberInput.component-V6NQs14b.js.map} +1 -1
- package/dist/chunks/{pinInput.types-ftBwVMLj.js → pinInput.types-Can9f1Eu.js} +2 -2
- package/dist/chunks/{pinInput.types-ftBwVMLj.js.map → pinInput.types-Can9f1Eu.js.map} +1 -1
- package/dist/chunks/{pinInput.types-BmXYQb7O.js → pinInput.types-bIGh7aUS.js} +2 -2
- package/dist/chunks/{pinInput.types-BmXYQb7O.js.map → pinInput.types-bIGh7aUS.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-CVFQ5dZ7.js → radioGroup.types-BVbxeB22.js} +3 -3
- package/dist/chunks/{radioGroup.types-CVFQ5dZ7.js.map → radioGroup.types-BVbxeB22.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-DxRSugsr.js → radioGroup.types-U1ep9nrN.js} +2 -2
- package/dist/chunks/{radioGroup.types-DxRSugsr.js.map → radioGroup.types-U1ep9nrN.js.map} +1 -1
- package/dist/chunks/{rating.component-CQgpD-gS.js → rating.component-DeJY9G94.js} +2 -2
- package/dist/chunks/rating.component-DeJY9G94.js.map +1 -0
- package/dist/chunks/{rating.component-FYKS_NCl.js → rating.component-DsHkKmA7.js} +2 -2
- package/dist/chunks/rating.component-DsHkKmA7.js.map +1 -0
- package/dist/chunks/{ratingDots.component-C1KgTGWj.js → ratingDots.component-BhWM7kTg.js} +2 -2
- package/dist/chunks/{ratingDots.component-C1KgTGWj.js.map → ratingDots.component-BhWM7kTg.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-DesbSj0q.js → ratingDots.component-CZ370iI3.js} +2 -2
- package/dist/chunks/{ratingDots.component-DesbSj0q.js.map → ratingDots.component-CZ370iI3.js.map} +1 -1
- package/dist/chunks/{select.component-BkDkYpf2.js → select.component-CIjEq1os.js} +3 -3
- package/dist/chunks/{select.component-BkDkYpf2.js.map → select.component-CIjEq1os.js.map} +1 -1
- package/dist/chunks/{select.component-DoFwe4lJ.js → select.component-OrsHXCMz.js} +2 -2
- package/dist/chunks/{select.component-DoFwe4lJ.js.map → select.component-OrsHXCMz.js.map} +1 -1
- package/dist/chunks/semanticTokens.records-CmeaObFQ.js +2 -0
- package/dist/chunks/semanticTokens.records-CmeaObFQ.js.map +1 -0
- package/dist/chunks/semanticTokens.records-CwC7zhMS.js +549 -0
- package/dist/chunks/semanticTokens.records-CwC7zhMS.js.map +1 -0
- package/dist/chunks/{switch.component-Bs-8D1pU.js → switch.component-BYEMhBCA.js} +2 -2
- package/dist/chunks/{switch.component-Bs-8D1pU.js.map → switch.component-BYEMhBCA.js.map} +1 -1
- package/dist/chunks/{switch.component-Cr8Abw0U.js → switch.component-DjN67nap.js} +2 -2
- package/dist/chunks/{switch.component-Cr8Abw0U.js.map → switch.component-DjN67nap.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-BWXHnUPn.js → tagBlock.component-B899iqQP.js} +2 -2
- package/dist/chunks/{tagBlock.component-BWXHnUPn.js.map → tagBlock.component-B899iqQP.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-DjbevH0J.js → tagBlock.component-R4FY7ytN.js} +2 -2
- package/dist/chunks/{tagBlock.component-DjbevH0J.js.map → tagBlock.component-R4FY7ytN.js.map} +1 -1
- package/dist/chunks/{textInput.component-C7kdQ8hF.js → textInput.component-BeiTxTkS.js} +2 -2
- package/dist/chunks/{textInput.component-C7kdQ8hF.js.map → textInput.component-BeiTxTkS.js.map} +1 -1
- package/dist/chunks/{textInput.component-DzUKTy1w.js → textInput.component-CwTc0h_F.js} +2 -2
- package/dist/chunks/{textInput.component-DzUKTy1w.js.map → textInput.component-CwTc0h_F.js.map} +1 -1
- package/dist/chunks/{textarea.component-DteG1L4y.js → textarea.component-BIg_XX_R.js} +2 -2
- package/dist/chunks/{textarea.component-DteG1L4y.js.map → textarea.component-BIg_XX_R.js.map} +1 -1
- package/dist/chunks/{textarea.component-W9VBnd4-.js → textarea.component-C6Wt1Pk8.js} +2 -2
- package/dist/chunks/{textarea.component-W9VBnd4-.js.map → textarea.component-C6Wt1Pk8.js.map} +1 -1
- package/dist/chunks/{theme.provider-Cl9_chOv.js → theme.provider-CvuSdLO6.js} +963 -1625
- package/dist/chunks/theme.provider-CvuSdLO6.js.map +1 -0
- package/dist/chunks/theme.provider-DwwXiHZn.js +28 -0
- package/dist/chunks/theme.provider-DwwXiHZn.js.map +1 -0
- package/dist/chunks/timePicker.component-BCMX6aqb.js +220 -0
- package/dist/chunks/timePicker.component-BCMX6aqb.js.map +1 -0
- package/dist/chunks/timePicker.component-D5hw80VV.js +2 -0
- package/dist/chunks/timePicker.component-D5hw80VV.js.map +1 -0
- package/dist/chunks/{timeRange.component-oc3ptJ_N.js → timeRange.component-BZHpZeAX.js} +2 -2
- package/dist/chunks/timeRange.component-BZHpZeAX.js.map +1 -0
- package/dist/chunks/{timeRange.component-LBzKy8H3.js → timeRange.component-D3Db8lvh.js} +2 -2
- package/dist/chunks/timeRange.component-D3Db8lvh.js.map +1 -0
- package/dist/chunks/{withFormControl-08PrhcOk.js → withFormControl-DW9A6BSL.js} +2 -2
- package/dist/chunks/{withFormControl-08PrhcOk.js.map → withFormControl-DW9A6BSL.js.map} +1 -1
- package/dist/chunks/withFormControl-QV_Jridv.js +2 -0
- package/dist/chunks/{withFormControl-BSlIlVY0.js.map → withFormControl-QV_Jridv.js.map} +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/Calendar/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/DateTimePicker/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/NumberInput/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/Rating/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/hooks/useBreakpoint/index.cjs.map +1 -1
- package/dist/cjs/hooks/useDeviceType/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/index.cjs +1 -1
- package/dist/cjs/theme/semanticTokens/index.cjs +1 -1
- package/dist/cjs/theme/semanticTokens/index.cjs.map +1 -1
- package/dist/cjs/theme/tokens/blurs/index.cjs +1 -1
- package/dist/cjs/theme/tokens/blurs/index.cjs.map +1 -1
- package/dist/cjs/theme/tokens/borders/index.cjs +1 -1
- package/dist/cjs/theme/tokens/borders/index.cjs.map +1 -1
- package/dist/cjs/theme/tokens/colors/index.cjs.map +1 -1
- package/dist/cjs/theme/tokens/index.cjs +1 -1
- package/dist/cjs/theme/tokens/shadows/index.cjs +1 -1
- package/dist/cjs/theme/tokens/shadows/index.cjs.map +1 -1
- package/dist/cjs/theme/tokens/sizes/index.cjs +1 -1
- package/dist/cjs/theme/tokens/sizes/index.cjs.map +1 -1
- package/dist/cjs/theme/tokens/spacing/index.cjs +1 -1
- package/dist/cjs/theme/tokens/spacing/index.cjs.map +1 -1
- package/dist/cjs/theme/tokens/transitions/index.cjs +1 -1
- package/dist/cjs/theme/tokens/transitions/index.cjs.map +1 -1
- package/dist/cjs/theme/tokens/typography/index.cjs +1 -1
- package/dist/cjs/theme/tokens/typography/index.cjs.map +1 -1
- package/dist/cjs/theme/tokens/zIndices/index.cjs +1 -1
- package/dist/cjs/theme/tokens/zIndices/index.cjs.map +1 -1
- package/dist/esm/components/AvatarGroup/index.js +1 -1
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/Calendar/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 +2 -2
- package/dist/esm/components/DateTimePicker/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/NumberInput/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/Rating/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 +22 -22
- package/dist/esm/hooks/useBreakpoint/index.js.map +1 -1
- package/dist/esm/hooks/useDeviceType/index.js.map +1 -1
- package/dist/esm/index.js +23 -23
- package/dist/esm/theme/index.js +1 -1
- package/dist/esm/theme/semanticTokens/index.js +10 -4
- package/dist/esm/theme/semanticTokens/index.js.map +1 -1
- package/dist/esm/theme/tokens/blurs/index.js +13 -1
- package/dist/esm/theme/tokens/blurs/index.js.map +1 -1
- package/dist/esm/theme/tokens/borders/index.js +22 -1
- package/dist/esm/theme/tokens/borders/index.js.map +1 -1
- package/dist/esm/theme/tokens/colors/index.js.map +1 -1
- package/dist/esm/theme/tokens/index.js +26 -2
- package/dist/esm/theme/tokens/index.js.map +1 -1
- package/dist/esm/theme/tokens/shadows/index.js +55 -1
- package/dist/esm/theme/tokens/shadows/index.js.map +1 -1
- package/dist/esm/theme/tokens/sizes/index.js +28 -1
- package/dist/esm/theme/tokens/sizes/index.js.map +1 -1
- package/dist/esm/theme/tokens/spacing/index.js +38 -1
- package/dist/esm/theme/tokens/spacing/index.js.map +1 -1
- package/dist/esm/theme/tokens/transitions/index.js +17 -1
- package/dist/esm/theme/tokens/transitions/index.js.map +1 -1
- package/dist/esm/theme/tokens/typography/index.js +53 -1
- package/dist/esm/theme/tokens/typography/index.js.map +1 -1
- package/dist/esm/theme/tokens/zIndices/index.js +19 -1
- package/dist/esm/theme/tokens/zIndices/index.js.map +1 -1
- package/dist/types/components/DatePicker/context/datePicker.provider.d.ts +1 -2
- package/dist/types/components/Heading/heading.recipe.d.ts +1 -1
- package/dist/types/components/Link/link.recipe.d.ts +1 -1
- package/dist/types/components/Rating/rating.component.d.ts +1 -1
- package/dist/types/components/Text/text.recipe.d.ts +1 -1
- package/dist/types/components/TimePicker/timePicker.component.d.ts +1 -2
- package/dist/types/components/TimeRange/timeRange.component.d.ts +0 -1
- package/dist/types/theme/semanticTokens/aliasPurpose.records.d.ts +1 -1
- package/dist/types/theme/semanticTokens/index.d.ts +1 -2
- package/dist/types/theme/semanticTokens/semanticTokens.config.d.ts +37 -37
- package/dist/types/theme/semanticTokens/utils/flattenSemanticTokenRecord.d.ts +1 -1
- package/dist/types/theme/semanticTokens/utils/getSemanticColorToken.d.ts +1 -1
- package/dist/types/theme/tokens/blurs/index.d.ts +1 -1
- package/dist/types/theme/tokens/borders/index.d.ts +1 -1
- package/dist/types/theme/tokens/colors/colors.config.d.ts +1 -1
- package/dist/types/theme/tokens/colors/index.d.ts +1 -2
- package/dist/types/theme/tokens/shadows/index.d.ts +1 -1
- package/dist/types/theme/tokens/sizes/index.d.ts +1 -1
- package/dist/types/theme/tokens/spacing/index.d.ts +1 -1
- package/dist/types/theme/tokens/spacing/spacing.config.d.ts +2 -2
- package/dist/types/theme/tokens/transitions/index.d.ts +1 -1
- package/dist/types/theme/tokens/typography/index.d.ts +1 -1
- package/dist/types/theme/tokens/zIndices/index.d.ts +1 -1
- package/package.json +6 -3
- package/dist/chunks/datePicker.provider-B7-cWUkv.js +0 -15
- package/dist/chunks/invertToken-DkyAF_BY.js +0 -10
- package/dist/chunks/invertToken-DkyAF_BY.js.map +0 -1
- package/dist/chunks/invertToken-Em3s32gh.js +0 -2
- package/dist/chunks/invertToken-Em3s32gh.js.map +0 -1
- package/dist/chunks/rating.component-CQgpD-gS.js.map +0 -1
- package/dist/chunks/rating.component-FYKS_NCl.js.map +0 -1
- package/dist/chunks/theme.provider-BWhqnOFC.js +0 -28
- package/dist/chunks/theme.provider-BWhqnOFC.js.map +0 -1
- package/dist/chunks/theme.provider-Cl9_chOv.js.map +0 -1
- package/dist/chunks/timePicker.component-DIUqae3b.js +0 -2
- package/dist/chunks/timePicker.component-DIUqae3b.js.map +0 -1
- package/dist/chunks/timePicker.component-Dl3BE6eW.js +0 -230
- package/dist/chunks/timePicker.component-Dl3BE6eW.js.map +0 -1
- package/dist/chunks/timeRange.component-LBzKy8H3.js.map +0 -1
- package/dist/chunks/timeRange.component-oc3ptJ_N.js.map +0 -1
- package/dist/chunks/typography.records-BEd2lI_g.js +0 -54
- package/dist/chunks/typography.records-BEd2lI_g.js.map +0 -1
- package/dist/chunks/typography.records-Cg_lT1Z3.js +0 -2
- package/dist/chunks/typography.records-Cg_lT1Z3.js.map +0 -1
- package/dist/chunks/withFormControl-BSlIlVY0.js +0 -2
- package/dist/types/theme/semanticTokens/semanticTokens.records.d.ts +0 -419
- package/dist/types/theme/semanticTokens/semanticTokens.types.d.ts +0 -17
- package/dist/types/theme/semanticTokens/utils/invertToken.d.ts +0 -2
- package/dist/types/theme/tokens/blurs/blurs.records.d.ts +0 -2
- package/dist/types/theme/tokens/blurs/blurs.types.d.ts +0 -1
- package/dist/types/theme/tokens/borders/borders.records.d.ts +0 -3
- package/dist/types/theme/tokens/borders/borders.types.d.ts +0 -2
- package/dist/types/theme/tokens/colors/colors.records.d.ts +0 -2
- package/dist/types/theme/tokens/colors/colors.types.d.ts +0 -2
- package/dist/types/theme/tokens/shadows/shadows.records.d.ts +0 -6
- package/dist/types/theme/tokens/shadows/shadows.types.d.ts +0 -2
- package/dist/types/theme/tokens/sizes/sizes.records.d.ts +0 -3
- package/dist/types/theme/tokens/sizes/sizes.types.d.ts +0 -2
- package/dist/types/theme/tokens/spacing/spacing.records.d.ts +0 -2
- package/dist/types/theme/tokens/spacing/spacing.types.d.ts +0 -1
- package/dist/types/theme/tokens/transitions/transitions.records.d.ts +0 -3
- package/dist/types/theme/tokens/transitions/transitions.types.d.ts +0 -2
- package/dist/types/theme/tokens/typography/typography.records.d.ts +0 -6
- package/dist/types/theme/tokens/typography/typography.types.d.ts +0 -5
- package/dist/types/theme/tokens/zIndices/zIndices.records.d.ts +0 -2
- package/dist/types/theme/tokens/zIndices/zIndices.types.d.ts +0 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import { useCallback as b, useRef as J, useEffect as T, useState as k, useMemo as R } from "react";
|
|
3
|
+
import { W as K } from "./textInput.component-BeiTxTkS.js";
|
|
4
|
+
import { P as Q } from "./popover.component-DIYT1Lc0.js";
|
|
5
|
+
import { I as U } from "./icon.component-PV_nHBId.js";
|
|
6
|
+
import { u as X } from "./useIconTextSizeMap-BK-pUrQv.js";
|
|
7
|
+
import { f as Z } from "./format-CqTHHSak.js";
|
|
8
|
+
import { B as S } from "./index-9BerxEcw.js";
|
|
9
|
+
import { a as ee, d as te } from "./config-Djkl1N81.js";
|
|
10
|
+
import { u as re } from "./use-recipe-d63ABaZ3.js";
|
|
11
|
+
import { u as V } from "./create-slot-recipe-context-D_FXDJGp.js";
|
|
12
|
+
const se = ee({
|
|
13
|
+
base: {
|
|
14
|
+
borderRadius: "4px",
|
|
15
|
+
cursor: "pointer",
|
|
16
|
+
fontSize: "sm",
|
|
17
|
+
px: 3,
|
|
18
|
+
py: 1,
|
|
19
|
+
textAlign: "center"
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
selected: {
|
|
23
|
+
true: {
|
|
24
|
+
background: "background.secondary",
|
|
25
|
+
color: "text.contrast",
|
|
26
|
+
_hover: {
|
|
27
|
+
background: "background.secondary.hover"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
false: {
|
|
31
|
+
background: "background",
|
|
32
|
+
color: "text.subtle",
|
|
33
|
+
_hover: {
|
|
34
|
+
background: "background.secondaryAlpha.hover"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
selected: !1
|
|
41
|
+
}
|
|
42
|
+
}), oe = ({
|
|
43
|
+
value: t,
|
|
44
|
+
innerRef: i,
|
|
45
|
+
onClick: n,
|
|
46
|
+
selected: l,
|
|
47
|
+
["data-testid"]: u = "kibble-timepicker-option"
|
|
48
|
+
}) => {
|
|
49
|
+
const a = re({ recipe: se })({ selected: l }), x = b(
|
|
50
|
+
(c) => {
|
|
51
|
+
const r = c.currentTarget.textContent || "";
|
|
52
|
+
n(r);
|
|
53
|
+
},
|
|
54
|
+
[n]
|
|
55
|
+
);
|
|
56
|
+
return /* @__PURE__ */ o.jsx(S, { className: "TimePicker__Option", "data-testid": u, ref: i, onClick: x, css: a, children: t });
|
|
57
|
+
}, z = te({
|
|
58
|
+
slots: ["trigger", "container", "list"],
|
|
59
|
+
base: {
|
|
60
|
+
trigger: {
|
|
61
|
+
width: "100%"
|
|
62
|
+
},
|
|
63
|
+
container: {
|
|
64
|
+
display: "flex",
|
|
65
|
+
gap: 1.5,
|
|
66
|
+
height: "186px",
|
|
67
|
+
overflow: "hidden"
|
|
68
|
+
},
|
|
69
|
+
list: {
|
|
70
|
+
display: "flex",
|
|
71
|
+
flexDirection: "column",
|
|
72
|
+
gap: 1,
|
|
73
|
+
overflowY: "auto",
|
|
74
|
+
"&::webkit-scrollbar": {
|
|
75
|
+
display: "none"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}), C = ({
|
|
80
|
+
options: t,
|
|
81
|
+
optionType: i,
|
|
82
|
+
selectedValue: n,
|
|
83
|
+
onClick: l,
|
|
84
|
+
open: u = !1,
|
|
85
|
+
["data-testid"]: f = "kibble-timepicker-list"
|
|
86
|
+
}) => {
|
|
87
|
+
const x = V({ recipe: z })(), c = J(null);
|
|
88
|
+
return T(() => {
|
|
89
|
+
u && c.current && requestAnimationFrame(() => {
|
|
90
|
+
c.current && c.current.scrollIntoView({ block: "center" });
|
|
91
|
+
});
|
|
92
|
+
}, [u, n]), /* @__PURE__ */ o.jsx(S, { className: "TimePicker__List", "data-testid": `${f}-${i}-list`, css: x.list, children: t.map((r) => {
|
|
93
|
+
const A = r === n;
|
|
94
|
+
return /* @__PURE__ */ o.jsx(
|
|
95
|
+
oe,
|
|
96
|
+
{
|
|
97
|
+
innerRef: A ? c : null,
|
|
98
|
+
value: r,
|
|
99
|
+
selected: r === n,
|
|
100
|
+
onClick: l,
|
|
101
|
+
"data-testid": `${f}-${i}-option-${r}`
|
|
102
|
+
},
|
|
103
|
+
`${i}-option-${r}`
|
|
104
|
+
);
|
|
105
|
+
}) });
|
|
106
|
+
};
|
|
107
|
+
var d = /* @__PURE__ */ ((t) => (t.AM = "AM", t.PM = "PM", t))(d || {});
|
|
108
|
+
const he = ({
|
|
109
|
+
initialTime: t,
|
|
110
|
+
inputProps: i,
|
|
111
|
+
minuteInterval: n = 5,
|
|
112
|
+
onTimeChange: l,
|
|
113
|
+
onClose: u,
|
|
114
|
+
placement: f = "bottom",
|
|
115
|
+
["data-testid"]: a = "kibble-timepicker"
|
|
116
|
+
}) => {
|
|
117
|
+
const c = V({ recipe: z })(), [r, A] = k(!1), [M, O] = k(t), [g, _] = k(), [m, $] = k(), [h, y] = k(), D = R(() => M ? Z(M, "h:mm aa") : "", [M]), v = (e) => {
|
|
118
|
+
const s = e.toString();
|
|
119
|
+
return s.length === 1 ? `0${s}` : s;
|
|
120
|
+
}, E = R(() => [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((e) => e.toString()), []), B = R(() => {
|
|
121
|
+
const e = [];
|
|
122
|
+
for (let s = 0; s < 60; s += n)
|
|
123
|
+
e.push(s);
|
|
124
|
+
return e.map(v);
|
|
125
|
+
}, [n]), L = [d.AM, d.PM], p = b(
|
|
126
|
+
(e, s, j) => {
|
|
127
|
+
const P = e || "12", Y = s || "00", N = j || "AM";
|
|
128
|
+
let w = 0;
|
|
129
|
+
e || _("12"), s || $("00"), j || y("AM"), N === d.PM && Number(P) < 12 && (w = 12), N === d.AM && Number(P) === 12 && (w = -12);
|
|
130
|
+
const G = Number(P) + w, I = (/* @__PURE__ */ new Date()).setHours(G, Number(Y), 0, 0), H = new Date(I);
|
|
131
|
+
O(H), l && l(H);
|
|
132
|
+
},
|
|
133
|
+
[l]
|
|
134
|
+
), W = b(
|
|
135
|
+
(e) => {
|
|
136
|
+
_(e), p(e, m, h);
|
|
137
|
+
},
|
|
138
|
+
[p, h, m]
|
|
139
|
+
), q = b(
|
|
140
|
+
(e) => {
|
|
141
|
+
$(e), p(g, e, h);
|
|
142
|
+
},
|
|
143
|
+
[p, g, h]
|
|
144
|
+
), F = b(
|
|
145
|
+
(e) => {
|
|
146
|
+
y(e), p(g, m, e);
|
|
147
|
+
},
|
|
148
|
+
[p, g, m]
|
|
149
|
+
);
|
|
150
|
+
return T(() => {
|
|
151
|
+
if (t) {
|
|
152
|
+
const e = new Date(t), j = e.getHours() % 12 || 12;
|
|
153
|
+
O(t), _(j.toString()), $(e.getMinutes().toString()), y(e.getHours() > 11 ? d.PM : d.AM);
|
|
154
|
+
}
|
|
155
|
+
}, [t]), /* @__PURE__ */ o.jsx(
|
|
156
|
+
Q,
|
|
157
|
+
{
|
|
158
|
+
open: r,
|
|
159
|
+
onOpenChange: ({ open: e }) => {
|
|
160
|
+
A(e), !e && u && u(M);
|
|
161
|
+
},
|
|
162
|
+
anchor: /* @__PURE__ */ o.jsx(S, { className: "TimePicker__Trigger", "data-testid": `${a}-trigger`, css: c.trigger, children: /* @__PURE__ */ o.jsx(
|
|
163
|
+
K,
|
|
164
|
+
{
|
|
165
|
+
placeholder: "12:00 AM",
|
|
166
|
+
rightElement: /* @__PURE__ */ o.jsx(U, { size: X(i?.size || "md"), name: "clock" }),
|
|
167
|
+
value: D,
|
|
168
|
+
readOnly: !0,
|
|
169
|
+
cursor: "pointer",
|
|
170
|
+
...i,
|
|
171
|
+
...r && { "data-focus": "true" }
|
|
172
|
+
}
|
|
173
|
+
) }),
|
|
174
|
+
contentProps: { w: "max-content" },
|
|
175
|
+
placement: f,
|
|
176
|
+
variant: i?.onContrast ? "contrast" : "default",
|
|
177
|
+
showArrow: !1,
|
|
178
|
+
children: /* @__PURE__ */ o.jsxs(S, { className: "TimePicker__Container", "data-testid": `${a}-container`, css: c.container, children: [
|
|
179
|
+
/* @__PURE__ */ o.jsx(
|
|
180
|
+
C,
|
|
181
|
+
{
|
|
182
|
+
options: E,
|
|
183
|
+
optionType: "hour",
|
|
184
|
+
selectedValue: g,
|
|
185
|
+
onClick: W,
|
|
186
|
+
open: r,
|
|
187
|
+
"data-testid": `${a}-hour-list`
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/* @__PURE__ */ o.jsx(
|
|
191
|
+
C,
|
|
192
|
+
{
|
|
193
|
+
options: B,
|
|
194
|
+
optionType: "minute",
|
|
195
|
+
selectedValue: m ? v(m) : void 0,
|
|
196
|
+
onClick: q,
|
|
197
|
+
open: r,
|
|
198
|
+
"data-testid": `${a}-minute-list`
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ o.jsx(
|
|
202
|
+
C,
|
|
203
|
+
{
|
|
204
|
+
options: L,
|
|
205
|
+
optionType: "meridiem",
|
|
206
|
+
selectedValue: h,
|
|
207
|
+
onClick: F,
|
|
208
|
+
open: r,
|
|
209
|
+
"data-testid": `${a}-meridiem-list`
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
] })
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
export {
|
|
217
|
+
d as M,
|
|
218
|
+
he as T
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=timePicker.component-BCMX6aqb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timePicker.component-BCMX6aqb.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 /** Ref to the option component. */\n innerRef?: React.Ref<HTMLDivElement | null> | null;\n /** Callback function to be called when the option is clicked. */\n onClick: (selectedValue: string) => void;\n /** If true, the option will be selected. */\n selected: boolean;\n /** Value of the option. */\n value: string;\n /** Data test id for the option.\n * @default kibble-timepicker-option\n */\n 'data-testid'?: string;\n}\n\nexport const TimeOption = ({\n value,\n innerRef,\n onClick,\n selected,\n ['data-testid']: dataTestId = 'kibble-timepicker-option',\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 className=\"TimePicker__Option\" data-testid={dataTestId} ref={innerRef} onClick={handleClick} css={styles}>\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 to display in the list. */\n options: string[];\n /** Type of the option. */\n optionType: 'hour' | 'minute' | 'meridiem';\n /** Selected value of the list. */\n selectedValue?: string;\n /** Callback function to be called when the option is clicked. */\n onClick: (value: string) => void;\n /** Determines if the list is open. */\n open: boolean;\n /** Data test id for the list.\n * @default kibble-timepicker-list\n */\n 'data-testid'?: string;\n}\n\nexport const TimeList = ({\n options,\n optionType,\n selectedValue,\n onClick,\n open = false,\n ['data-testid']: dataTestId = 'kibble-timepicker-list',\n}: ScrollContainerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: timePickerRecipe });\n const styles = recipe();\n const itemRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (open && itemRef.current) {\n requestAnimationFrame(() => {\n if (itemRef.current) {\n itemRef.current.scrollIntoView({ block: 'center' });\n }\n });\n }\n }, [open, selectedValue]);\n\n return (\n <Box className=\"TimePicker__List\" data-testid={`${dataTestId}-${optionType}-list`} css={styles.list}>\n {options.map((option) => {\n const isSelected = option === selectedValue;\n return (\n <TimeOption\n key={`${optionType}-option-${option}`}\n innerRef={isSelected ? itemRef : null}\n value={option}\n selected={option === selectedValue}\n onClick={onClick}\n data-testid={`${dataTestId}-${optionType}-option-${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 { TextInput, TextInputProps } 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 /** Initial time to be displayed in the input field. */\n initialTime?: Date;\n /** Props to customize the input field. See `TextInput` for more information. */\n inputProps?: Omit<TextInputProps, 'onChange' | 'value' | 'isClearable' | 'onClear'>;\n /**\n * Interval of minutes to be displayed in the dropdown.\n * @default 5\n */\n minuteInterval?: number;\n /** Callback function triggered when the time is changed. */\n onTimeChange?: (time: Date) => void;\n /** Callback function triggered when the time picker is closed. */\n onClose?: (time?: Date) => void;\n /**\n * Placement of the dropdown relative to the input field.\n * @default bottom\n */\n placement?: Placement;\n /**\n * Data test id for the time picker.\n * @default kibble-timepicker\n */\n 'data-testid'?: string;\n}\n\nexport const TimePicker = ({\n initialTime,\n inputProps,\n minuteInterval = 5,\n onTimeChange,\n onClose,\n placement = 'bottom',\n ['data-testid']: dataTestId = 'kibble-timepicker',\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<string | undefined>();\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) => hour.toString());\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(localTime.getHours() > 11 ? Meridiem.PM : Meridiem.AM);\n }\n }, [initialTime]);\n\n return (\n <Popover\n open={isOpen}\n onOpenChange={({ open }) => {\n setIsOpen(open);\n if (!open && onClose) {\n onClose(selectedTime);\n }\n }}\n anchor={\n <Box className=\"TimePicker__Trigger\" data-testid={`${dataTestId}-trigger`} css={styles.trigger}>\n <TextInput\n placeholder=\"12:00 AM\"\n rightElement={<Icon size={useIconTextSizeMap(inputProps?.size || 'md')} name=\"clock\" />}\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 placement={placement}\n variant={inputProps?.onContrast ? 'contrast' : 'default'}\n showArrow={false}\n >\n <Box className=\"TimePicker__Container\" data-testid={`${dataTestId}-container`} css={styles.container}>\n <TimeList\n options={hourOptions}\n optionType=\"hour\"\n selectedValue={selectedHour}\n onClick={handleHourClick}\n open={isOpen}\n data-testid={`${dataTestId}-hour-list`}\n />\n <TimeList\n options={minuteOptions}\n optionType=\"minute\"\n selectedValue={selectedMinute ? formatNumber(selectedMinute) : undefined}\n onClick={handleMinuteClick}\n open={isOpen}\n data-testid={`${dataTestId}-minute-list`}\n />\n <TimeList\n options={meridiemOptions}\n optionType=\"meridiem\"\n selectedValue={selectedMeridiem}\n onClick={handleMeridiemClick}\n open={isOpen}\n data-testid={`${dataTestId}-meridiem-list`}\n />\n </Box>\n </Popover>\n );\n};\n"],"names":["timeOptionRecipe","defineRecipe","TimeOption","value","innerRef","onClick","selected","dataTestId","styles","useRecipe","handleClick","useCallback","event","selectedValue","jsx","Box","timePickerRecipe","defineSlotRecipe","TimeList","options","optionType","open","useSlotRecipe","itemRef","useRef","useEffect","option","isSelected","Meridiem","TimePicker","initialTime","inputProps","minuteInterval","onTimeChange","onClose","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","local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A,UAAA;AAAA,YACC,SAASqC;AAAA,YACT,YAAW;AAAA,YACX,eAAeZ,IAAiBO,EAAaP,CAAc,IAAI;AAAA,YAC/D,SAAS2B;AAAA,YACT,MAAMlC;AAAA,YACN,eAAa,GAAG7B,CAAU;AAAA,UAAA;AAAA,QAC5B;AAAA,QACAO,gBAAAA,EAAA;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,SAASwC;AAAA,YACT,YAAW;AAAA,YACX,eAAeb;AAAA,YACf,SAAS0B;AAAA,YACT,MAAMnC;AAAA,YACN,eAAa,GAAG7B,CAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MAC5B,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),t=require("react"),Y=require("./textInput.component-CwTc0h_F.js"),G=require("./popover.component-DTjA1GSd.js"),J=require("./icon.component-B1hr5lLa.js"),K=require("./useIconTextSizeMap-BXmABb54.js"),Q=require("./format-CK7Imh-5.js"),j=require("./index-BQRnVsAg.js"),v=require("./config-jChwZPSv.js"),U=require("./use-recipe-DaPWl_pL.js"),O=require("./create-slot-recipe-context-HXE1VazG.js"),X=v.defineRecipe({base:{borderRadius:"4px",cursor:"pointer",fontSize:"sm",px:3,py:1,textAlign:"center"},variants:{selected:{true:{background:"background.secondary",color:"text.contrast",_hover:{background:"background.secondary.hover"}},false:{background:"background",color:"text.subtle",_hover:{background:"background.secondaryAlpha.hover"}}}},defaultVariants:{selected:!1}}),Z=({value:s,innerRef:i,onClick:c,selected:d,["data-testid"]:m="kibble-timepicker-option"})=>{const a=U.useRecipe({recipe:X})({selected:d}),b=t.useCallback(u=>{const r=u.currentTarget.textContent||"";c(r)},[c]);return n.jsxRuntimeExports.jsx(j.Box,{className:"TimePicker__Option","data-testid":m,ref:i,onClick:b,css:a,children:s})},N=v.defineSlotRecipe({slots:["trigger","container","list"],base:{trigger:{width:"100%"},container:{display:"flex",gap:1.5,height:"186px",overflow:"hidden"},list:{display:"flex",flexDirection:"column",gap:1,overflowY:"auto","&::webkit-scrollbar":{display:"none"}}}}),$=({options:s,optionType:i,selectedValue:c,onClick:d,open:m=!1,["data-testid"]:f="kibble-timepicker-list"})=>{const b=O.useSlotRecipe({recipe:N})(),u=t.useRef(null);return t.useEffect(()=>{m&&u.current&&requestAnimationFrame(()=>{u.current&&u.current.scrollIntoView({block:"center"})})},[m,c]),n.jsxRuntimeExports.jsx(j.Box,{className:"TimePicker__List","data-testid":`${f}-${i}-list`,css:b.list,children:s.map(r=>{const M=r===c;return n.jsxRuntimeExports.jsx(Z,{innerRef:M?u:null,value:r,selected:r===c,onClick:d,"data-testid":`${f}-${i}-option-${r}`},`${i}-option-${r}`)})})};var l=(s=>(s.AM="AM",s.PM="PM",s))(l||{});const ee=({initialTime:s,inputProps:i,minuteInterval:c=5,onTimeChange:d,onClose:m,placement:f="bottom",["data-testid"]:a="kibble-timepicker"})=>{const u=O.useSlotRecipe({recipe:N})(),[r,M]=t.useState(!1),[h,q]=t.useState(s),[k,S]=t.useState(),[p,_]=t.useState(),[g,C]=t.useState(),T=t.useMemo(()=>h?Q.format(h,"h:mm aa"):"",[h]),y=e=>{const o=e.toString();return o.length===1?`0${o}`:o},H=t.useMemo(()=>[12,1,2,3,4,5,6,7,8,9,10,11].map(e=>e.toString()),[]),z=t.useMemo(()=>{const e=[];for(let o=0;o<60;o+=c)e.push(o);return e.map(y)},[c]),V=[l.AM,l.PM],x=t.useCallback((e,o,R)=>{const E=e||"12",F=o||"00",P=R||"AM";let A=0;e||S("12"),o||_("00"),R||C("AM"),P===l.PM&&Number(E)<12&&(A=12),P===l.AM&&Number(E)===12&&(A=-12);const I=Number(E)+A,W=new Date().setHours(I,Number(F),0,0),w=new Date(W);q(w),d&&d(w)},[d]),B=t.useCallback(e=>{S(e),x(e,p,g)},[x,g,p]),D=t.useCallback(e=>{_(e),x(k,e,g)},[x,k,g]),L=t.useCallback(e=>{C(e),x(k,p,e)},[x,k,p]);return t.useEffect(()=>{if(s){const e=new Date(s),R=e.getHours()%12||12;q(s),S(R.toString()),_(e.getMinutes().toString()),C(e.getHours()>11?l.PM:l.AM)}},[s]),n.jsxRuntimeExports.jsx(G.Popover,{open:r,onOpenChange:({open:e})=>{M(e),!e&&m&&m(h)},anchor:n.jsxRuntimeExports.jsx(j.Box,{className:"TimePicker__Trigger","data-testid":`${a}-trigger`,css:u.trigger,children:n.jsxRuntimeExports.jsx(Y.WrappedTextInput,{placeholder:"12:00 AM",rightElement:n.jsxRuntimeExports.jsx(J.Icon,{size:K.useIconTextSizeMap(i?.size||"md"),name:"clock"}),value:T,readOnly:!0,cursor:"pointer",...i,...r&&{"data-focus":"true"}})}),contentProps:{w:"max-content"},placement:f,variant:i?.onContrast?"contrast":"default",showArrow:!1,children:n.jsxRuntimeExports.jsxs(j.Box,{className:"TimePicker__Container","data-testid":`${a}-container`,css:u.container,children:[n.jsxRuntimeExports.jsx($,{options:H,optionType:"hour",selectedValue:k,onClick:B,open:r,"data-testid":`${a}-hour-list`}),n.jsxRuntimeExports.jsx($,{options:z,optionType:"minute",selectedValue:p?y(p):void 0,onClick:D,open:r,"data-testid":`${a}-minute-list`}),n.jsxRuntimeExports.jsx($,{options:V,optionType:"meridiem",selectedValue:g,onClick:L,open:r,"data-testid":`${a}-meridiem-list`})]})})};exports.Meridiem=l;exports.TimePicker=ee;
|
|
2
|
+
//# sourceMappingURL=timePicker.component-D5hw80VV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timePicker.component-D5hw80VV.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 /** Ref to the option component. */\n innerRef?: React.Ref<HTMLDivElement | null> | null;\n /** Callback function to be called when the option is clicked. */\n onClick: (selectedValue: string) => void;\n /** If true, the option will be selected. */\n selected: boolean;\n /** Value of the option. */\n value: string;\n /** Data test id for the option.\n * @default kibble-timepicker-option\n */\n 'data-testid'?: string;\n}\n\nexport const TimeOption = ({\n value,\n innerRef,\n onClick,\n selected,\n ['data-testid']: dataTestId = 'kibble-timepicker-option',\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 className=\"TimePicker__Option\" data-testid={dataTestId} ref={innerRef} onClick={handleClick} css={styles}>\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 to display in the list. */\n options: string[];\n /** Type of the option. */\n optionType: 'hour' | 'minute' | 'meridiem';\n /** Selected value of the list. */\n selectedValue?: string;\n /** Callback function to be called when the option is clicked. */\n onClick: (value: string) => void;\n /** Determines if the list is open. */\n open: boolean;\n /** Data test id for the list.\n * @default kibble-timepicker-list\n */\n 'data-testid'?: string;\n}\n\nexport const TimeList = ({\n options,\n optionType,\n selectedValue,\n onClick,\n open = false,\n ['data-testid']: dataTestId = 'kibble-timepicker-list',\n}: ScrollContainerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: timePickerRecipe });\n const styles = recipe();\n const itemRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (open && itemRef.current) {\n requestAnimationFrame(() => {\n if (itemRef.current) {\n itemRef.current.scrollIntoView({ block: 'center' });\n }\n });\n }\n }, [open, selectedValue]);\n\n return (\n <Box className=\"TimePicker__List\" data-testid={`${dataTestId}-${optionType}-list`} css={styles.list}>\n {options.map((option) => {\n const isSelected = option === selectedValue;\n return (\n <TimeOption\n key={`${optionType}-option-${option}`}\n innerRef={isSelected ? itemRef : null}\n value={option}\n selected={option === selectedValue}\n onClick={onClick}\n data-testid={`${dataTestId}-${optionType}-option-${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 { TextInput, TextInputProps } 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 /** Initial time to be displayed in the input field. */\n initialTime?: Date;\n /** Props to customize the input field. See `TextInput` for more information. */\n inputProps?: Omit<TextInputProps, 'onChange' | 'value' | 'isClearable' | 'onClear'>;\n /**\n * Interval of minutes to be displayed in the dropdown.\n * @default 5\n */\n minuteInterval?: number;\n /** Callback function triggered when the time is changed. */\n onTimeChange?: (time: Date) => void;\n /** Callback function triggered when the time picker is closed. */\n onClose?: (time?: Date) => void;\n /**\n * Placement of the dropdown relative to the input field.\n * @default bottom\n */\n placement?: Placement;\n /**\n * Data test id for the time picker.\n * @default kibble-timepicker\n */\n 'data-testid'?: string;\n}\n\nexport const TimePicker = ({\n initialTime,\n inputProps,\n minuteInterval = 5,\n onTimeChange,\n onClose,\n placement = 'bottom',\n ['data-testid']: dataTestId = 'kibble-timepicker',\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<string | undefined>();\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) => hour.toString());\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(localTime.getHours() > 11 ? Meridiem.PM : Meridiem.AM);\n }\n }, [initialTime]);\n\n return (\n <Popover\n open={isOpen}\n onOpenChange={({ open }) => {\n setIsOpen(open);\n if (!open && onClose) {\n onClose(selectedTime);\n }\n }}\n anchor={\n <Box className=\"TimePicker__Trigger\" data-testid={`${dataTestId}-trigger`} css={styles.trigger}>\n <TextInput\n placeholder=\"12:00 AM\"\n rightElement={<Icon size={useIconTextSizeMap(inputProps?.size || 'md')} name=\"clock\" />}\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 placement={placement}\n variant={inputProps?.onContrast ? 'contrast' : 'default'}\n showArrow={false}\n >\n <Box className=\"TimePicker__Container\" data-testid={`${dataTestId}-container`} css={styles.container}>\n <TimeList\n options={hourOptions}\n optionType=\"hour\"\n selectedValue={selectedHour}\n onClick={handleHourClick}\n open={isOpen}\n data-testid={`${dataTestId}-hour-list`}\n />\n <TimeList\n options={minuteOptions}\n optionType=\"minute\"\n selectedValue={selectedMinute ? formatNumber(selectedMinute) : undefined}\n onClick={handleMinuteClick}\n open={isOpen}\n data-testid={`${dataTestId}-minute-list`}\n />\n <TimeList\n options={meridiemOptions}\n optionType=\"meridiem\"\n selectedValue={selectedMeridiem}\n onClick={handleMeridiemClick}\n open={isOpen}\n data-testid={`${dataTestId}-meridiem-list`}\n />\n </Box>\n </Popover>\n );\n};\n"],"names":["timeOptionRecipe","defineRecipe","TimeOption","value","innerRef","onClick","selected","dataTestId","styles","useRecipe","handleClick","useCallback","event","selectedValue","jsx","Box","timePickerRecipe","defineSlotRecipe","TimeList","options","optionType","open","useSlotRecipe","itemRef","useRef","useEffect","option","isSelected","Meridiem","TimePicker","initialTime","inputProps","minuteInterval","onTimeChange","onClose","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":"kcAEaA,EAAmBC,EAAAA,aAAa,CAC3C,KAAM,CACJ,aAAc,MACd,OAAQ,UACR,SAAU,KACV,GAAI,EACJ,GAAI,EACJ,UAAW,QACb,EACA,SAAU,CACR,SAAU,CACR,KAAM,CACJ,WAAY,uBACZ,MAAO,gBACP,OAAQ,CACN,WAAY,4BAAA,CAEhB,EACA,MAAO,CACL,WAAY,aACZ,MAAO,cACP,OAAQ,CACN,WAAY,iCAAA,CACd,CACF,CAEJ,EACA,gBAAiB,CACf,SAAU,EAAA,CAEd,CAAC,ECZYC,EAAa,CAAC,CACzB,MAAAC,EACA,SAAAC,EACA,QAAAC,EACA,SAAAC,EACA,CAAC,eAAgBC,EAAa,0BAChC,IAA0C,CAExC,MAAMC,EADSC,EAAA,UAAU,CAAE,OAAQT,EAAkB,EAC/B,CAAE,SAAAM,EAAU,EAE5BI,EAAcC,EAAA,YACjBC,GAA4C,CACrC,MAAAC,EAAgBD,EAAM,cAAc,aAAe,GACzDP,EAAQQ,CAAa,CACvB,EACA,CAACR,CAAO,CACV,EAEA,OACGS,EAAAA,kBAAAA,IAAAC,EAAAA,IAAA,CAAI,UAAU,qBAAqB,cAAaR,EAAY,IAAKH,EAAU,QAASM,EAAa,IAAKF,EACpG,SACHL,EAAA,CAEJ,ECzCaa,EAAmBC,EAAAA,iBAAiB,CAC/C,MAAO,CAAC,UAAW,YAAa,MAAM,EACtC,KAAM,CACJ,QAAS,CACP,MAAO,MACT,EACA,UAAW,CACT,QAAS,OACT,IAAK,IACL,OAAQ,QACR,SAAU,QACZ,EACA,KAAM,CACJ,QAAS,OACT,cAAe,SACf,IAAK,EACL,UAA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,WACZ,aAAe7D,EAAA,kBAAA,IAAA8D,OAAA,CAAK,KAAMC,EAAA,mBAAmB9C,GAAY,MAAQ,IAAI,EAAG,KAAK,OAAQ,CAAA,EACrF,MAAOgB,EACP,SAAQ,GACR,OAAO,UACN,GAAGhB,EACH,GAAIK,GAAU,CAAE,aAAc,MAAO,CAAA,CAAA,EAE1C,EAEF,aAAc,CAAE,EAAG,aAAc,EACjC,UAAAD,EACA,QAASJ,GAAY,WAAa,WAAa,UAC/C,UAAW,GAEX,SAAA+C,EAAAA,kBAAAA,KAAC/D,EAAAA,IAAI,CAAA,UAAU,wBAAwB,cAAa,GAAGR,CAAU,aAAc,IAAKC,EAAO,UACzF,SAAA,CAAAM,EAAA,kBAAA,IAACI,EAAA,CACC,QAASmC,EACT,WAAW,OACX,cAAeZ,EACf,QAAS4B,EACT,KAAMjC,EACN,cAAa,GAAG7B,CAAU,YAAA,CAC5B,EACAO,EAAA,kBAAA,IAACI,EAAA,CACC,QAASqC,EACT,WAAW,SACX,cAAeZ,EAAiBO,EAAaP,CAAc,EAAI,OAC/D,QAAS2B,EACT,KAAMlC,EACN,cAAa,GAAG7B,CAAU,cAAA,CAC5B,EACAO,EAAA,kBAAA,IAACI,EAAA,CACC,QAASwC,EACT,WAAW,WACX,cAAeb,EACf,QAAS0B,EACT,KAAMnC,EACN,cAAa,GAAG7B,CAAU,gBAAA,CAAA,CAC5B,CACF,CAAA,CAAA,CACF,CAEJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { B as o } from "./index-9BerxEcw.js";
|
|
3
|
-
import { T as i } from "./timePicker.component-
|
|
3
|
+
import { T as i } from "./timePicker.component-BCMX6aqb.js";
|
|
4
4
|
import { F as n } from "./flex-CX-8gE9T.js";
|
|
5
5
|
const l = ({
|
|
6
6
|
endTimePickerProps: r,
|
|
@@ -16,4 +16,4 @@ const l = ({
|
|
|
16
16
|
export {
|
|
17
17
|
l as T
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=timeRange.component-
|
|
19
|
+
//# sourceMappingURL=timeRange.component-BZHpZeAX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeRange.component-BZHpZeAX.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 { TimePicker, TimePickerProps } from 'components/TimePicker/timePicker.component';\n\nexport interface TimeRangeProps extends FlexProps {\n /**\n * Element that separates the start and end time pickers. By default, a dash is used.\n * @default -\n */\n separator?: React.ReactNode;\n /** Props for the end time picker. See `TimePicker` for more information. */\n endTimePickerProps: TimePickerProps;\n /** Props for the start time picker. See `TimePicker` for more information. */\n startTimePickerProps: TimePickerProps;\n /**\n * Data test id for the time range.\n * @default kibble-time-range\n */\n 'data-testid'?: string;\n}\n\nexport const TimeRange = ({\n endTimePickerProps,\n separator = '-',\n startTimePickerProps,\n ['data-testid']: dataTestId = 'kibble-time-range',\n ...rest\n}: TimeRangeProps): React.JSX.Element => {\n return (\n <Flex className=\"TimeRange\" data-testid={dataTestId} {...rest}>\n <TimePicker {...startTimePickerProps} data-testid={`${dataTestId}-start-time-picker`} />\n <Box alignSelf=\"center\" mx={1}>\n {separator}\n </Box>\n <TimePicker {...endTimePickerProps} data-testid={`${dataTestId}-end-time-picker`} />\n </Flex>\n );\n};\n"],"names":["TimeRange","endTimePickerProps","separator","startTimePickerProps","dataTestId","rest","Flex","jsx","TimePicker","Box"],"mappings":";;;;AAsBO,MAAMA,IAAY,CAAC;AAAA,EACxB,oBAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,sBAAAC;AAAA,EACA,CAAC,gBAAgBC,IAAa;AAAA,EAC9B,GAAGC;AACL,6BAEKC,GAAK,EAAA,WAAU,aAAY,eAAaF,GAAa,GAAGC,GACvD,UAAA;AAAA,EAAAE,gBAAAA,MAACC,KAAY,GAAGL,GAAsB,eAAa,GAAGC,CAAU,sBAAsB;AAAA,wBACrFK,GAAI,EAAA,WAAU,UAAS,IAAI,GACzB,UACHP,GAAA;AAAA,wBACCM,GAAY,EAAA,GAAGP,GAAoB,eAAa,GAAGG,CAAU,mBAAoB,CAAA;AAAA,GACpF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BjDatQAs.js"),m=require("./index-BQRnVsAg.js"),t=require("./timePicker.component-
|
|
2
|
-
//# sourceMappingURL=timeRange.component-
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-BjDatQAs.js"),m=require("./index-BQRnVsAg.js"),t=require("./timePicker.component-D5hw80VV.js"),c=require("./flex-BOU6tYUd.js"),a=({endTimePickerProps:s,separator:r="-",startTimePickerProps:n,["data-testid"]:i="kibble-time-range",...x})=>e.jsxRuntimeExports.jsxs(c.Flex,{className:"TimeRange","data-testid":i,...x,children:[e.jsxRuntimeExports.jsx(t.TimePicker,{...n,"data-testid":`${i}-start-time-picker`}),e.jsxRuntimeExports.jsx(m.Box,{alignSelf:"center",mx:1,children:r}),e.jsxRuntimeExports.jsx(t.TimePicker,{...s,"data-testid":`${i}-end-time-picker`})]});exports.TimeRange=a;
|
|
2
|
+
//# sourceMappingURL=timeRange.component-D3Db8lvh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeRange.component-D3Db8lvh.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 { TimePicker, TimePickerProps } from 'components/TimePicker/timePicker.component';\n\nexport interface TimeRangeProps extends FlexProps {\n /**\n * Element that separates the start and end time pickers. By default, a dash is used.\n * @default -\n */\n separator?: React.ReactNode;\n /** Props for the end time picker. See `TimePicker` for more information. */\n endTimePickerProps: TimePickerProps;\n /** Props for the start time picker. See `TimePicker` for more information. */\n startTimePickerProps: TimePickerProps;\n /**\n * Data test id for the time range.\n * @default kibble-time-range\n */\n 'data-testid'?: string;\n}\n\nexport const TimeRange = ({\n endTimePickerProps,\n separator = '-',\n startTimePickerProps,\n ['data-testid']: dataTestId = 'kibble-time-range',\n ...rest\n}: TimeRangeProps): React.JSX.Element => {\n return (\n <Flex className=\"TimeRange\" data-testid={dataTestId} {...rest}>\n <TimePicker {...startTimePickerProps} data-testid={`${dataTestId}-start-time-picker`} />\n <Box alignSelf=\"center\" mx={1}>\n {separator}\n </Box>\n <TimePicker {...endTimePickerProps} data-testid={`${dataTestId}-end-time-picker`} />\n </Flex>\n );\n};\n"],"names":["TimeRange","endTimePickerProps","separator","startTimePickerProps","dataTestId","rest","Flex","jsx","TimePicker","Box"],"mappings":"2KAsBaA,EAAY,CAAC,CACxB,mBAAAC,EACA,UAAAC,EAAY,IACZ,qBAAAC,EACA,CAAC,eAAgBC,EAAa,oBAC9B,GAAGC,CACL,6BAEKC,OAAK,CAAA,UAAU,YAAY,cAAaF,EAAa,GAAGC,EACvD,SAAA,CAAAE,wBAACC,EAAAA,YAAY,GAAGL,EAAsB,cAAa,GAAGC,CAAU,qBAAsB,0BACrFK,EAAAA,IAAI,CAAA,UAAU,SAAS,GAAI,EACzB,SACHP,EAAA,0BACCM,EAAAA,WAAY,CAAA,GAAGP,EAAoB,cAAa,GAAGG,CAAU,kBAAoB,CAAA,CAAA,EACpF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { W as V } from "./text.component-DhuUgP3j.js";
|
|
3
|
-
import {
|
|
3
|
+
import { fontSizes as X } from "../esm/theme/tokens/typography/index.js";
|
|
4
4
|
import { I as Y } from "./icon.component-PV_nHBId.js";
|
|
5
5
|
import { B as ee } from "./index-9BerxEcw.js";
|
|
6
6
|
import { F as k } from "./flex-CX-8gE9T.js";
|
|
@@ -381,4 +381,4 @@ const $e = y(function(e, r) {
|
|
|
381
381
|
export {
|
|
382
382
|
Ze as w
|
|
383
383
|
};
|
|
384
|
-
//# sourceMappingURL=withFormControl-
|
|
384
|
+
//# sourceMappingURL=withFormControl-DW9A6BSL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withFormControl-08PrhcOk.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 { dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\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 env = useEnvironmentContext();\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 uid = useId();\n const id = props.id ?? uid;\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 checkTextElements = () => {\n const docOrShadowRoot = env.getRootNode();\n setHasErrorText(!!docOrShadowRoot.getElementById(errorTextId));\n setHasHelperText(!!docOrShadowRoot.getElementById(helperTextId));\n };\n checkTextElements();\n const win = env.getWindow();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [env, 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 { FormControlLabelPosition, FormControlSize } 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';\nimport { Box } from '@chakra-ui/react/box';\n\nexport interface WithFormControlProps {\n /** If true, the form control will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** The error text to be displayed when the form control is invalid.\n * @default Field is invalid\n */\n errorText?: string;\n /** Props to customize the form control. */\n formControlStyle?: SystemStyleObject;\n /** If true, the form control will take the full width of its container.\n * @default true\n */\n fullWidth?: boolean;\n /** The helper text to be displayed below the form control. */\n helperText?: string;\n /** If true, the form control will be displayed inline with the label. */\n inlineField?: boolean;\n /** If true, the form control will be invalid.\n * @default false\n */\n invalid?: boolean;\n /** The variant of the invalid icon.\n * @default danger\n */\n invalidIconColor?: TypographyVariant;\n /** The label to be displayed above the form control. */\n label?: string | React.ReactNode;\n /** The position of the label relative to the form control.\n * @default start\n */\n labelPosition?: FormControlLabelPosition;\n /** Props to customize the label. */\n labelStyle?: SystemStyleObject;\n /** If true, the form control will be styled for contrast mode.\n * @default false\n */\n onContrast?: boolean;\n /** If true, the form element will be read only.\n * @default false\n */\n readOnly?: boolean;\n /** If true, the form control will be required.\n * @default false\n */\n required?: boolean;\n /** If true, the form control will show an optional text.\n * @default false\n */\n showOptionalElement?: boolean;\n /** The size of the form control.\n * @default md\n */\n size?: FormControlSize;\n /** If true, the form control will show an invalid icon.\n * @default false\n */\n useInvalidIcon?: boolean;\n /** If true, the form control will show an invalid text.\n * @default true\n */\n useInvalidText?: boolean;\n /** Data test id for the form control.\n */\n 'data-testid'?: string;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = 'Field is invalid',\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = 'danger',\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 ['data-testid']: dataTestId,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? 'text.contrast' : 'text'}\n display=\"flex\"\n flexDirection=\"row\"\n gap={1}\n fontSize={fontSizes[size]}\n fontWeight=\"semibold\"\n data-testid={dataTestId ? `${dataTestId}-form-control-label` : undefined}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n <Box as=\"span\">{label}</Box>\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n data-testid={dataTestId ? `${dataTestId}-form-control-required-indicator` : undefined}\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n as=\"span\"\n variant={onContrast ? 'subtleOnContrast' : 'subtle'}\n fontSize={optionalTextSizeMap[size]}\n display=\"contents\"\n ml={1}\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={fullWidth ? '100%' : 'auto'}\n data-testid={dataTestId ? `${dataTestId}-form-control-root` : undefined}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? 'row' : 'column'}\n w={inlineField ? 'max-content' : '100%'}\n gap={2}\n alignItems={inlineField ? 'center' : 'flex-start'}\n data-testid={dataTestId ? `${dataTestId}-form-control-container` : undefined}\n >\n {label && labelPosition === 'start' && labelComponent}\n <Flex className=\"FormControl__Content\" alignItems=\"center\" gap={2} w={inlineField ? 'max-content' : '100%'}>\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n data-testid={dataTestId ? `${dataTestId}` : undefined}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon\n className=\"FormControl__InvalidIcon\"\n data-testid={dataTestId ? `${dataTestId}-form-control-invalid-icon` : undefined}\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 data-testid={dataTestId ? `${dataTestId}-form-control-error-text` : undefined}\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 data-testid={dataTestId ? `${dataTestId}-form-control-helper-text` : undefined}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\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","env","useEnvironmentContext","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","uid","useId","id","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","checkTextElements","docOrShadowRoot","win","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","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","use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AAA,sBACtE,MAAK;AAAA,sBACL,SAAST;AAAA,sBACT,MAAAM;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACF,GAEJ;AAAA,gBACCL,KAASC,MAAkB,SAASQ;AAAA,cAAA;AAAA,YAAA;AAAA,UACvC;AAAA,UACCF,KAAkB5F,KACjBhB,gBAAAA,EAAA;AAAA,YAACqF;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,OAAOmB,IAAa,yBAAyB;AAAA,cAC7C,eAAaK,IAAa,GAAGA,CAAU,6BAA6B;AAAA,cAEnE,UAAAd;AAAA,YAAA;AAAA,UACH;AAAA,UAEDG,KACClG,gBAAAA,EAAA;AAAA,YAACoF;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,OAAOoB,IAAa,yBAAyB;AAAA,cAC7C,eAAaK,IAAa,GAAGA,CAAU,8BAA8B;AAAA,cAEpE,UAAAX;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ;AAEA,SAAAJ,EAAgB,cAAc,mBAAmBD,EAAU,eAAeA,EAAU,IAAI,IACjFC;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
|
1
|
+
{"version":3,"file":"withFormControl-DW9A6BSL.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 { dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\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 env = useEnvironmentContext();\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 uid = useId();\n const id = props.id ?? uid;\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 checkTextElements = () => {\n const docOrShadowRoot = env.getRootNode();\n setHasErrorText(!!docOrShadowRoot.getElementById(errorTextId));\n setHasHelperText(!!docOrShadowRoot.getElementById(helperTextId));\n };\n checkTextElements();\n const win = env.getWindow();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [env, 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 { FormControlLabelPosition, FormControlSize } 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 '@televet/kibble-primitives/core/typography';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Icon } from 'components/Icon/icon.component';\nimport { Box } from '@chakra-ui/react/box';\n\nexport interface WithFormControlProps {\n /** If true, the form control will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** The error text to be displayed when the form control is invalid.\n * @default Field is invalid\n */\n errorText?: string;\n /** Props to customize the form control. */\n formControlStyle?: SystemStyleObject;\n /** If true, the form control will take the full width of its container.\n * @default true\n */\n fullWidth?: boolean;\n /** The helper text to be displayed below the form control. */\n helperText?: string;\n /** If true, the form control will be displayed inline with the label. */\n inlineField?: boolean;\n /** If true, the form control will be invalid.\n * @default false\n */\n invalid?: boolean;\n /** The variant of the invalid icon.\n * @default danger\n */\n invalidIconColor?: TypographyVariant;\n /** The label to be displayed above the form control. */\n label?: string | React.ReactNode;\n /** The position of the label relative to the form control.\n * @default start\n */\n labelPosition?: FormControlLabelPosition;\n /** Props to customize the label. */\n labelStyle?: SystemStyleObject;\n /** If true, the form control will be styled for contrast mode.\n * @default false\n */\n onContrast?: boolean;\n /** If true, the form element will be read only.\n * @default false\n */\n readOnly?: boolean;\n /** If true, the form control will be required.\n * @default false\n */\n required?: boolean;\n /** If true, the form control will show an optional text.\n * @default false\n */\n showOptionalElement?: boolean;\n /** The size of the form control.\n * @default md\n */\n size?: FormControlSize;\n /** If true, the form control will show an invalid icon.\n * @default false\n */\n useInvalidIcon?: boolean;\n /** If true, the form control will show an invalid text.\n * @default true\n */\n useInvalidText?: boolean;\n /** Data test id for the form control.\n */\n 'data-testid'?: string;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = 'Field is invalid',\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = 'danger',\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 ['data-testid']: dataTestId,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? 'text.contrast' : 'text'}\n display=\"flex\"\n flexDirection=\"row\"\n gap={1}\n fontSize={fontSizes[size]}\n fontWeight=\"semibold\"\n data-testid={dataTestId ? `${dataTestId}-form-control-label` : undefined}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n <Box as=\"span\">{label}</Box>\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n data-testid={dataTestId ? `${dataTestId}-form-control-required-indicator` : undefined}\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n as=\"span\"\n variant={onContrast ? 'subtleOnContrast' : 'subtle'}\n fontSize={optionalTextSizeMap[size]}\n display=\"contents\"\n ml={1}\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={fullWidth ? '100%' : 'auto'}\n data-testid={dataTestId ? `${dataTestId}-form-control-root` : undefined}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? 'row' : 'column'}\n w={inlineField ? 'max-content' : '100%'}\n gap={2}\n alignItems={inlineField ? 'center' : 'flex-start'}\n data-testid={dataTestId ? `${dataTestId}-form-control-container` : undefined}\n >\n {label && labelPosition === 'start' && labelComponent}\n <Flex className=\"FormControl__Content\" alignItems=\"center\" gap={2} w={inlineField ? 'max-content' : '100%'}>\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n data-testid={dataTestId ? `${dataTestId}` : undefined}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon\n className=\"FormControl__InvalidIcon\"\n data-testid={dataTestId ? `${dataTestId}-form-control-invalid-icon` : undefined}\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 data-testid={dataTestId ? `${dataTestId}-form-control-error-text` : undefined}\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 data-testid={dataTestId ? `${dataTestId}-form-control-helper-text` : undefined}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\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","env","useEnvironmentContext","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","uid","useId","id","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","checkTextElements","docOrShadowRoot","win","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","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","dataTestId","labelComponent","jsxs","fontSizes","e","Box","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,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AAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ;AAEA,SAAAJ,EAAgB,cAAc,mBAAmBD,EAAU,eAAeA,EAAU,IAAI,IACjFC;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),J=require("./text.component-BDDz5KQP.js"),K=require("../cjs/theme/tokens/typography/index.cjs"),Q=require("./icon.component-B1hr5lLa.js"),U=require("./index-BQRnVsAg.js"),T=require("./flex-BOU6tYUd.js"),o=require("react"),w=require("./factory-a2SJjEvR.js"),V=require("./create-slot-recipe-context-HXE1VazG.js"),X=require("./create-recipe-context-CDw-39SC.js"),y=require("./use-field-context-Cm29IQ7H.js"),g=require("./use-locale-context-ym21RUxU.js"),u=require("./index-CQURjLlA.js"),R=require("./field.anatomy-Bhj7Mlr7.js");function Y(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ee=Y(o),H=o.forwardRef((e,t)=>{const r=y.useFieldContext(),s=u.mergeProps(r.getErrorTextProps(),e);return r?.invalid?n.jsxRuntimeExports.jsx(g.ark.span,{...s,ref:t}):null});H.displayName="FieldErrorText";const L=o.forwardRef((e,t)=>{const r=y.useFieldContext(),s=u.mergeProps(r?.getHelperTextProps(),e);return n.jsxRuntimeExports.jsx(g.ark.span,{...s,ref:t})});L.displayName="FieldHelperText";const O=o.forwardRef((e,t)=>{const r=y.useFieldContext(),s=u.mergeProps(r?.getLabelProps(),e);return n.jsxRuntimeExports.jsx(g.ark.label,{...s,ref:t})});O.displayName="FieldLabel";const te=typeof window<"u"?o.useLayoutEffect:o.useEffect,[Re,re]=g.createContext({name:"FieldsetContext",hookName:"useFieldsetContext",providerName:"<FieldsetProvider />",strict:!1}),oe=(e={})=>{const t=re(),r=g.useEnvironmentContext(),{ids:s,disabled:a=!!t?.disabled,invalid:i=!1,readOnly:c=!1,required:x=!1}=e,[m,N]=o.useState(!1),[F,P]=o.useState(!1),_=o.useId(),d=e.id??_,b=o.useRef(null),j=s?.control??`field::${d}`,f=s?.errorText??`field::${d}::error-text`,p=s?.helperText??`field::${d}::helper-text`,E=s?.label??`field::${d}::label`;te(()=>{const C=b.current;if(!C)return;const $=()=>{const k=r.getRootNode();N(!!k.getElementById(f)),P(!!k.getElementById(p))};$();const G=r.getWindow(),M=new G.MutationObserver($);return M.observe(C,{childList:!0,subtree:!0}),()=>M.disconnect()},[r,f,p]);const v=o.useMemo(()=>{const C=[];return m&&i&&C.push(f),F&&C.push(p),C.join(" ")||void 0},[i,f,p,m,F]),l=o.useMemo(()=>()=>({...R.parts.root.attrs,id:j,ref:b,role:"group","data-disabled":u.dataAttr(a),"data-invalid":u.dataAttr(i),"data-readonly":u.dataAttr(c)}),[a,i,c,j]),q=o.useMemo(()=>()=>({...R.parts.label.attrs,id:E,"data-disabled":u.dataAttr(a),"data-invalid":u.dataAttr(i),"data-readonly":u.dataAttr(c),htmlFor:d}),[a,i,c,d,E]),h=o.useMemo(()=>()=>({"aria-describedby":v,"aria-invalid":u.ariaAttr(i),"data-invalid":u.dataAttr(i),"data-required":u.dataAttr(x),"data-readonly":u.dataAttr(c),id:d,required:x,disabled:a,readOnly:c}),[v,i,x,c,d,a]),A=o.useMemo(()=>()=>({...h(),...R.parts.input.attrs}),[h]),B=o.useMemo(()=>()=>({...h(),...R.parts.textarea.attrs}),[h]),D=o.useMemo(()=>()=>({...h(),...R.parts.select.attrs}),[h]),z=o.useMemo(()=>()=>({id:p,...R.parts.helperText.attrs,"data-disabled":u.dataAttr(a)}),[a,p]),W=o.useMemo(()=>()=>({id:f,...R.parts.errorText.attrs,"aria-live":"polite"}),[f]),Z=o.useMemo(()=>()=>({"aria-hidden":!0,...R.parts.requiredIndicator.attrs}),[]);return{ariaDescribedby:v,ids:{root:j,control:d,label:E,errorText:f,helperText:p},refs:{rootRef:b},disabled:a,invalid:i,readOnly:c,required:x,getLabelProps:q,getRootProps:l,getInputProps:A,getTextareaProps:B,getSelectProps:D,getHelperTextProps:z,getErrorTextProps:W,getRequiredIndicatorProps:Z}},I=o.forwardRef((e,t)=>{const[r,s]=g.createSplitProps()(e,["id","ids","disabled","invalid","readOnly","required"]),a=oe(r),i=u.mergeProps(a.getRootProps(),s);return n.jsxRuntimeExports.jsx(y.FieldProvider,{value:a,children:n.jsxRuntimeExports.jsx(g.ark.div,{...i,ref:g.composeRefs(t,a.refs.rootRef)})})});I.displayName="FieldRoot";const{useRecipeResult:se}=X.createRecipeContext({key:"icon"}),ne=ee.forwardRef(function(t,r){const{styles:s,className:a,props:i}=se({asChild:!t.as,...t});return n.jsxRuntimeExports.jsx(w.chakra.svg,{ref:r,focusable:!1,"aria-hidden":"true",...i,css:[s,t.css],className:w.cx(a,t.className)})});function ae(e){const{viewBox:t="0 0 24 24",d:r,displayName:s,defaultProps:a={}}=e,i=o.Children.toArray(e.path),c=o.forwardRef((x,m)=>n.jsxRuntimeExports.jsx(ne,{ref:m,asChild:!1,viewBox:t,...a,...x,children:i.length?i:n.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:r})}));return c.displayName=s,c}const{withProvider:ie,withContext:S,useStyles:le,useClassNames:ce}=V.createSlotRecipeContext({key:"field"}),de=ie(I,"root",{forwardAsChild:!0}),ue=S(O,"label",{forwardAsChild:!0}),xe=S(L,"helperText",{forwardAsChild:!0}),pe=S(H,"errorText",{forwardAsChild:!0});ae({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"});const me=o.forwardRef(function(t,r){const{fallback:s,children:a="*",...i}=t,c=y.useFieldContext(),x=ce(),m=le();return c?.required?n.jsxRuntimeExports.jsx(w.chakra.span,{ref:r,"aria-hidden":"true",...i,className:w.cx(x.requiredIndicator,t.className),css:[m.requiredIndicator,t.css],children:a}):s}),fe={sm:10,md:12,lg:14},he=e=>{const t=({disabled:r=!1,errorText:s="Field is invalid",formControlStyle:a,fullWidth:i=!0,helperText:c,inlineField:x=!1,invalid:m=!1,invalidIconColor:N="danger",label:F,labelPosition:P="start",labelStyle:_,onContrast:d=!1,readOnly:b=!1,required:j=!1,showOptionalElement:f=!1,size:p="md",useInvalidIcon:E=!1,useInvalidText:v=!0,["data-testid"]:l,...q})=>{const h=n.jsxRuntimeExports.jsxs(ue,{className:"FormControl__Label",color:d?"text.contrast":"text",display:"flex",flexDirection:"row",gap:1,fontSize:K.fontSizes[p],fontWeight:"semibold","data-testid":l?`${l}-form-control-label`:void 0,..._,onClick:A=>{A.stopPropagation()},children:[n.jsxRuntimeExports.jsx(U.Box,{as:"span",children:F}),n.jsxRuntimeExports.jsx(me,{className:"FormControl__RequiredIndicator","data-testid":l?`${l}-form-control-required-indicator`:void 0,color:d?"text.danger.contrast":"text.danger",...!j&&{fallback:f?n.jsxRuntimeExports.jsx(J.WrappedText,{as:"span",variant:d?"subtleOnContrast":"subtle",fontSize:fe[p],display:"contents",ml:1,children:"(Optional)"}):n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}})]});return n.jsxRuntimeExports.jsxs(de,{className:"FormControl group",disabled:r,invalid:m,readOnly:b,required:j,width:i?"100%":"auto","data-testid":l?`${l}-form-control-root`:void 0,...a,children:[n.jsxRuntimeExports.jsxs(T.Flex,{className:"FormControl__Container",flexDirection:x?"row":"column",w:x?"max-content":"100%",gap:2,alignItems:x?"center":"flex-start","data-testid":l?`${l}-form-control-container`:void 0,children:[F&&P==="start"&&h,n.jsxRuntimeExports.jsxs(T.Flex,{className:"FormControl__Content",alignItems:"center",gap:2,w:x?"max-content":"100%",children:[n.jsxRuntimeExports.jsx(e,{disabled:r,invalid:m,onContrast:d,readOnly:b,required:j,size:p,"data-testid":l?`${l}`:void 0,...q}),E&&m&&n.jsxRuntimeExports.jsx(Q.Icon,{className:"FormControl__InvalidIcon","data-testid":l?`${l}-form-control-invalid-icon`:void 0,name:"warningSign",variant:N,size:p})]}),F&&P==="end"&&h]}),v&&m&&n.jsxRuntimeExports.jsx(pe,{className:"FormControl__ErrorText",fontSize:"xs",color:d?"text.danger.contrast":"text.danger","data-testid":l?`${l}-form-control-error-text`:void 0,children:s}),c&&n.jsxRuntimeExports.jsx(xe,{className:"FormControl__HelperText",fontSize:"xs",color:d?"text.subtle.contrast":"text.subtle","data-testid":l?`${l}-form-control-helper-text`:void 0,children:c})]})};return t.displayName=`withFormControl(${e.displayName||e.name}`,t};exports.withFormControl=he;
|
|
2
|
+
//# sourceMappingURL=withFormControl-QV_Jridv.js.map
|