@commercetools/nimbus 0.0.0-canary-20250807210749 → 0.0.0-canary-20250808141145
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/accordion-Bn6CnY0Y.cjs.js.map +1 -1
- package/dist/chunks/accordion-xfgQQjFK.es.js.map +1 -1
- package/dist/chunks/alert-BkF91mJ0.es.js.map +1 -1
- package/dist/chunks/alert-CQLVvNDD.cjs.js.map +1 -1
- package/dist/chunks/badge-CFwI3HLf.cjs.js.map +1 -1
- package/dist/chunks/badge-DVDR3-fy.es.js.map +1 -1
- package/dist/chunks/box-DD4jYgS7.es.js.map +1 -1
- package/dist/chunks/box-FU6tRPFs.cjs.js.map +1 -1
- package/dist/chunks/button-BBwNbl7S.cjs.js.map +1 -1
- package/dist/chunks/button-BTpQweka.es.js.map +1 -1
- package/dist/chunks/calendar-B4nCYXn4.es.js.map +1 -1
- package/dist/chunks/calendar-CKVscUm-.cjs.js.map +1 -1
- package/dist/chunks/card-B9z3AknN.cjs.js.map +1 -1
- package/dist/chunks/card-CvY06qIE.es.js.map +1 -1
- package/dist/chunks/checkbox-DywApPQh.cjs.js.map +1 -1
- package/dist/chunks/checkbox-yo64B6Gz.es.js.map +1 -1
- package/dist/chunks/code-CI8aUhmu.es.js.map +1 -1
- package/dist/chunks/code-Dg4Larbo.cjs.js.map +1 -1
- package/dist/chunks/combobox-D5lDtav9.cjs.js.map +1 -1
- package/dist/chunks/combobox-DWSsUEVz.es.js.map +1 -1
- package/dist/chunks/date-input-4hsVHJJo.es.js.map +1 -1
- package/dist/chunks/date-input-CGy4NHpW.cjs.js.map +1 -1
- package/dist/chunks/date-picker-BfA4uYkg.cjs.js.map +1 -1
- package/dist/chunks/date-picker-UO9jg5oK.es.js.map +1 -1
- package/dist/chunks/{date-range-picker-DGKM05wQ.es.js → date-range-picker-BU5JdXpV.es.js} +69 -69
- package/dist/chunks/date-range-picker-BU5JdXpV.es.js.map +1 -0
- package/dist/chunks/{date-range-picker-D7D7R_4k.cjs.js → date-range-picker-Uh8jNdzD.cjs.js} +2 -2
- package/dist/chunks/date-range-picker-Uh8jNdzD.cjs.js.map +1 -0
- package/dist/chunks/dialog-C1HRMUcF.es.js.map +1 -1
- package/dist/chunks/dialog-amEwvIoM.cjs.js.map +1 -1
- package/dist/chunks/form-field-C9PpQYF0.es.js.map +1 -1
- package/dist/chunks/form-field-CBFyTAo8.cjs.js.map +1 -1
- package/dist/chunks/grid-CugcJxRP.es.js.map +1 -1
- package/dist/chunks/grid-xr2A-OqD.cjs.js.map +1 -1
- package/dist/chunks/group-DKR1JLAy.es.js.map +1 -1
- package/dist/chunks/group-DtSrr9I-.cjs.js.map +1 -1
- package/dist/chunks/icon-BFNYuilh.es.js.map +1 -1
- package/dist/chunks/icon-D50i-dqv.cjs.js.map +1 -1
- package/dist/chunks/icon-button-BEaNe4rE.cjs.js.map +1 -1
- package/dist/chunks/icon-button-DqkVeZCx.es.js.map +1 -1
- package/dist/chunks/image-DCirAAnr.cjs.js.map +1 -1
- package/dist/chunks/image-rXPA3shk.es.js.map +1 -1
- package/dist/chunks/kbd-Bkhw9E6L.cjs.js.map +1 -1
- package/dist/chunks/kbd-Gxvodc1U.es.js.map +1 -1
- package/dist/chunks/link-BS1jRPrC.es.js.map +1 -1
- package/dist/chunks/link-COqOFX5Z.cjs.js.map +1 -1
- package/dist/chunks/list-8yfreyzi.cjs.js.map +1 -1
- package/dist/chunks/list-B21joBrq.es.js.map +1 -1
- package/dist/chunks/loading-spinner-BQd4UVQs.cjs.js.map +1 -1
- package/dist/chunks/loading-spinner-DwN-yshK.es.js.map +1 -1
- package/dist/chunks/multiline-text-input-BCHcfgz9.cjs.js.map +1 -1
- package/dist/chunks/multiline-text-input-sSdbj6tb.es.js.map +1 -1
- package/dist/chunks/nimbus-provider-Bf7NgBYl.cjs.js.map +1 -1
- package/dist/chunks/nimbus-provider-DiytQtCG.es.js.map +1 -1
- package/dist/chunks/number-input-BU6yMXV8.cjs.js.map +1 -1
- package/dist/chunks/number-input-DzwHfylo.es.js.map +1 -1
- package/dist/chunks/password-input-DdJ9gDUr.es.js.map +1 -1
- package/dist/chunks/password-input-DpINXGwE.cjs.js.map +1 -1
- package/dist/chunks/progress-bar-CCyJEPoU.es.js +75 -0
- package/dist/chunks/progress-bar-CCyJEPoU.es.js.map +1 -0
- package/dist/chunks/progress-bar-pMjw8h4h.cjs.js +2 -0
- package/dist/chunks/progress-bar-pMjw8h4h.cjs.js.map +1 -0
- package/dist/chunks/radio-input-BLVHJidw.cjs.js.map +1 -1
- package/dist/chunks/radio-input-CCm7Xqcz.es.js.map +1 -1
- package/dist/chunks/select-BZ2fZDHJ.cjs.js.map +1 -1
- package/dist/chunks/select-Cx0Yiwr-.es.js.map +1 -1
- package/dist/chunks/simple-grid-CFOP9g2P.es.js.map +1 -1
- package/dist/chunks/simple-grid-CHgTayx6.cjs.js.map +1 -1
- package/dist/chunks/stack-__ugxVHD.es.js.map +1 -1
- package/dist/chunks/stack-wFUhYQQb.cjs.js.map +1 -1
- package/dist/chunks/switch-BriJIKqx.es.js.map +1 -1
- package/dist/chunks/switch-GFsEXE6w.cjs.js.map +1 -1
- package/dist/chunks/tag-group-8CojIACI.es.js.map +1 -1
- package/dist/chunks/tag-group-D7GNkec5.cjs.js.map +1 -1
- package/dist/chunks/text--fhvW47o.cjs.js.map +1 -1
- package/dist/chunks/text-CFsPSPPs.es.js.map +1 -1
- package/dist/chunks/text-input-Dg1LSvlo.es.js.map +1 -1
- package/dist/chunks/text-input-DzIZYD16.cjs.js.map +1 -1
- package/dist/chunks/toggle-button-BcbQQcBy.cjs.js.map +1 -1
- package/dist/chunks/toggle-button-DhnBl8Gb.es.js.map +1 -1
- package/dist/chunks/toggle-button-group-BQfaNSZf.es.js.map +1 -1
- package/dist/chunks/toggle-button-group-C5nvmHRc.cjs.js.map +1 -1
- package/dist/chunks/{toolbar-C18za_6s.es.js → toolbar-DZrjQLFq.es.js} +2 -5
- package/dist/chunks/{toolbar-C18za_6s.es.js.map → toolbar-DZrjQLFq.es.js.map} +1 -1
- package/dist/chunks/toolbar-O-t4_xhL.cjs.js.map +1 -1
- package/dist/chunks/tooltip-Bi0556u1.es.js.map +1 -1
- package/dist/chunks/tooltip-DwXtfA_x.cjs.js.map +1 -1
- package/dist/chunks/visually-hidden-Bkimhan7.es.js.map +1 -1
- package/dist/chunks/visually-hidden-KeFRLonC.cjs.js.map +1 -1
- package/dist/components/components.cjs +1 -1
- package/dist/components/components.es.js +3 -3
- package/dist/components/date-range-picker.cjs +1 -1
- package/dist/components/date-range-picker.es.js +1 -1
- package/dist/components/progress-bar.cjs +1 -1
- package/dist/components/progress-bar.es.js +1 -1
- package/dist/components/toolbar.es.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +3 -3
- package/dist/setup-jsdom-polyfills.cjs.map +1 -1
- package/dist/setup-jsdom-polyfills.es.js.map +1 -1
- package/package.json +5 -5
- package/dist/chunks/date-range-picker-D7D7R_4k.cjs.js.map +0 -1
- package/dist/chunks/date-range-picker-DGKM05wQ.es.js.map +0 -1
- package/dist/chunks/progress-bar-CbZY1dE1.cjs.js +0 -2
- package/dist/chunks/progress-bar-CbZY1dE1.cjs.js.map +0 -1
- package/dist/chunks/progress-bar-VipTWl4r.es.js +0 -71
- package/dist/chunks/progress-bar-VipTWl4r.es.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input-4hsVHJJo.es.js","sources":["../../src/components/date-input/date-input.slots.tsx","../../src/components/date-input/date-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\n\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DateInputRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DateInputRootProps\n extends HTMLChakraProps<\"div\", DateInputRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: dateInputSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DateInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateInputRootSlot = withProvider<\n HTMLDivElement,\n DateInputRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n DateInputRootSlot,\n DateInputSegmentGroupSlot,\n DateInputSegmentSlot,\n} from \"./date-input.slots\";\n\nimport {\n DateField,\n DateInput as DateInputField,\n DateSegment,\n} from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react\";\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\nimport type { DateInputProps } from \"./date-input.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * # DateInput\n
|
|
1
|
+
{"version":3,"file":"date-input-4hsVHJJo.es.js","sources":["../../src/components/date-input/date-input.slots.tsx","../../src/components/date-input/date-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\n\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DateInputRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DateInputRootProps\n extends HTMLChakraProps<\"div\", DateInputRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: dateInputSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DateInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateInputRootSlot = withProvider<\n HTMLDivElement,\n DateInputRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n DateInputRootSlot,\n DateInputSegmentGroupSlot,\n DateInputSegmentSlot,\n} from \"./date-input.slots\";\n\nimport {\n DateField,\n DateInput as DateInputField,\n DateSegment,\n} from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react\";\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\nimport type { DateInputProps } from \"./date-input.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * # DateInput\n *\n * allows entering a date\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/dateinput}\n */\nexport const DateInput = (props: DateInputProps) => {\n const recipe = useRecipe({ recipe: dateInputSlotRecipe });\n const [recipeProps, recipeFreeProps] = recipe.splitVariantProps(props);\n const [styleProps, functionalProps] = extractStyleProps(recipeFreeProps);\n\n return (\n <DateInputRootSlot {...recipeProps} {...styleProps} asChild>\n <DateField {...functionalProps}>\n <DateInputSegmentGroupSlot asChild>\n <DateInputField>\n {(segment) => (\n <DateInputSegmentSlot asChild>\n <DateSegment segment={segment} />\n </DateInputSegmentSlot>\n )}\n </DateInputField>\n </DateInputSegmentGroupSlot>\n </DateField>\n </DateInputRootSlot>\n );\n};\n\nDateInput.displayName = \"DateInput\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","dateInputSlotRecipe","DateInputRootSlot","DateInputSegmentGroupSlot","DateInputSegmentSlot","DateInput","props","recipe","useRecipe","recipeProps","recipeFreeProps","styleProps","functionalProps","extractStyleProps","jsx","DateField","DateInputField","segment","DateSegment"],"mappings":";;;;;AAyBA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,QAAQC;AACV,CAAC,GAMYC,IAAoB,gBAAAJ,EAG/B,OAAO,MAAM,GAKFK,IAA4B,gBAAAJ,EAGvC,OAAO,cAAc,GAKVK,IAAuB,gBAAAL,EAGlC,OAAO,SAAS,GC7BLM,IAAY,CAACC,MAA0B;AAClD,QAAMC,IAASC,EAAU,EAAE,QAAQP,GAAqB,GAClD,CAACQ,GAAaC,CAAe,IAAIH,EAAO,kBAAkBD,CAAK,GAC/D,CAACK,GAAYC,CAAe,IAAIC,EAAkBH,CAAe;AAEvE,SACE,gBAAAI,EAACZ,GAAA,EAAmB,GAAGO,GAAc,GAAGE,GAAY,SAAO,IACzD,UAAA,gBAAAG,EAACC,GAAA,EAAW,GAAGH,GACb,4BAACT,GAAA,EAA0B,SAAO,IAChC,UAAA,gBAAAW,EAACE,GAAA,EACE,UAAA,CAACC,MACA,gBAAAH,EAACV,KAAqB,SAAO,IAC3B,UAAA,gBAAAU,EAACI,GAAA,EAAY,SAAAD,EAAA,CAAkB,EAAA,CACjC,GAEJ,EAAA,CACF,GACF,GACF;AAEJ;AAEAZ,EAAU,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input-CGy4NHpW.cjs.js","sources":["../../src/components/date-input/date-input.slots.tsx","../../src/components/date-input/date-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\n\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DateInputRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DateInputRootProps\n extends HTMLChakraProps<\"div\", DateInputRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: dateInputSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DateInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateInputRootSlot = withProvider<\n HTMLDivElement,\n DateInputRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n DateInputRootSlot,\n DateInputSegmentGroupSlot,\n DateInputSegmentSlot,\n} from \"./date-input.slots\";\n\nimport {\n DateField,\n DateInput as DateInputField,\n DateSegment,\n} from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react\";\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\nimport type { DateInputProps } from \"./date-input.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * # DateInput\n
|
|
1
|
+
{"version":3,"file":"date-input-CGy4NHpW.cjs.js","sources":["../../src/components/date-input/date-input.slots.tsx","../../src/components/date-input/date-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\n\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DateInputRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DateInputRootProps\n extends HTMLChakraProps<\"div\", DateInputRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: dateInputSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DateInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateInputRootSlot = withProvider<\n HTMLDivElement,\n DateInputRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n DateInputRootSlot,\n DateInputSegmentGroupSlot,\n DateInputSegmentSlot,\n} from \"./date-input.slots\";\n\nimport {\n DateField,\n DateInput as DateInputField,\n DateSegment,\n} from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react\";\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\nimport type { DateInputProps } from \"./date-input.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * # DateInput\n *\n * allows entering a date\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/dateinput}\n */\nexport const DateInput = (props: DateInputProps) => {\n const recipe = useRecipe({ recipe: dateInputSlotRecipe });\n const [recipeProps, recipeFreeProps] = recipe.splitVariantProps(props);\n const [styleProps, functionalProps] = extractStyleProps(recipeFreeProps);\n\n return (\n <DateInputRootSlot {...recipeProps} {...styleProps} asChild>\n <DateField {...functionalProps}>\n <DateInputSegmentGroupSlot asChild>\n <DateInputField>\n {(segment) => (\n <DateInputSegmentSlot asChild>\n <DateSegment segment={segment} />\n </DateInputSegmentSlot>\n )}\n </DateInputField>\n </DateInputSegmentGroupSlot>\n </DateField>\n </DateInputRootSlot>\n );\n};\n\nDateInput.displayName = \"DateInput\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","dateInputSlotRecipe","DateInputRootSlot","DateInputSegmentGroupSlot","DateInputSegmentSlot","DateInput","props","recipe","useRecipe","recipeProps","recipeFreeProps","styleProps","functionalProps","extractStyleProps","jsx","DateField","DateInputField","segment","DateSegment"],"mappings":"2NAyBM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,mBACV,CAAC,EAMYC,EAAoBJ,EAG/B,MAAO,MAAM,EAKFK,EAA4BJ,EAGvC,MAAO,cAAc,EAKVK,EAAuBL,EAGlC,MAAO,SAAS,EC7BLM,EAAaC,GAA0B,CAClD,MAAMC,EAASC,EAAAA,UAAU,CAAE,OAAQP,EAAAA,oBAAqB,EAClD,CAACQ,EAAaC,CAAe,EAAIH,EAAO,kBAAkBD,CAAK,EAC/D,CAACK,EAAYC,CAAe,EAAIC,EAAAA,kBAAkBH,CAAe,EAEvE,OACEI,EAAAA,IAACZ,EAAA,CAAmB,GAAGO,EAAc,GAAGE,EAAY,QAAO,GACzD,SAAAG,EAAAA,IAACC,4CAAA,CAAW,GAAGH,EACb,eAACT,EAAA,CAA0B,QAAO,GAChC,SAAAW,EAAAA,IAACE,EAAAA,0CAAA,CACE,SAACC,GACAH,EAAAA,IAACV,GAAqB,QAAO,GAC3B,SAAAU,MAACI,EAAAA,0CAAA,CAAY,QAAAD,CAAA,CAAkB,CAAA,CACjC,EAEJ,CAAA,CACF,EACF,EACF,CAEJ,EAEAZ,EAAU,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-BfA4uYkg.cjs.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\n\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DatePickerRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DatePickerRootProps\n extends HTMLChakraProps<\"div\", DatePickerRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: datePickerSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput and trigger button.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the trigger button that opens the calendar popover.\n */\nexport const DatePickerTriggerSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trigger\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { useLocale } from \"react-aria\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const { locale } = useLocale();\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Small delay to ensure the DOM is ready\n setTimeout(() => {\n // Find the first focusable segment within the time input container\n const container = timeInputRef.current;\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n\n if (firstSegment) {\n firstSegment.focus();\n }\n }\n }, 50);\n }\n\n previousDateRef.current = dateValue;\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n {/* TODO: translate hardcoded string */}\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n Start time\n </Text>\n <TimeInput\n slot=\"timeInput\"\n locale={locale}\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return \"Enter time (hour)\";\n case \"minute\":\n return \"Enter time (hour and minute)\";\n case \"second\":\n return \"Enter time (hour, minute, and second)\";\n default:\n return \"Enter time\";\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": \"Clear input value\",\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerTriggerSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n * \n * a UI component for users to enter or select a specific calendar date.\n * \n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <DatePickerTriggerSlot>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </DatePickerTriggerSlot>\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","datePickerSlotRecipe","DatePickerRootSlot","DatePickerGroupSlot","DatePickerTriggerSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","DatePickerTimeInput","hideTimeZone","hourCycle","locale","useLocale","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","container","firstSegment","jsxs","Flex","jsx","Text","TimeInput","DatePickerCustomContext","children","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","activeElement","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":"0sBAyBM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,oBACV,CAAC,EAMYC,EAAqBJ,EAGhC,MAAO,MAAM,EAKFK,EAAsBJ,EAGjC,MAAO,OAAO,EAKHK,EAAwBL,EAGnC,MAAO,SAAS,EAKLM,EAAwBN,EAGnC,MAAO,SAAS,EAKLO,EAAyBP,EAGpC,MAAO,UAAU,EC9DNQ,EAAsB,CAAC,CAClC,aAAAC,EACA,UAAAC,CACF,IAAgC,CAC9B,KAAM,CAAE,OAAAC,CAAA,EAAWC,4CAAA,EACbC,EAAkBC,EAAAA,WAAWC,2CAAsB,EACnD,CAAE,YAAAC,EAAa,UAAAC,CAAA,EAAcJ,EAC7BK,EAAeC,EAAAA,OAAuB,IAAI,EAC1CC,EAAkBD,EAAAA,OAAOF,CAAS,EAGxC,OAAID,IAAgB,MACX,MAITK,EAAAA,UAAU,IAAM,CAEVJ,GAAaG,EAAgB,SAAS,QAAQH,CAAS,IAAM,GAE/D,WAAW,IAAM,CAEf,MAAMK,EAAYJ,EAAa,QAC/B,GAAII,EAAW,CACb,MAAMC,EAAeD,EAAU,cAC7B,qBAAA,EAGEC,GACFA,EAAa,MAAA,CAEjB,CACF,EAAG,EAAE,EAG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EAAAA,cAAA,CAAA,CAAc,CAAA,CAAA,CACjB,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,EACAtC,EAAAA,IAACpB,GAAsB,QAAO,GAC5B,eAAC2D,EAAAA,0CAAA,CAAQ,UAAU,aACjB,SAAAzC,EAAAA,KAAC0C,EAAAA,0CAAA,CACC,SAAA,CAAAxC,EAAAA,IAACnB,EAAA,CACC,SAAAmB,EAAAA,IAACyC,EAAAA,SAAA,CAAA,CAAS,EACZ,EACAzC,EAAAA,IAAClB,EAAA,CACC,aAAAC,EACA,UAAAC,CAAA,CAAA,CACF,CAAA,CACF,EACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,EAEJ,CAEJ,EAEAoC,EAAW,YAAc"}
|
|
1
|
+
{"version":3,"file":"date-picker-BfA4uYkg.cjs.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\n\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DatePickerRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DatePickerRootProps\n extends HTMLChakraProps<\"div\", DatePickerRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: datePickerSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput and trigger button.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the trigger button that opens the calendar popover.\n */\nexport const DatePickerTriggerSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trigger\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { useLocale } from \"react-aria\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const { locale } = useLocale();\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Small delay to ensure the DOM is ready\n setTimeout(() => {\n // Find the first focusable segment within the time input container\n const container = timeInputRef.current;\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n\n if (firstSegment) {\n firstSegment.focus();\n }\n }\n }, 50);\n }\n\n previousDateRef.current = dateValue;\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n {/* TODO: translate hardcoded string */}\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n Start time\n </Text>\n <TimeInput\n slot=\"timeInput\"\n locale={locale}\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return \"Enter time (hour)\";\n case \"minute\":\n return \"Enter time (hour and minute)\";\n case \"second\":\n return \"Enter time (hour, minute, and second)\";\n default:\n return \"Enter time\";\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": \"Clear input value\",\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerTriggerSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <DatePickerTriggerSlot>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </DatePickerTriggerSlot>\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","datePickerSlotRecipe","DatePickerRootSlot","DatePickerGroupSlot","DatePickerTriggerSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","DatePickerTimeInput","hideTimeZone","hourCycle","locale","useLocale","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","container","firstSegment","jsxs","Flex","jsx","Text","TimeInput","DatePickerCustomContext","children","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","activeElement","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":"0sBAyBM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,oBACV,CAAC,EAMYC,EAAqBJ,EAGhC,MAAO,MAAM,EAKFK,EAAsBJ,EAGjC,MAAO,OAAO,EAKHK,EAAwBL,EAGnC,MAAO,SAAS,EAKLM,EAAwBN,EAGnC,MAAO,SAAS,EAKLO,EAAyBP,EAGpC,MAAO,UAAU,EC9DNQ,EAAsB,CAAC,CAClC,aAAAC,EACA,UAAAC,CACF,IAAgC,CAC9B,KAAM,CAAE,OAAAC,CAAA,EAAWC,4CAAA,EACbC,EAAkBC,EAAAA,WAAWC,2CAAsB,EACnD,CAAE,YAAAC,EAAa,UAAAC,CAAA,EAAcJ,EAC7BK,EAAeC,EAAAA,OAAuB,IAAI,EAC1CC,EAAkBD,EAAAA,OAAOF,CAAS,EAGxC,OAAID,IAAgB,MACX,MAITK,EAAAA,UAAU,IAAM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IAACoC,EAAAA,WAAA,CACC,KAAK,UACL,QAAQ,QACR,KAAML,EACN,KAAK,QAEL,eAACM,EAAAA,MAAA,CAAA,CAAM,CAAA,CAAA,EAGTrC,EAAAA,IAACoC,EAAAA,WAAA,CACC,KAAK,UACL,QAAQ,QACR,KAAML,EACN,KAAK,iBAEL,eAACO,EAAAA,cAAA,CAAA,CAAc,CAAA,CAAA,CACjB,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,EACAtC,EAAAA,IAACpB,GAAsB,QAAO,GAC5B,eAAC2D,EAAAA,0CAAA,CAAQ,UAAU,aACjB,SAAAzC,EAAAA,KAAC0C,EAAAA,0CAAA,CACC,SAAA,CAAAxC,EAAAA,IAACnB,EAAA,CACC,SAAAmB,EAAAA,IAACyC,EAAAA,SAAA,CAAA,CAAS,EACZ,EACAzC,EAAAA,IAAClB,EAAA,CACC,aAAAC,EACA,UAAAC,CAAA,CAAA,CACF,CAAA,CACF,EACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,EAEJ,CAEJ,EAEAoC,EAAW,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-UO9jg5oK.es.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\n\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DatePickerRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DatePickerRootProps\n extends HTMLChakraProps<\"div\", DatePickerRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: datePickerSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput and trigger button.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the trigger button that opens the calendar popover.\n */\nexport const DatePickerTriggerSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trigger\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { useLocale } from \"react-aria\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const { locale } = useLocale();\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Small delay to ensure the DOM is ready\n setTimeout(() => {\n // Find the first focusable segment within the time input container\n const container = timeInputRef.current;\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n\n if (firstSegment) {\n firstSegment.focus();\n }\n }\n }, 50);\n }\n\n previousDateRef.current = dateValue;\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n {/* TODO: translate hardcoded string */}\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n Start time\n </Text>\n <TimeInput\n slot=\"timeInput\"\n locale={locale}\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return \"Enter time (hour)\";\n case \"minute\":\n return \"Enter time (hour and minute)\";\n case \"second\":\n return \"Enter time (hour, minute, and second)\";\n default:\n return \"Enter time\";\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": \"Clear input value\",\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerTriggerSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n * \n * a UI component for users to enter or select a specific calendar date.\n * \n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <DatePickerTriggerSlot>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </DatePickerTriggerSlot>\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","datePickerSlotRecipe","DatePickerRootSlot","DatePickerGroupSlot","DatePickerTriggerSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","DatePickerTimeInput","hideTimeZone","hourCycle","locale","useLocale","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","container","firstSegment","jsxs","Flex","jsx","Text","TimeInput","DatePickerCustomContext","children","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","activeElement","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,QAAQC;AACV,CAAC,GAMYC,IAAqB,gBAAAJ,EAGhC,OAAO,MAAM,GAKFK,IAAsB,gBAAAJ,EAGjC,OAAO,OAAO,GAKHK,IAAwB,gBAAAL,EAGnC,OAAO,SAAS,GAKLM,IAAwB,gBAAAN,EAGnC,OAAO,SAAS,GAKLO,IAAyB,gBAAAP,EAGpC,OA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AAA,CACF;AAAA,QACA,gBAAAtC,EAACpB,KAAsB,SAAO,IAC5B,4BAAC2D,GAAA,EAAQ,WAAU,cACjB,UAAA,gBAAAzC,EAAC0C,GAAA,EACC,UAAA;AAAA,UAAA,gBAAAxC,EAACnB,GAAA,EACC,UAAA,gBAAAmB,EAACyC,GAAA,CAAA,CAAS,GACZ;AAAA,UACA,gBAAAzC;AAAA,YAAClB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAoC,EAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"date-picker-UO9jg5oK.es.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\n\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DatePickerRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DatePickerRootProps\n extends HTMLChakraProps<\"div\", DatePickerRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: datePickerSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput and trigger button.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the trigger button that opens the calendar popover.\n */\nexport const DatePickerTriggerSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trigger\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { useLocale } from \"react-aria\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const { locale } = useLocale();\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Small delay to ensure the DOM is ready\n setTimeout(() => {\n // Find the first focusable segment within the time input container\n const container = timeInputRef.current;\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n\n if (firstSegment) {\n firstSegment.focus();\n }\n }\n }, 50);\n }\n\n previousDateRef.current = dateValue;\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n {/* TODO: translate hardcoded string */}\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n Start time\n </Text>\n <TimeInput\n slot=\"timeInput\"\n locale={locale}\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return \"Enter time (hour)\";\n case \"minute\":\n return \"Enter time (hour and minute)\";\n case \"second\":\n return \"Enter time (hour, minute, and second)\";\n default:\n return \"Enter time\";\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": \"Clear input value\",\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerTriggerSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <DatePickerTriggerSlot>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </DatePickerTriggerSlot>\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","datePickerSlotRecipe","DatePickerRootSlot","DatePickerGroupSlot","DatePickerTriggerSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","DatePickerTimeInput","hideTimeZone","hourCycle","locale","useLocale","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","container","firstSegment","jsxs","Flex","jsx","Text","TimeInput","DatePickerCustomContext","children","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","activeElement","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,QAAQC;AACV,CAAC,GAMYC,IAAqB,gBAAAJ,EAGhC,OAAO,MAAM,GAKFK,IAAsB,gBAAAJ,EAGjC,OAAO,OAAO,GAKHK,IAAwB,gBAAAL,EAGnC,OAAO,SAAS,GAKLM,IAAwB,gBAAAN,EAGnC,OAAO,SAAS,GAKLO,IAAyB,gBAAAP,EAGpC,OAAO,UAAU,GC9DNQ,IAAsB,CAAC;AAAA,EAClC,cAAAC;AAAA,EACA,WAAAC;AACF,MAAgC;AAC9B,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAkBC,EAAWC,CAAsB,GACnD,EAAE,aAAAC,GAAa,WAAAC,EAAA,IAAcJ,GAC7BK,IAAeC,EAAuB,IAAI,GAC1CC,IAAkBD,EAAOF,CAAS;AAGxC,SAAID,MA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AAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAoC,EAAW,cAAc;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { createSlotRecipeContext as V, Flex as x, useSlotRecipe as w } from "@chakra-ui/react";
|
|
3
3
|
import { d as T } from "./date-range-picker.recipe-CuI7inaU.es.js";
|
|
4
4
|
import { Close as z, CalendarMonth as E } from "@commercetools/nimbus-icons";
|
|
@@ -16,27 +16,27 @@ import { $ as F } from "./context-D3RF-nTI.es.js";
|
|
|
16
16
|
import { $ as R } from "./Button-D19EX1Wq.es.js";
|
|
17
17
|
import { c as H, d as L } from "./utils-CEdpnSRC.es.js";
|
|
18
18
|
import { d as M } from "./DateField-D-4susha.es.js";
|
|
19
|
-
const { withProvider: N, withContext:
|
|
19
|
+
const { withProvider: N, withContext: b } = /* @__PURE__ */ V({
|
|
20
20
|
recipe: T
|
|
21
|
-
}), J = /* @__PURE__ */ N("div", "root"), K = /* @__PURE__ */
|
|
22
|
-
hideTimeZone:
|
|
23
|
-
hourCycle:
|
|
21
|
+
}), J = /* @__PURE__ */ N("div", "root"), K = /* @__PURE__ */ b("div", "group"), Q = /* @__PURE__ */ b("div", "trigger"), U = /* @__PURE__ */ b("div", "popover"), X = /* @__PURE__ */ b("div", "calendar"), Y = ({
|
|
22
|
+
hideTimeZone: s,
|
|
23
|
+
hourCycle: i
|
|
24
24
|
}) => {
|
|
25
|
-
const { locale: e } = F(), l = k(I), { granularity:
|
|
26
|
-
return
|
|
25
|
+
const { locale: e } = F(), l = k(I), { granularity: m, value: r } = l, p = S(null), c = S(r);
|
|
26
|
+
return m === "day" ? null : (A(() => {
|
|
27
27
|
(r?.start && c.current?.start?.compare(r.start) !== 0 || r?.end && c.current?.end?.compare(r.end) !== 0) && setTimeout(() => {
|
|
28
|
-
const o =
|
|
28
|
+
const o = p.current;
|
|
29
29
|
if (o) {
|
|
30
|
-
const
|
|
30
|
+
const d = o.querySelector(
|
|
31
31
|
'[role="spinbutton"]'
|
|
32
32
|
);
|
|
33
|
-
|
|
33
|
+
d && d.focus();
|
|
34
34
|
}
|
|
35
35
|
}, 50), c.current = r;
|
|
36
|
-
}, [r]), /* @__PURE__ */
|
|
36
|
+
}, [r]), /* @__PURE__ */ u(
|
|
37
37
|
x,
|
|
38
38
|
{
|
|
39
|
-
ref:
|
|
39
|
+
ref: p,
|
|
40
40
|
borderTop: "solid-25",
|
|
41
41
|
borderColor: "neutral.3",
|
|
42
42
|
py: "300",
|
|
@@ -45,8 +45,8 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
45
45
|
justifyContent: "center",
|
|
46
46
|
gap: "200",
|
|
47
47
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ u(x, { alignItems: "center", gap: "200", children: [
|
|
49
|
+
/* @__PURE__ */ t(
|
|
50
50
|
y,
|
|
51
51
|
{
|
|
52
52
|
textStyle: "xs",
|
|
@@ -56,20 +56,20 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
56
56
|
children: "Start time"
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ t(
|
|
60
60
|
P,
|
|
61
61
|
{
|
|
62
62
|
slot: "startTimeInput",
|
|
63
63
|
locale: e,
|
|
64
64
|
variant: "ghost",
|
|
65
65
|
size: "sm",
|
|
66
|
-
hideTimeZone:
|
|
67
|
-
hourCycle:
|
|
66
|
+
hideTimeZone: s,
|
|
67
|
+
hourCycle: i
|
|
68
68
|
}
|
|
69
69
|
)
|
|
70
70
|
] }),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ u(x, { alignItems: "center", gap: "200", children: [
|
|
72
|
+
/* @__PURE__ */ t(
|
|
73
73
|
y,
|
|
74
74
|
{
|
|
75
75
|
textStyle: "xs",
|
|
@@ -79,15 +79,15 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
79
79
|
children: "End time"
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ t(
|
|
83
83
|
P,
|
|
84
84
|
{
|
|
85
85
|
slot: "endTimeInput",
|
|
86
86
|
locale: e,
|
|
87
87
|
variant: "ghost",
|
|
88
88
|
size: "sm",
|
|
89
|
-
hideTimeZone:
|
|
90
|
-
hourCycle:
|
|
89
|
+
hideTimeZone: s,
|
|
90
|
+
hourCycle: i
|
|
91
91
|
}
|
|
92
92
|
)
|
|
93
93
|
] })
|
|
@@ -95,10 +95,10 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
95
95
|
}
|
|
96
96
|
));
|
|
97
97
|
}, Z = ({
|
|
98
|
-
children:
|
|
98
|
+
children: s
|
|
99
99
|
}) => {
|
|
100
|
-
const
|
|
101
|
-
const a =
|
|
100
|
+
const i = H(R) || {}, e = k(I), l = (n) => n?.day && n?.month && n?.year, m = !e?.value || !l(e.value.start) || !l(e.value.end), { granularity: r } = e, p = e?.value?.start && "hour" in e.value.start ? e.value.start : null, c = e?.value?.end && "hour" in e.value.end ? e.value.end : null, g = i?.isDisabled, o = (n) => {
|
|
101
|
+
const a = n === "start" ? "Start" : "End";
|
|
102
102
|
switch (r) {
|
|
103
103
|
case "hour":
|
|
104
104
|
return `${a} time (hour)`;
|
|
@@ -109,13 +109,13 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
109
109
|
default:
|
|
110
110
|
return `${a} time`;
|
|
111
111
|
}
|
|
112
|
-
},
|
|
112
|
+
}, d = {
|
|
113
113
|
/** toggles the calendar popover */
|
|
114
114
|
calendarToggle: {
|
|
115
|
-
...
|
|
116
|
-
onPress: (
|
|
115
|
+
...i,
|
|
116
|
+
onPress: (n) => {
|
|
117
117
|
const a = document?.activeElement;
|
|
118
|
-
a && a.blur(),
|
|
118
|
+
a && a.blur(), i.onPress?.(n);
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
/** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */
|
|
@@ -125,21 +125,21 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
125
125
|
"aria-label": "Clear input value",
|
|
126
126
|
isDisabled: g,
|
|
127
127
|
// Hide the button when there's no value
|
|
128
|
-
style:
|
|
129
|
-
"aria-hidden":
|
|
128
|
+
style: m ? { display: "none" } : void 0,
|
|
129
|
+
"aria-hidden": m ? !0 : void 0
|
|
130
130
|
}
|
|
131
|
-
},
|
|
131
|
+
}, $ = {
|
|
132
132
|
startTimeInput: {
|
|
133
|
-
value:
|
|
134
|
-
onChange: (
|
|
135
|
-
if (
|
|
133
|
+
value: p,
|
|
134
|
+
onChange: (n) => {
|
|
135
|
+
if (n !== null && e?.value?.start) {
|
|
136
136
|
const a = e.value, f = a.start, h = a.end;
|
|
137
137
|
if (f && h) {
|
|
138
138
|
const v = f.set({
|
|
139
|
-
hour:
|
|
140
|
-
minute:
|
|
141
|
-
second:
|
|
142
|
-
millisecond:
|
|
139
|
+
hour: n.hour,
|
|
140
|
+
minute: n.minute || 0,
|
|
141
|
+
second: n.second || 0,
|
|
142
|
+
millisecond: n.millisecond || 0
|
|
143
143
|
});
|
|
144
144
|
e.setValue({
|
|
145
145
|
start: v,
|
|
@@ -153,15 +153,15 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
153
153
|
},
|
|
154
154
|
endTimeInput: {
|
|
155
155
|
value: c,
|
|
156
|
-
onChange: (
|
|
157
|
-
if (
|
|
156
|
+
onChange: (n) => {
|
|
157
|
+
if (n !== null && e?.value?.end) {
|
|
158
158
|
const a = e.value, f = a.start, h = a.end;
|
|
159
159
|
if (f && h) {
|
|
160
160
|
const v = h.set({
|
|
161
|
-
hour:
|
|
162
|
-
minute:
|
|
163
|
-
second:
|
|
164
|
-
millisecond:
|
|
161
|
+
hour: n.hour,
|
|
162
|
+
minute: n.minute || 0,
|
|
163
|
+
second: n.second || 0,
|
|
164
|
+
millisecond: n.millisecond || 0
|
|
165
165
|
});
|
|
166
166
|
e.setValue({
|
|
167
167
|
start: f,
|
|
@@ -174,31 +174,31 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
174
174
|
"aria-label": o("end")
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
|
-
return /* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ t(
|
|
178
178
|
L,
|
|
179
179
|
{
|
|
180
180
|
values: [
|
|
181
181
|
[
|
|
182
182
|
R,
|
|
183
183
|
{
|
|
184
|
-
slots:
|
|
184
|
+
slots: d
|
|
185
185
|
}
|
|
186
186
|
],
|
|
187
|
-
[M, { slots:
|
|
187
|
+
[M, { slots: $ }]
|
|
188
188
|
],
|
|
189
|
-
children:
|
|
189
|
+
children: s
|
|
190
190
|
}
|
|
191
191
|
);
|
|
192
|
-
}, _ = (
|
|
193
|
-
const { granularity:
|
|
194
|
-
return /* @__PURE__ */
|
|
192
|
+
}, _ = (s) => {
|
|
193
|
+
const { granularity: i = "day", hideTimeZone: e, hourCycle: l } = s, m = w({ recipe: T }), [r, p] = m.splitVariantProps(s), [c, g] = O(p), { size: o = "md" } = r, d = o === "md" ? "xs" : "2xs", $ = i === "day" ? s.shouldCloseOnSelect : !1;
|
|
194
|
+
return /* @__PURE__ */ t(J, { ...r, ...c, asChild: !0, children: /* @__PURE__ */ t(
|
|
195
195
|
W,
|
|
196
196
|
{
|
|
197
197
|
...g,
|
|
198
|
-
shouldCloseOnSelect:
|
|
199
|
-
children: /* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
198
|
+
shouldCloseOnSelect: $,
|
|
199
|
+
children: /* @__PURE__ */ u(Z, { children: [
|
|
200
|
+
/* @__PURE__ */ t(K, { asChild: !0, children: /* @__PURE__ */ u(G, { children: [
|
|
201
|
+
/* @__PURE__ */ t(
|
|
202
202
|
D,
|
|
203
203
|
{
|
|
204
204
|
slot: "start",
|
|
@@ -209,7 +209,7 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
209
209
|
hourCycle: l
|
|
210
210
|
}
|
|
211
211
|
),
|
|
212
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ t(
|
|
213
213
|
y,
|
|
214
214
|
{
|
|
215
215
|
as: "span",
|
|
@@ -221,7 +221,7 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
221
221
|
children: "–"
|
|
222
222
|
}
|
|
223
223
|
),
|
|
224
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ t(
|
|
225
225
|
D,
|
|
226
226
|
{
|
|
227
227
|
slot: "end",
|
|
@@ -232,32 +232,32 @@ const { withProvider: N, withContext: $ } = /* @__PURE__ */ V({
|
|
|
232
232
|
hourCycle: l
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ u(Q, { children: [
|
|
236
|
+
/* @__PURE__ */ t(
|
|
237
237
|
C,
|
|
238
238
|
{
|
|
239
239
|
tone: "primary",
|
|
240
240
|
variant: "ghost",
|
|
241
|
-
size:
|
|
241
|
+
size: d,
|
|
242
242
|
slot: "clear",
|
|
243
|
-
children: /* @__PURE__ */
|
|
243
|
+
children: /* @__PURE__ */ t(z, {})
|
|
244
244
|
}
|
|
245
245
|
),
|
|
246
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ t(
|
|
247
247
|
C,
|
|
248
248
|
{
|
|
249
249
|
tone: "primary",
|
|
250
250
|
variant: "ghost",
|
|
251
|
-
size:
|
|
251
|
+
size: d,
|
|
252
252
|
slot: "calendarToggle",
|
|
253
|
-
children: /* @__PURE__ */
|
|
253
|
+
children: /* @__PURE__ */ t(E, {})
|
|
254
254
|
}
|
|
255
255
|
)
|
|
256
256
|
] })
|
|
257
257
|
] }) }),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ t(j, { placement: "bottom end", children: /* @__PURE__ */ u(B, { children: [
|
|
259
|
+
/* @__PURE__ */ t(X, { children: /* @__PURE__ */ t(q, {}) }),
|
|
260
|
+
/* @__PURE__ */ t(
|
|
261
261
|
Y,
|
|
262
262
|
{
|
|
263
263
|
hideTimeZone: e,
|
|
@@ -273,4 +273,4 @@ _.displayName = "DateRangePicker";
|
|
|
273
273
|
export {
|
|
274
274
|
_ as D
|
|
275
275
|
};
|
|
276
|
-
//# sourceMappingURL=date-range-picker-
|
|
276
|
+
//# sourceMappingURL=date-range-picker-BU5JdXpV.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range-picker-BU5JdXpV.es.js","sources":["../../src/components/date-range-picker/date-range-picker.slots.tsx","../../src/components/date-range-picker/components/date-range-picker.time-input.tsx","../../src/components/date-range-picker/components/date-range-picker.custom-context.tsx","../../src/components/date-range-picker/date-range-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\n\nimport { dateRangePickerSlotRecipe } from \"./date-range-picker.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DateRangePickerRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DateRangePickerRootProps\n extends HTMLChakraProps<\"div\", DateRangePickerRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: dateRangePickerSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DateRangePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateRangePickerRootSlot = withProvider<\n HTMLDivElement,\n DateRangePickerRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput and trigger button.\n */\nexport const DateRangePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the trigger button that opens the calendar popover.\n */\nexport const DateRangePickerTriggerSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trigger\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DateRangePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DateRangePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DateRangePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DateRangePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DateRangePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { useLocale } from \"react-aria\";\nimport { DateRangePickerStateContext } from \"react-aria-components\";\nimport type { DateRangePickerTimeInputProps } from \"../date-range-picker.types\";\n\nexport const DateRangePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DateRangePickerTimeInputProps) => {\n const { locale } = useLocale();\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n const { granularity, value } = dateRangePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousValueRef = useRef(value);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // DateRangePicker-specific: Focus the time input when date range changes (user selects dates from calendar)\n useEffect(() => {\n // DateRangePicker-specific: Check if date range changed by comparing start and end dates\n const hasValueChanged =\n (value?.start &&\n previousValueRef.current?.start?.compare(value.start) !== 0) ||\n (value?.end && previousValueRef.current?.end?.compare(value.end) !== 0);\n\n if (hasValueChanged) {\n // Small delay to ensure the DOM is ready\n setTimeout(() => {\n // Find the first focusable segment within the time input container\n const container = timeInputRef.current;\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n\n if (firstSegment) {\n firstSegment.focus();\n }\n }\n }, 50);\n }\n\n // DateRangePicker-specific: Update previous value reference for range comparison\n previousValueRef.current = value;\n }, [value]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n {/* DateRangePicker-specific: Start DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n Start time\n </Text>\n <TimeInput\n slot=\"startTimeInput\"\n locale={locale}\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n\n {/* DateRangePicker-specific: End DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n End time\n </Text>\n <TimeInput\n slot=\"endTimeInput\"\n locale={locale}\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n </Flex>\n );\n};\n","import { useContext, type ReactNode } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DateRangePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\n\nexport const DateRangePickerCustomContext = ({\n children,\n}: {\n children: ReactNode;\n}) => {\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n\n // DateRangePicker-specific: Check if all 6 segments (start: day, month, year; end: day, month, year) have values\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const hasCompleteRangeDate = (date: any) =>\n date?.day && date?.month && date?.year;\n\n const incompleteValue =\n !dateRangePickerState?.value ||\n !hasCompleteRangeDate(dateRangePickerState.value.start) ||\n !hasCompleteRangeDate(dateRangePickerState.value.end);\n\n const { granularity } = dateRangePickerState!;\n\n // DateRangePicker-specific: Extract time values from start and end dates separately\n const startTimeValue =\n dateRangePickerState?.value?.start &&\n \"hour\" in dateRangePickerState.value.start\n ? dateRangePickerState.value.start\n : null;\n const endTimeValue =\n dateRangePickerState?.value?.end && \"hour\" in dateRangePickerState.value.end\n ? dateRangePickerState.value.end\n : null;\n\n // Try to get disabled state from the button context\n const isDateRangePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = (type: \"start\" | \"end\") => {\n const prefix = type === \"start\" ? \"Start\" : \"End\";\n switch (granularity) {\n case \"hour\":\n return `${prefix} time (hour)`;\n case \"minute\":\n return `${prefix} time (hour and minute)`;\n case \"second\":\n return `${prefix} time (hour, minute, and second)`;\n default:\n return `${prefix} time`;\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n // DateRangePicker-specific: Clear both start and end values\n onPress: () => dateRangePickerState?.setValue(null),\n \"aria-label\": \"Clear input value\",\n isDisabled: isDateRangePickerDisabled,\n // Hide the button when there's no value\n style: incompleteValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": incompleteValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n // DateRangePicker-specific: Separate time input slots for start and end times\n const timeInputSlots = {\n startTimeInput: {\n value: startTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.start) {\n // DateRangePicker-specific: Update the start date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newStartDate = startDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: newStartDate,\n end: endDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"start\"),\n },\n endTimeInput: {\n value: endTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.end) {\n // DateRangePicker-specific: Update the end date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newEndDate = endDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: startDate,\n end: newEndDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"end\"),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DateRangePickerRootSlot,\n DateRangePickerGroupSlot,\n DateRangePickerTriggerSlot,\n DateRangePickerPopoverSlot,\n DateRangePickerCalendarSlot,\n} from \"./date-range-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DateRangePicker as ReactAriaDateRangePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { dateRangePickerSlotRecipe } from \"./date-range-picker.recipe\";\nimport type { DateRangePickerProps } from \"./date-range-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, RangeCalendar, IconButton, Text } from \"@/components\";\nimport { DateRangePickerTimeInput } from \"./components/date-range-picker.time-input\";\nimport { DateRangePickerCustomContext } from \"./components/date-range-picker.custom-context\";\n\n/**\n * DateRangePicker\n * ============================================================\n * Combines a DateInput with a RangeCalendar popover for date range selection.\n * Users can either type a date range directly or select from the calendar.\n */\nexport const DateRangePicker = (props: DateRangePickerProps) => {\n // Forward hideTimeZone and hourCycle to child components (footer time inputs)\n const { granularity = \"day\", hideTimeZone, hourCycle } = props;\n const recipe = useSlotRecipe({ recipe: dateRangePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // Extract size and variant from recipe props to pass to DateInputs\n const { size = \"md\" } = recipeProps;\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DateRangePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDateRangePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DateRangePickerCustomContext>\n <DateRangePickerGroupSlot asChild>\n <Group>\n <DateInput\n slot=\"start\"\n size={size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <Text\n as=\"span\"\n px=\"150\"\n color=\"neutral.11\"\n userSelect=\"none\"\n aria-hidden=\"true\"\n slot={null}\n >\n –\n </Text>\n <DateInput\n slot=\"end\"\n size={size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <DateRangePickerTriggerSlot>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </DateRangePickerTriggerSlot>\n </Group>\n </DateRangePickerGroupSlot>\n <DateRangePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DateRangePickerCalendarSlot>\n <RangeCalendar />\n </DateRangePickerCalendarSlot>\n <DateRangePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DateRangePickerPopoverSlot>\n </DateRangePickerCustomContext>\n </ReactAriaDateRangePicker>\n </DateRangePickerRootSlot>\n );\n};\n\nDateRangePicker.displayName = \"DateRangePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","dateRangePickerSlotRecipe","DateRangePickerRootSlot","DateRangePickerGroupSlot","DateRangePickerTriggerSlot","DateRangePickerPopoverSlot","DateRangePickerCalendarSlot","DateRangePickerTimeInput","hideTimeZone","hourCycle","locale","useLocale","dateRangePickerState","useContext","DateRangePickerStateContext","granularity","value","timeInputRef","useRef","previousValueRef","useEffect","container","firstSegment","jsxs","Flex","jsx","Text","TimeInput","DateRangePickerCustomContext","children","buttonContext","useSlottedContext","ButtonContext","hasCompleteRangeDate","date","incompleteValue","startTimeValue","endTimeValue","isDateRangePickerDisabled","getDefaultTimeInputAriaLabel","type","prefix","buttonSlots","event","activeElement","timeInputSlots","currentValue","startDate","endDate","newStartDate","newEndDate","Provider","TimeFieldContext","DateRangePicker","props","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","size","overlayButtonSize","shouldCloseOnSelect","ReactAriaDateRangePicker","Group","DateInput","IconButton","Close","CalendarMonth","Popover","Dialog","RangeCalendar"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,QAAQC;AACV,CAAC,GAMYC,IAA0B,gBAAAJ,EAGrC,OAAO,MAAM,GAKFK,IAA2B,gBAAAJ,EAGtC,OAAO,OAAO,GAKHK,IAA6B,gBAAAL,EAGxC,OAAO,SAAS,GAKLM,IAA6B,gBAAAN,EAGxC,OAAO,SAAS,GAKLO,IAA8B,gBAAAP,EAGzC,OAAO,UAAU,GC9DNQ,IAA2B,CAAC;AAAA,EACvC,cAAAC;AAAA,EACA,WAAAC;AACF,MAAqC;AACnC,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAuBC,EAAWC,CAA2B,GAC7D,EAAE,aAAAC,GAAa,OAAAC,EAAA,IAAUJ,GACzBK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