@commercetools/nimbus 0.0.12-rc2 → 0.0.12-rc3
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/{alert-DF3J6Yj7.cjs.js → alert-CsJON6h-.cjs.js} +2 -2
- package/dist/chunks/{alert-DF3J6Yj7.cjs.js.map → alert-CsJON6h-.cjs.js.map} +1 -1
- package/dist/chunks/{button-BfmWlfwH.cjs.js → button-CihUSHJo.cjs.js} +2 -2
- package/dist/chunks/{button-BfmWlfwH.cjs.js.map → button-CihUSHJo.cjs.js.map} +1 -1
- package/dist/chunks/{calendar-BgHBd6Dh.cjs.js → calendar-C-YasyPe.cjs.js} +2 -2
- package/dist/chunks/{calendar-BgHBd6Dh.cjs.js.map → calendar-C-YasyPe.cjs.js.map} +1 -1
- package/dist/chunks/{checkbox-BbdENF1i.cjs.js → checkbox-6DkVAh4W.cjs.js} +2 -2
- package/dist/chunks/{checkbox-BbdENF1i.cjs.js.map → checkbox-6DkVAh4W.cjs.js.map} +1 -1
- package/dist/chunks/{combobox-DIKvq4tw.cjs.js → combobox-CLGVlx_7.cjs.js} +2 -2
- package/dist/chunks/{combobox-DIKvq4tw.cjs.js.map → combobox-CLGVlx_7.cjs.js.map} +1 -1
- package/dist/chunks/{data-table-Cenvhz5D.cjs.js → data-table-B8hn0UVI.cjs.js} +2 -2
- package/dist/chunks/{data-table-Cenvhz5D.cjs.js.map → data-table-B8hn0UVI.cjs.js.map} +1 -1
- package/dist/chunks/{data-table-CWSmm1Cq.es.js → data-table-BmhYF5gH.es.js} +1 -2
- package/dist/chunks/{data-table-CWSmm1Cq.es.js.map → data-table-BmhYF5gH.es.js.map} +1 -1
- package/dist/chunks/{date-input-CKu2_a2x.cjs.js → date-input-VXO92NPV.cjs.js} +2 -2
- package/dist/chunks/{date-input-CKu2_a2x.cjs.js.map → date-input-VXO92NPV.cjs.js.map} +1 -1
- package/dist/chunks/{date-picker-DQ6_2mzc.cjs.js → date-picker-DNaxpmgh.cjs.js} +2 -2
- package/dist/chunks/{date-picker-DQ6_2mzc.cjs.js.map → date-picker-DNaxpmgh.cjs.js.map} +1 -1
- package/dist/chunks/{date-range-picker-i33UHqUE.cjs.js → date-range-picker-B5s-AFSY.cjs.js} +2 -2
- package/dist/chunks/{date-range-picker-i33UHqUE.cjs.js.map → date-range-picker-B5s-AFSY.cjs.js.map} +1 -1
- package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js → extractStyleProps-BsLft3q1.cjs.js} +2 -2
- package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js.map → extractStyleProps-BsLft3q1.cjs.js.map} +1 -1
- package/dist/chunks/{form-field-SFG0Jvp7.cjs.js → form-field-BjT4m4AE.cjs.js} +2 -2
- package/dist/chunks/{form-field-SFG0Jvp7.cjs.js.map → form-field-BjT4m4AE.cjs.js.map} +1 -1
- package/dist/chunks/{icon-button-D0NyGafI.cjs.js → icon-button-DOo2GUqd.cjs.js} +2 -2
- package/dist/chunks/{icon-button-D0NyGafI.cjs.js.map → icon-button-DOo2GUqd.cjs.js.map} +1 -1
- package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js → icon-toggle-button-DmYB27yi.cjs.js} +2 -2
- package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js.map → icon-toggle-button-DmYB27yi.cjs.js.map} +1 -1
- package/dist/chunks/{index-sFOzzmTG.cjs.js → index-BsmdMT4w.cjs.js} +2 -2
- package/dist/chunks/{index-sFOzzmTG.cjs.js.map → index-BsmdMT4w.cjs.js.map} +1 -1
- package/dist/chunks/index-Dvel3Oj5.es.js.map +1 -1
- package/dist/chunks/{menu-CImIQ6uJ.cjs.js → menu-C8il9--K.cjs.js} +2 -2
- package/dist/chunks/{menu-CImIQ6uJ.cjs.js.map → menu-C8il9--K.cjs.js.map} +1 -1
- package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js → multiline-text-input-D28clI-o.cjs.js} +2 -2
- package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js.map → multiline-text-input-D28clI-o.cjs.js.map} +1 -1
- package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js → nimbus-provider-BlfO5_bi.cjs.js} +2 -2
- package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js.map → nimbus-provider-BlfO5_bi.cjs.js.map} +1 -1
- package/dist/chunks/{number-input-CnOvkmap.cjs.js → number-input-CCEiz-4P.cjs.js} +2 -2
- package/dist/chunks/{number-input-CnOvkmap.cjs.js.map → number-input-CCEiz-4P.cjs.js.map} +1 -1
- package/dist/chunks/{password-input-DSeCpNT-.cjs.js → password-input-DY4slQHQ.cjs.js} +2 -2
- package/dist/chunks/{password-input-DSeCpNT-.cjs.js.map → password-input-DY4slQHQ.cjs.js.map} +1 -1
- package/dist/chunks/{progress-bar-CByPgKbP.cjs.js → progress-bar-0RRIR4ef.cjs.js} +2 -2
- package/dist/chunks/{progress-bar-CByPgKbP.cjs.js.map → progress-bar-0RRIR4ef.cjs.js.map} +1 -1
- package/dist/chunks/{radio-input-VMfD6a_K.cjs.js → radio-input-B40xSi6r.cjs.js} +2 -2
- package/dist/chunks/{radio-input-VMfD6a_K.cjs.js.map → radio-input-B40xSi6r.cjs.js.map} +1 -1
- package/dist/chunks/{range-calendar-CnaQY0pH.cjs.js → range-calendar-BiNek1C7.cjs.js} +2 -2
- package/dist/chunks/{range-calendar-CnaQY0pH.cjs.js.map → range-calendar-BiNek1C7.cjs.js.map} +1 -1
- package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js → rich-text-input-gNWvLb4m.cjs.js} +2 -2
- package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js.map → rich-text-input-gNWvLb4m.cjs.js.map} +1 -1
- package/dist/chunks/{select-DT9EbJgb.cjs.js → select-BuXA5VgT.cjs.js} +2 -2
- package/dist/chunks/{select-DT9EbJgb.cjs.js.map → select-BuXA5VgT.cjs.js.map} +1 -1
- package/dist/chunks/{split-button-i2Ezbf3P.cjs.js → split-button-CgQYMeH7.cjs.js} +2 -2
- package/dist/chunks/{split-button-i2Ezbf3P.cjs.js.map → split-button-CgQYMeH7.cjs.js.map} +1 -1
- package/dist/chunks/{switch-kNksAQM3.cjs.js → switch-BQXiI02l.cjs.js} +2 -2
- package/dist/chunks/{switch-kNksAQM3.cjs.js.map → switch-BQXiI02l.cjs.js.map} +1 -1
- package/dist/chunks/{tag-group-iRBYcxt6.cjs.js → tag-group-DwTq8DeA.cjs.js} +2 -2
- package/dist/chunks/{tag-group-iRBYcxt6.cjs.js.map → tag-group-DwTq8DeA.cjs.js.map} +1 -1
- package/dist/chunks/{text-input-D7SdSWpG.cjs.js → text-input-DJUpcp3k.cjs.js} +2 -2
- package/dist/chunks/{text-input-D7SdSWpG.cjs.js.map → text-input-DJUpcp3k.cjs.js.map} +1 -1
- package/dist/chunks/{time-input-BqTsxXMD.cjs.js → time-input-B5oRiIpu.cjs.js} +2 -2
- package/dist/chunks/{time-input-BqTsxXMD.cjs.js.map → time-input-B5oRiIpu.cjs.js.map} +1 -1
- package/dist/chunks/{toggle-button-CsVyAh8N.cjs.js → toggle-button-C_7Evcn3.cjs.js} +2 -2
- package/dist/chunks/{toggle-button-CsVyAh8N.cjs.js.map → toggle-button-C_7Evcn3.cjs.js.map} +1 -1
- package/dist/chunks/{toolbar-DcUEC_uE.cjs.js → toolbar-BUYkQMPz.cjs.js} +2 -2
- package/dist/chunks/{toolbar-DcUEC_uE.cjs.js.map → toolbar-BUYkQMPz.cjs.js.map} +1 -1
- package/dist/components/alert.cjs +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/components.cjs +1 -1
- package/dist/components/components.es.js +1 -1
- package/dist/components/data-table.cjs +1 -1
- package/dist/components/data-table.es.js +1 -1
- package/dist/components/date-input.cjs +1 -1
- package/dist/components/date-picker.cjs +1 -1
- package/dist/components/date-range-picker.cjs +1 -1
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/icon-button.cjs +1 -1
- package/dist/components/icon-toggle-button.cjs +1 -1
- package/dist/components/multiline-text-input.cjs +1 -1
- package/dist/components/nimbus-provider.cjs +1 -1
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/password-input.cjs +1 -1
- package/dist/components/progress-bar.cjs +1 -1
- package/dist/components/radio-input.cjs +1 -1
- package/dist/components/range-calendar.cjs +1 -1
- package/dist/components/rich-text-input.cjs +1 -1
- package/dist/components/select.cjs +1 -1
- package/dist/components/split-button.cjs +1 -1
- package/dist/components/switch.cjs +1 -1
- package/dist/components/tag-group.cjs +1 -1
- package/dist/components/text-input.cjs +1 -1
- package/dist/components/time-input.cjs +1 -1
- package/dist/components/toggle-button.cjs +1 -1
- package/dist/components/toolbar.cjs +1 -1
- package/dist/components.d.ts +35 -35
- package/dist/data-table.d.ts +35 -35
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +35 -35
- package/dist/index.es.js +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),s=require("react"),P=require("./config-Mt8_uyhI.cjs.js"),R=require("./create-slot-recipe-context-CimocFDH.cjs.js"),b=require("./box-BwCVnAwb.cjs.js"),B=require("./stack-BG0j9HvT.cjs.js"),r=require("@commercetools/nimbus-icons"),N=require("./icon-button-
|
|
2
|
-
//# sourceMappingURL=alert-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),s=require("react"),P=require("./config-Mt8_uyhI.cjs.js"),R=require("./create-slot-recipe-context-CimocFDH.cjs.js"),b=require("./box-BwCVnAwb.cjs.js"),B=require("./stack-BG0j9HvT.cjs.js"),r=require("@commercetools/nimbus-icons"),N=require("./icon-button-DOo2GUqd.cjs.js"),T=P.defineSlotRecipe({slots:["root","title","description","icon","actions","dismissButton"],className:"nimbus-alert",base:{root:{display:"inline-flex",flexDirection:"row",gap:"200",width:"100%"},icon:{marginTop:"50","& svg":{width:"500",height:"500",color:"colorPalette.11"}},title:{color:"colorPalette.11"},description:{color:"colorPalette.11"}},variants:{tone:{critical:{root:{colorPalette:"critical"}},info:{root:{colorPalette:"info"}},warning:{root:{colorPalette:"amber"}},positive:{root:{colorPalette:"positive"}}},variant:{flat:{},outlined:{root:{border:"solid-25",borderColor:"colorPalette.5",backgroundColor:"colorPalette.2",padding:"200",borderRadius:"200"}}}}}),{withProvider:E,withContext:l}=R.createSlotRecipeContext({recipe:T}),q=E("div","root"),w=l("div","title"),S=l("div","description"),y=l("div","icon"),I=l("div","actions"),$=l("div","dismissButton"),k=o=>{switch(o){case"critical":return e.jsx(r.ErrorOutline,{});case"info":return e.jsx(r.Info,{});case"warning":return e.jsx(r.WarningAmber,{});case"positive":return e.jsx(r.CheckCircleOutline,{});default:return null}},c=s.createContext(void 0),a=o=>{const{ref:i,children:t,...n}=o,[v,m]=s.useState(null),[g,f]=s.useState(null),[j,p]=s.useState(null),[h,D]=s.useState(null),C=s.useMemo(()=>({setTitle:m,setDescription:f,setActions:p,setDismiss:D}),[m,f,p,D]);return e.jsx(c.Provider,{value:C,children:e.jsxs(q,{ref:i,...n,role:"alert",children:[e.jsx(y,{alignItems:"flex-start",children:k(n.tone)}),e.jsxs(B.Stack,{flex:"1",gap:"200",children:[e.jsxs(b.Box,{children:[v,g]}),j]}),h,t]})})};a.displayName="Alert.Root";const u=({children:o,...i})=>{const t=s.useContext(c);return s.useEffect(()=>{if(t){const n=e.jsx(w,{...i,fontWeight:"600",children:o});return t.setTitle(n),()=>t.setTitle(null)}},[o,i]),null};u.displayName="Alert.Title";const d=({children:o,...i})=>{const t=s.useContext(c);return s.useEffect(()=>{if(t){const n=e.jsx(S,{...i,children:o});return t.setDescription(n),()=>t.setDescription(null)}},[o,i]),null};d.displayName="Alert.Description";const x=({children:o,...i})=>{const t=s.useContext(c);return s.useEffect(()=>{if(t){const n=e.jsx(I,{...i,children:o});return t.setActions(n),()=>t.setActions(null)}},[o,i]),null};x.displayName="Alert.Actions";const A=({children:o,...i})=>{const t=s.useContext(c);return s.useEffect(()=>{if(t){const n=e.jsx($,{children:e.jsx(N.IconButton,{"aria-label":"Dismiss",...i,variant:"ghost",size:"2xs",children:e.jsx(r.Clear,{role:"img"})})});return t.setDismiss(n),()=>t.setDismiss(null)}},[o,i]),null};A.displayName="Alert.DismissButton";const O={Root:a,Title:u,Description:d,Actions:x,DismissButton:A};exports.Alert=O;exports.AlertActions=x;exports.AlertDescription=d;exports.AlertDismissButton=A;exports.AlertRoot=a;exports.AlertTitle=u;
|
|
2
|
+
//# sourceMappingURL=alert-CsJON6h-.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-DF3J6Yj7.cjs.js","sources":["../../src/components/alert/alert.recipe.tsx","../../src/components/alert/alert.slots.tsx","../../src/components/alert/components/alert.root.tsx","../../src/components/alert/components/alert.title.tsx","../../src/components/alert/components/alert.description.tsx","../../src/components/alert/components/alert.actions.tsx","../../src/components/alert/components/alert.dismiss-button.tsx","../../src/components/alert/alert.tsx"],"sourcesContent":["import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n/**\n * Recipe configuration for the Alert component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const alertRecipe = defineSlotRecipe({\n slots: [\"root\", \"title\", \"description\", \"icon\", \"actions\", \"dismissButton\"],\n // Unique class name prefix for the component\n className: \"nimbus-alert\",\n\n // Base styles applied to all instances of the component\n base: {\n root: {\n display: \"inline-flex\",\n flexDirection: \"row\",\n gap: \"200\",\n width: \"100%\",\n },\n icon: {\n marginTop: \"50\",\n \"& svg\": {\n width: \"500\",\n height: \"500\",\n color: \"colorPalette.11\",\n },\n },\n title: {\n color: \"colorPalette.11\",\n },\n description: {\n color: \"colorPalette.11\",\n },\n },\n\n variants: {\n tone: {\n critical: {\n root: { colorPalette: \"critical\" },\n },\n info: {\n root: { colorPalette: \"info\" },\n },\n warning: {\n root: { colorPalette: \"amber\" },\n },\n positive: {\n root: { colorPalette: \"positive\" },\n },\n },\n\n variant: {\n flat: {},\n outlined: {\n root: {\n border: \"solid-25\",\n borderColor: \"colorPalette.5\",\n backgroundColor: \"colorPalette.2\",\n padding: \"200\",\n borderRadius: \"200\",\n },\n },\n },\n },\n});\n","import { createSlotRecipeContext } from \"@chakra-ui/react/styled-system\";\nimport { alertRecipe } from \"./alert.recipe\";\nimport type {\n AlertActionsProps,\n AlertDescriptionProps,\n AlertDismissButtonProps,\n AlertIconProps,\n AlertRootProps,\n AlertTitleProps,\n} from \"./alert.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: alertRecipe,\n});\n\nexport const AlertRoot = withProvider<HTMLDivElement, AlertRootProps>(\n \"div\",\n \"root\"\n);\n\nexport const AlertTitle = withContext<HTMLDivElement, AlertTitleProps>(\n \"div\",\n \"title\"\n);\n\nexport const AlertDescription = withContext<\n HTMLDivElement,\n AlertDescriptionProps\n>(\"div\", \"description\");\n\nexport const AlertIcon = withContext<HTMLDivElement, AlertIconProps>(\n \"div\",\n \"icon\"\n);\n\nexport const AlertActions = withContext<HTMLDivElement, AlertActionsProps>(\n \"div\",\n \"actions\"\n);\n\n// This is a div wrapper for layout placement - note that we expect it to receive `IconButton` props, but we use a `div`.\n// We then forward the consumer props to the interior `IconButton` component.\nexport const AlertDismissButton = withContext<\n HTMLDivElement,\n AlertDismissButtonProps\n>(\"div\", \"dismissButton\");\n","import { createContext, useMemo, useState, type ReactNode } from \"react\";\nimport { AlertRoot as AlertRootSlot, AlertIcon } from \"../alert.slots\";\nimport type { AlertProps, AlertRootComponent } from \"../alert.types\";\nimport { Box } from \"../../box\";\nimport { Stack } from \"../../stack\";\nimport {\n CheckCircleOutline,\n ErrorOutline,\n Info,\n WarningAmber,\n} from \"@commercetools/nimbus-icons\";\n\nconst getIconFromTone = (tone: AlertProps[\"tone\"]) => {\n switch (tone) {\n case \"critical\":\n return <ErrorOutline />;\n case \"info\":\n return <Info />;\n case \"warning\":\n return <WarningAmber />;\n case \"positive\":\n return <CheckCircleOutline />;\n default:\n return null;\n }\n};\n\ntype AlertContextValue = {\n setTitle: (title: ReactNode) => void;\n setDescription: (description: ReactNode) => void;\n setActions: (actions: ReactNode) => void;\n setDismiss: (dismiss: ReactNode) => void;\n};\n\nexport const AlertContext = createContext<AlertContextValue | undefined>(\n undefined\n);\n\n/**\n * # Alert\n *\n * Provides feedback to the user about the status of an action or system event\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/feedback/alert}\n */\nexport const AlertRoot: AlertRootComponent = (props) => {\n const { ref, children, ...restProps } = props;\n const [titleNode, setTitle] = useState<ReactNode>(null);\n const [descriptionNode, setDescription] = useState<ReactNode>(null);\n const [actionsNode, setActions] = useState<ReactNode>(null);\n const [dismissNode, setDismiss] = useState<ReactNode>(null);\n\n // Memoize the context value so we don't cause unnecessary re-renders\n const contextValue = useMemo(\n () => ({\n setTitle,\n setDescription,\n setActions,\n setDismiss,\n }),\n [setTitle, setDescription, setActions, setDismiss]\n );\n\n return (\n <AlertContext.Provider value={contextValue}>\n <AlertRootSlot ref={ref} {...restProps} role=\"alert\">\n <AlertIcon alignItems=\"flex-start\">\n {getIconFromTone(restProps.tone)}\n </AlertIcon>\n <Stack flex=\"1\" gap=\"200\">\n <Box>\n {titleNode}\n {descriptionNode}\n </Box>\n {actionsNode}\n </Stack>\n {dismissNode}\n\n {children}\n </AlertRootSlot>\n </AlertContext.Provider>\n );\n};\n\nAlertRoot.displayName = \"Alert.Root\";\n","import { useContext, useEffect } from \"react\";\nimport { AlertTitle as AlertTitleSlot } from \"../alert.slots\";\nimport type { AlertTitleProps } from \"../alert.types\";\nimport { AlertContext } from \"./alert.root\";\n\nexport const AlertTitle = ({ children, ...props }: AlertTitleProps) => {\n const context = useContext(AlertContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <AlertTitleSlot {...props} fontWeight=\"600\">\n {children}\n </AlertTitleSlot>\n );\n // Register it with the parent\n context.setTitle(slotElement);\n\n // On unmount, remove it\n return () => context.setTitle(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nAlertTitle.displayName = \"Alert.Title\";\n","import { useContext, useEffect } from \"react\";\nimport { AlertDescription as AlertDescriptionSlot } from \"../alert.slots\";\nimport type { AlertDescriptionProps } from \"../alert.types\";\nimport { AlertContext } from \"./alert.root\";\n\nexport const AlertDescription = ({\n children,\n ...props\n}: AlertDescriptionProps) => {\n const context = useContext(AlertContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <AlertDescriptionSlot {...props}>{children}</AlertDescriptionSlot>\n );\n // Register it with the parent\n context.setDescription(slotElement);\n\n // On unmount, remove it\n return () => context.setDescription(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nAlertDescription.displayName = \"Alert.Description\";\n","import { useContext, useEffect } from \"react\";\nimport { AlertActions as AlertActionsSlot } from \"../alert.slots\";\nimport type { AlertActionsProps } from \"../alert.types\";\nimport { AlertContext } from \"./alert.root\";\n\nexport const AlertActions = ({ children, ...props }: AlertActionsProps) => {\n const context = useContext(AlertContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <AlertActionsSlot {...props}>{children}</AlertActionsSlot>\n );\n // Register it with the parent\n context.setActions(slotElement);\n\n // On unmount, remove it\n return () => context.setActions(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nAlertActions.displayName = \"Alert.Actions\";\n","import { useContext, useEffect } from \"react\";\nimport { AlertDismissButton as AlertDismissButtonSlot } from \"../alert.slots\";\nimport type { AlertDismissButtonProps } from \"../alert.types\";\nimport { Clear } from \"@commercetools/nimbus-icons\";\nimport { IconButton } from \"../../icon-button\";\nimport { AlertContext } from \"./alert.root\";\n\nexport const AlertDismissButton = ({\n children,\n ...props\n}: AlertDismissButtonProps) => {\n const context = useContext(AlertContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <AlertDismissButtonSlot>\n <IconButton\n aria-label=\"Dismiss\"\n {...props}\n variant=\"ghost\"\n size=\"2xs\"\n >\n <Clear role=\"img\" />\n </IconButton>\n </AlertDismissButtonSlot>\n );\n // Register it with the parent\n context.setDismiss(slotElement);\n\n // On unmount, remove it\n return () => context.setDismiss(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nAlertDismissButton.displayName = \"Alert.DismissButton\";\n","import { AlertTitle } from \"./components/alert.title\";\nimport { AlertDescription } from \"./components/alert.description\";\nimport { AlertActions } from \"./components/alert.actions\";\nimport { AlertDismissButton } from \"./components/alert.dismiss-button\";\nimport { AlertRoot } from \"./components/alert.root\";\n\n/**\n * Alert\n * ============================================================\n * Provides feedback to the user about the status of an action or system event\n */\nexport const Alert = {\n Root: AlertRoot,\n Title: AlertTitle,\n Description: AlertDescription,\n Actions: AlertActions,\n DismissButton: AlertDismissButton,\n};\n\n// exports for internal use by react-docgen\nexport {\n AlertRoot as _AlertRoot,\n AlertTitle as _AlertTitle,\n AlertDescription as _AlertDescription,\n AlertActions as _AlertActions,\n AlertDismissButton as _AlertDismissButton,\n};\n"],"names":["alertRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","AlertRoot","AlertTitle","AlertDescription","AlertIcon","AlertActions","AlertDismissButton","getIconFromTone","tone","ErrorOutline","Info","WarningAmber","CheckCircleOutline","AlertContext","createContext","props","ref","children","restProps","titleNode","setTitle","useState","descriptionNode","setDescription","actionsNode","setActions","dismissNode","setDismiss","contextValue","useMemo","jsx","jsxs","AlertRootSlot","Stack","Box","context","useContext","useEffect","slotElement","AlertTitleSlot","AlertDescriptionSlot","AlertActionsSlot","AlertDismissButtonSlot","IconButton","Clear","Alert"],"mappings":"iUAKaA,EAAcC,EAAAA,iBAAiB,CAC1C,MAAO,CAAC,OAAQ,QAAS,cAAe,OAAQ,UAAW,eAAe,EAE1E,UAAW,eAGX,KAAM,CACJ,KAAM,CACJ,QAAS,cACT,cAAe,MACf,IAAK,MACL,MAAO,MAAA,EAET,KAAM,CACJ,UAAW,KACX,QAAS,CACP,MAAO,MACP,OAAQ,MACR,MAAO,iBAAA,CACT,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,EAG7C,OAAAkB,EAAQ,eAAeG,CAAW,EAG3B,IAAMH,EAAQ,eAAe,IAAI,CAC1C,CACF,EAAG,CAAClB,EAAUF,CAAK,CAAC,EAEb,IACT,EAEAZ,EAAiB,YAAc,oBCtBxB,MAAME,EAAe,CAAC,CAAE,SAAAY,EAAU,GAAGF,KAA+B,CACzE,MAAMoB,EAAUC,EAAAA,WAAWvB,CAAY,EAEvCwB,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAIF,EAAS,CACX,MAAMG,EACJR,EAAAA,IAACW,EAAA,CAAkB,GAAG1B,EAAQ,SAAAE,EAAS,EAGzC,OAAAkB,EAAQ,WAAWG,CAAW,EAGvB,IAAMH,EAAQ,WAAW,IAAI,CACtC,CACF,EAAG,CAAClB,EAAUF,CAAK,CAAC,EAEb,IACT,EAEAV,EAAa,YAAc,gBCjBpB,MAAMC,EAAqB,CAAC,CACjC,SAAAW,EACA,GAAGF,CACL,IAA+B,CAC7B,MAAMoB,EAAUC,EAAAA,WAAWvB,CAAY,EAEvCwB,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAIF,EAAS,CACX,MAAMG,QACHI,EAAA,CACC,SAAAZ,EAAAA,IAACa,EAAAA,WAAA,CACC,aAAW,UACV,GAAG5B,EACJ,QAAQ,QACR,KAAK,MAEL,SAAAe,EAAAA,IAACc,EAAAA,MAAA,CAAM,KAAK,KAAA,CAAM,CAAA,CAAA,EAEtB,EAGF,OAAAT,EAAQ,WAAWG,CAAW,EAGvB,IAAMH,EAAQ,WAAW,IAAI,CACtC,CACF,EAAG,CAAClB,EAAUF,CAAK,CAAC,EAEb,IACT,EAEAT,EAAmB,YAAc,sBC3B1B,MAAMuC,EAAQ,CACnB,KAAM5C,EACN,MAAOC,EACP,YAAaC,EACb,QAASE,EACT,cAAeC,CACjB"}
|
|
1
|
+
{"version":3,"file":"alert-CsJON6h-.cjs.js","sources":["../../src/components/alert/alert.recipe.tsx","../../src/components/alert/alert.slots.tsx","../../src/components/alert/components/alert.root.tsx","../../src/components/alert/components/alert.title.tsx","../../src/components/alert/components/alert.description.tsx","../../src/components/alert/components/alert.actions.tsx","../../src/components/alert/components/alert.dismiss-button.tsx","../../src/components/alert/alert.tsx"],"sourcesContent":["import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n/**\n * Recipe configuration for the Alert component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const alertRecipe = defineSlotRecipe({\n slots: [\"root\", \"title\", \"description\", \"icon\", \"actions\", \"dismissButton\"],\n // Unique class name prefix for the component\n className: \"nimbus-alert\",\n\n // Base styles applied to all instances of the component\n base: {\n root: {\n display: \"inline-flex\",\n flexDirection: \"row\",\n gap: \"200\",\n width: \"100%\",\n },\n icon: {\n marginTop: \"50\",\n \"& svg\": {\n width: \"500\",\n height: \"500\",\n color: \"colorPalette.11\",\n },\n },\n title: {\n color: \"colorPalette.11\",\n },\n description: {\n color: \"colorPalette.11\",\n },\n },\n\n variants: {\n tone: {\n critical: {\n root: { colorPalette: \"critical\" },\n },\n info: {\n root: { colorPalette: \"info\" },\n },\n warning: {\n root: { colorPalette: \"amber\" },\n },\n positive: {\n root: { colorPalette: \"positive\" },\n },\n },\n\n variant: {\n flat: {},\n outlined: {\n root: {\n border: \"solid-25\",\n borderColor: \"colorPalette.5\",\n backgroundColor: \"colorPalette.2\",\n padding: \"200\",\n borderRadius: \"200\",\n },\n },\n },\n },\n});\n","import { createSlotRecipeContext } from \"@chakra-ui/react/styled-system\";\nimport { alertRecipe } from \"./alert.recipe\";\nimport type {\n AlertActionsProps,\n AlertDescriptionProps,\n AlertDismissButtonProps,\n AlertIconProps,\n AlertRootProps,\n AlertTitleProps,\n} from \"./alert.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: alertRecipe,\n});\n\nexport const AlertRoot = withProvider<HTMLDivElement, AlertRootProps>(\n \"div\",\n \"root\"\n);\n\nexport const AlertTitle = withContext<HTMLDivElement, AlertTitleProps>(\n \"div\",\n \"title\"\n);\n\nexport const AlertDescription = withContext<\n HTMLDivElement,\n AlertDescriptionProps\n>(\"div\", \"description\");\n\nexport const AlertIcon = withContext<HTMLDivElement, AlertIconProps>(\n \"div\",\n \"icon\"\n);\n\nexport const AlertActions = withContext<HTMLDivElement, AlertActionsProps>(\n \"div\",\n \"actions\"\n);\n\n// This is a div wrapper for layout placement - note that we expect it to receive `IconButton` props, but we use a `div`.\n// We then forward the consumer props to the interior `IconButton` component.\nexport const AlertDismissButton = withContext<\n HTMLDivElement,\n AlertDismissButtonProps\n>(\"div\", \"dismissButton\");\n","import { createContext, useMemo, useState, type ReactNode } from \"react\";\nimport { AlertRoot as AlertRootSlot, AlertIcon } from \"../alert.slots\";\nimport type { AlertProps, AlertRootComponent } from \"../alert.types\";\nimport { Box } from \"../../box\";\nimport { Stack } from \"../../stack\";\nimport {\n CheckCircleOutline,\n ErrorOutline,\n Info,\n WarningAmber,\n} from \"@commercetools/nimbus-icons\";\n\nconst getIconFromTone = (tone: AlertProps[\"tone\"]) => {\n switch (tone) {\n case \"critical\":\n return <ErrorOutline />;\n case \"info\":\n return <Info />;\n case \"warning\":\n return <WarningAmber />;\n case \"positive\":\n return <CheckCircleOutline />;\n default:\n return null;\n }\n};\n\ntype AlertContextValue = {\n setTitle: (title: ReactNode) => void;\n setDescription: (description: ReactNode) => void;\n setActions: (actions: ReactNode) => void;\n setDismiss: (dismiss: ReactNode) => void;\n};\n\nexport const AlertContext = createContext<AlertContextValue | undefined>(\n undefined\n);\n\n/**\n * # Alert\n *\n * Provides feedback to the user about the status of an action or system event\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/feedback/alert}\n */\nexport const AlertRoot: AlertRootComponent = (props) => {\n const { ref, children, ...restProps } = props;\n const [titleNode, setTitle] = useState<ReactNode>(null);\n const [descriptionNode, setDescription] = useState<ReactNode>(null);\n const [actionsNode, setActions] = useState<ReactNode>(null);\n const [dismissNode, setDismiss] = useState<ReactNode>(null);\n\n // Memoize the context value so we don't cause unnecessary re-renders\n const contextValue = useMemo(\n () => ({\n setTitle,\n setDescription,\n setActions,\n setDismiss,\n }),\n [setTitle, setDescription, setActions, setDismiss]\n );\n\n return (\n <AlertContext.Provider value={contextValue}>\n <AlertRootSlot ref={ref} {...restProps} role=\"alert\">\n <AlertIcon alignItems=\"flex-start\">\n {getIconFromTone(restProps.tone)}\n </AlertIcon>\n <Stack flex=\"1\" gap=\"200\">\n <Box>\n {titleNode}\n {descriptionNode}\n </Box>\n {actionsNode}\n </Stack>\n {dismissNode}\n\n {children}\n </AlertRootSlot>\n </AlertContext.Provider>\n );\n};\n\nAlertRoot.displayName = \"Alert.Root\";\n","import { useContext, useEffect } from \"react\";\nimport { AlertTitle as AlertTitleSlot } from \"../alert.slots\";\nimport type { AlertTitleProps } from \"../alert.types\";\nimport { AlertContext } from \"./alert.root\";\n\nexport const AlertTitle = ({ children, ...props }: AlertTitleProps) => {\n const context = useContext(AlertContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <AlertTitleSlot {...props} fontWeight=\"600\">\n {children}\n </AlertTitleSlot>\n );\n // Register it with the parent\n context.setTitle(slotElement);\n\n // On unmount, remove it\n return () => context.setTitle(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nAlertTitle.displayName = \"Alert.Title\";\n","import { useContext, useEffect } from \"react\";\nimport { AlertDescription as AlertDescriptionSlot } from \"../alert.slots\";\nimport type { AlertDescriptionProps } from \"../alert.types\";\nimport { AlertContext } from \"./alert.root\";\n\nexport const AlertDescription = ({\n children,\n ...props\n}: AlertDescriptionProps) => {\n const context = useContext(AlertContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <AlertDescriptionSlot {...props}>{children}</AlertDescriptionSlot>\n );\n // Register it with the parent\n context.setDescription(slotElement);\n\n // On unmount, remove it\n return () => context.setDescription(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nAlertDescription.displayName = \"Alert.Description\";\n","import { useContext, useEffect } from \"react\";\nimport { AlertActions as AlertActionsSlot } from \"../alert.slots\";\nimport type { AlertActionsProps } from \"../alert.types\";\nimport { AlertContext } from \"./alert.root\";\n\nexport const AlertActions = ({ children, ...props }: AlertActionsProps) => {\n const context = useContext(AlertContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <AlertActionsSlot {...props}>{children}</AlertActionsSlot>\n );\n // Register it with the parent\n context.setActions(slotElement);\n\n // On unmount, remove it\n return () => context.setActions(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nAlertActions.displayName = \"Alert.Actions\";\n","import { useContext, useEffect } from \"react\";\nimport { AlertDismissButton as AlertDismissButtonSlot } from \"../alert.slots\";\nimport type { AlertDismissButtonProps } from \"../alert.types\";\nimport { Clear } from \"@commercetools/nimbus-icons\";\nimport { IconButton } from \"../../icon-button\";\nimport { AlertContext } from \"./alert.root\";\n\nexport const AlertDismissButton = ({\n children,\n ...props\n}: AlertDismissButtonProps) => {\n const context = useContext(AlertContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <AlertDismissButtonSlot>\n <IconButton\n aria-label=\"Dismiss\"\n {...props}\n variant=\"ghost\"\n size=\"2xs\"\n >\n <Clear role=\"img\" />\n </IconButton>\n </AlertDismissButtonSlot>\n );\n // Register it with the parent\n context.setDismiss(slotElement);\n\n // On unmount, remove it\n return () => context.setDismiss(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nAlertDismissButton.displayName = \"Alert.DismissButton\";\n","import { AlertTitle } from \"./components/alert.title\";\nimport { AlertDescription } from \"./components/alert.description\";\nimport { AlertActions } from \"./components/alert.actions\";\nimport { AlertDismissButton } from \"./components/alert.dismiss-button\";\nimport { AlertRoot } from \"./components/alert.root\";\n\n/**\n * Alert\n * ============================================================\n * Provides feedback to the user about the status of an action or system event\n */\nexport const Alert = {\n Root: AlertRoot,\n Title: AlertTitle,\n Description: AlertDescription,\n Actions: AlertActions,\n DismissButton: AlertDismissButton,\n};\n\n// exports for internal use by react-docgen\nexport {\n AlertRoot as _AlertRoot,\n AlertTitle as _AlertTitle,\n AlertDescription as _AlertDescription,\n AlertActions as _AlertActions,\n AlertDismissButton as _AlertDismissButton,\n};\n"],"names":["alertRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","AlertRoot","AlertTitle","AlertDescription","AlertIcon","AlertActions","AlertDismissButton","getIconFromTone","tone","ErrorOutline","Info","WarningAmber","CheckCircleOutline","AlertContext","createContext","props","ref","children","restProps","titleNode","setTitle","useState","descriptionNode","setDescription","actionsNode","setActions","dismissNode","setDismiss","contextValue","useMemo","jsx","jsxs","AlertRootSlot","Stack","Box","context","useContext","useEffect","slotElement","AlertTitleSlot","AlertDescriptionSlot","AlertActionsSlot","AlertDismissButtonSlot","IconButton","Clear","Alert"],"mappings":"iUAKaA,EAAcC,EAAAA,iBAAiB,CAC1C,MAAO,CAAC,OAAQ,QAAS,cAAe,OAAQ,UAAW,eAAe,EAE1E,UAAW,eAGX,KAAM,CACJ,KAAM,CACJ,QAAS,cACT,cAAe,MACf,IAAK,MACL,MAAO,MAAA,EAET,KAAM,CACJ,UAAW,KACX,QAAS,CACP,MAAO,MACP,OAAQ,MACR,MAAO,iBAAA,CACT,EAEF,MAAO,CACL,MAAO,iBAAA,EAET,YAAa,CACX,MAAO,iBAAA,CACT,EAGF,SAAU,CACR,KAAM,CACJ,SAAU,CACR,KAAM,CAAE,aAAc,UAAA,CAAW,EAEnC,KAAM,CACJ,KAAM,CAAE,aAAc,MAAA,CAAO,EAE/B,QAAS,CACP,KAAM,CAAE,aAAc,OAAA,CAAQ,EAEhC,SAAU,CACR,KAAM,CAAE,aAAc,UAAA,CAAW,CACnC,EAGF,QAAS,CACP,KAAM,CAAA,EACN,SAAU,CACR,KAAM,CACJ,OAAQ,WACR,YAAa,iBACb,gBAAiB,iBACjB,QAAS,MACT,aAAc,KAAA,CAChB,CACF,CACF,CAEJ,CAAC,ECpDK,CAAE,aAAAC,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQJ,CACV,CAAC,EAEYK,EAAYH,E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MAAMC,EAAqB,CAAC,CACjC,SAAAW,EACA,GAAGF,CACL,IAA+B,CAC7B,MAAMoB,EAAUC,EAAAA,WAAWvB,CAAY,EAEvCwB,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAIF,EAAS,CACX,MAAMG,QACHI,EAAA,CACC,SAAAZ,EAAAA,IAACa,EAAAA,WAAA,CACC,aAAW,UACV,GAAG5B,EACJ,QAAQ,QACR,KAAK,MAEL,SAAAe,EAAAA,IAACc,EAAAA,MAAA,CAAM,KAAK,KAAA,CAAM,CAAA,CAAA,EAEtB,EAGF,OAAAT,EAAQ,WAAWG,CAAW,EAGvB,IAAMH,EAAQ,WAAW,IAAI,CACtC,CACF,EAAG,CAAClB,EAAUF,CAAK,CAAC,EAEb,IACT,EAEAT,EAAmB,YAAc,sBC3B1B,MAAMuC,EAAQ,CACnB,KAAM5C,EACN,MAAOC,EACP,YAAaC,EACb,QAASE,EACT,cAAeC,CACjB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const b=require("react/jsx-runtime"),p=require("react"),$=require("./Button-BtJHe9xY.cjs.js"),q=require("./utils-BHdR5Nww.cjs.js"),x=require("@chakra-ui/react"),R=require("./button.recipe-ClPhJ93N.cjs.js"),P=require("./factory-CVGqU9CD.cjs.js"),m=require("./index-
|
|
2
|
-
//# sourceMappingURL=button-
|
|
1
|
+
"use strict";const b=require("react/jsx-runtime"),p=require("react"),$=require("./Button-BtJHe9xY.cjs.js"),q=require("./utils-BHdR5Nww.cjs.js"),x=require("@chakra-ui/react"),R=require("./button.recipe-ClPhJ93N.cjs.js"),P=require("./factory-CVGqU9CD.cjs.js"),m=require("./index-BsmdMT4w.cjs.js"),y=require("./create-recipe-context-bXYFTZLs.cjs.js"),B=require("./useObjectRef-dXOJdONs.cjs.js"),h=require("./mergeProps-BA5Cwf5w.cjs.js"),C=require("./useButton-BgBfaV_L.cjs.js"),{withContext:j}=y.createRecipeContext({recipe:R.buttonRecipe}),v=j("button",{defaultProps:{type:"button"},shouldForwardProp(e,o){const t=!o?.includes(e)&&!m.system.isValidProperty(e);return P.isPropValid(e)&&t&&!e.includes("onPress")}}),i=e=>{const{ref:o,as:t,asChild:n,children:u,...a}=e,d=p.useRef(null),r=B.$df56164dff5785e2$export$4338b53315abf666(x.mergeRefs(d,o)),[s]=q.$64fa3d84918910a7$export$29f1550f4b0d4415(a,r,$.$d2b4bc8c273e7be6$export$24d547caef80ccd1),f=t||(n?"a":"button"),{buttonProps:l}=C.$701a24aa0da5b062$export$ea18c227d4417cc3({...s,elementType:f},r),c=h.$3ef42575df84b30b$export$9d1611c77c2fe928(s,l,{as:t,asChild:n,slot:s.slot||void 0});return b.jsx(v,{ref:r,...c,"aria-disabled":c.isDisabled||void 0,"data-disabled":c.isDisabled||void 0,children:u})};i.displayName="Button";exports.Button=i;
|
|
2
|
+
//# sourceMappingURL=button-CihUSHJo.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-
|
|
1
|
+
{"version":3,"file":"button-CihUSHJo.cjs.js","sources":["../../src/components/button/button.slots.tsx","../../src/components/button/button.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\nimport { buttonRecipe } from \"./button.recipe\";\nimport shouldForwardProp from \"@emotion/is-prop-valid\";\nimport { system } from \"@/theme\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the button element.\n */\ninterface ButtonRecipeProps extends RecipeProps<\"button\">, 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 */\nexport interface ButtonRootProps\n extends Omit<HTMLChakraProps<\"button\", ButtonRecipeProps>, \"slot\"> {\n // insure that the `ButtonRoot` component doesn't give a type error\n slot?: string | null | undefined;\n}\n\nconst { withContext } = createRecipeContext({\n recipe: buttonRecipe,\n});\n\n/**\n * Root component that provides the styling context for the Button component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const ButtonRoot = withContext<HTMLButtonElement, ButtonRootProps>(\n \"button\",\n {\n defaultProps: {\n type: \"button\",\n },\n /** make sure the `onPress` properties won't end up as attribute on the rendered DOM element */\n shouldForwardProp(prop, variantKeys) {\n const chakraSfp =\n !variantKeys?.includes(prop) && !system.isValidProperty(prop);\n return shouldForwardProp(prop) && chakraSfp && !prop.includes(\"onPress\");\n },\n }\n);\n","import { useRef } from \"react\";\nimport { useButton, useObjectRef, mergeProps } from \"react-aria\";\nimport { ButtonContext, useContextProps } from \"react-aria-components\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { ButtonRoot } from \"./button.slots.tsx\";\nimport type { ButtonProps } from \"./button.types.ts\";\n\n/**\n * # Button\n *\n * Displays a Button.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/button}\n */\nexport const Button = (props: ButtonProps) => {\n const { ref: forwardedRef, as, asChild, children, ...rest } = props;\n\n // create a local ref (because the consumer may not provide a forwardedRef)\n const localRef = useRef<HTMLButtonElement>(null);\n // merge the local ref with a potentially forwarded ref\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n\n // Consume context props based on slot (this enables slot-aware behavior)\n const [contextProps] = useContextProps(rest, ref, ButtonContext);\n\n // if asChild is set, for react-aria to add the button-role, the elementType\n // has to be manually set to something else than button\n\n const elementType = as || (asChild ? \"a\" : \"button\") || \"button\";\n\n const { buttonProps } = useButton(\n {\n ...contextProps,\n elementType,\n },\n ref\n );\n\n const componentProps = mergeProps(contextProps, buttonProps, {\n as,\n asChild,\n /**\n * In case `slot` was null, the `useContextProps` hook already\n * processed it at this point, so it's safe to not attach it\n * to the DOM element\n */\n slot: contextProps.slot || undefined,\n });\n\n return (\n <ButtonRoot\n ref={ref}\n {...componentProps}\n aria-disabled={componentProps.isDisabled || undefined}\n data-disabled={componentProps.isDisabled || undefined}\n >\n {children}\n </ButtonRoot>\n );\n};\n\n// Manually assign a displayName for debugging purposes\nButton.displayName = \"Button\";\n"],"names":["withContext","createRecipeContext","buttonRecipe","ButtonRoot","prop","variantKeys","chakraSfp","system","shouldForwardProp","Button","props","forwardedRef","as","asChild","children","rest","localRef","useRef","ref","useObjectRef","mergeRefs","contextProps","useContextProps","ButtonContext","elementType","buttonProps","useButton","componentProps","mergeProps","jsx"],"mappings":"2dA2BM,CAAE,YAAAA,CAAA,EAAgBC,sBAAoB,CAC1C,OAAQC,EAAAA,YACV,CAAC,EAMYC,EAAaH,EACxB,SACA,CACE,aAAc,CACZ,KAAM,QAAA,EAGR,kBAAkBI,EAAMC,EAAa,CACnC,MAAMC,EACJ,CAACD,GAAa,SAASD,CAAI,GAAK,CAACG,EAAAA,OAAO,gBAAgBH,CAAI,EAC9D,OAAOI,EAAAA,YAAkBJ,CAAI,GAAKE,GAAa,CAACF,EAAK,SAAS,SAAS,CACzE,CAAA,CAEJ,EClCaK,EAAUC,GAAuB,CAC5C,KAAM,CAAE,IAAKC,EAAc,GAAAC,EAAI,QAAAC,EAAS,SAAAC,EAAU,GAAGC,GAASL,EAGxDM,EAAWC,EAAAA,OAA0B,IAAI,EAEzCC,EAAMC,EAAAA,0CAAaC,EAAAA,UAAUJ,EAAUL,CAAY,CAAC,EAGpD,CAACU,CAAY,EAAIC,EAAAA,0CAAgBP,EAAMG,EAAKK,EAAAA,yCAAa,EAKzDC,EAAcZ,IAAOC,EAAU,IAAM,UAErC,CAAE,YAAAY,GAAgBC,EAAAA,0CACtB,CACE,GAAGL,EACH,YAAAG,CAAA,EAEFN,CAAA,EAGIS,EAAiBC,EAAAA,0CAAWP,EAAcI,EAAa,CAC3D,GAAAb,EACA,QAAAC,EAMA,KAAMQ,EAAa,MAAQ,MAAA,CAC5B,EAED,OACEQ,EAAAA,IAAC1B,EAAA,CACC,IAAAe,EACC,GAAGS,EACJ,gBAAeA,EAAe,YAAc,OAC5C,gBAAeA,EAAe,YAAc,OAE3C,SAAAb,CAAA,CAAA,CAGP,EAGAL,EAAO,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("./Heading-BaW6t55l.cjs.js"),q=require("./create-slot-recipe-context-CimocFDH.cjs.js"),$=require("react"),c=require("./useDateFormatter-CS19Cch2.cjs.js"),p=require("./utils-BHdR5Nww.cjs.js"),v=require("./box-BwCVnAwb.cjs.js"),S=require("./context-OoV8SSWX.cjs.js"),h=require("./icon-button-
|
|
2
|
-
//# sourceMappingURL=calendar-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("./Heading-BaW6t55l.cjs.js"),q=require("./create-slot-recipe-context-CimocFDH.cjs.js"),$=require("react"),c=require("./useDateFormatter-CS19Cch2.cjs.js"),p=require("./utils-BHdR5Nww.cjs.js"),v=require("./box-BwCVnAwb.cjs.js"),S=require("./context-OoV8SSWX.cjs.js"),h=require("./icon-button-DOo2GUqd.cjs.js"),j=require("./text-Dg1sFCuC.cjs.js"),y=require("./stack-BG0j9HvT.cjs.js"),D=require("./visually-hidden-Bh-G5QHv.cjs.js"),u=require("@commercetools/nimbus-icons"),P=require("./flex-yqydM5z_.cjs.js"),R=require("./index-BsmdMT4w.cjs.js"),I=require("./extractStyleProps-BsLft3q1.cjs.js"),C=require("./Button-BtJHe9xY.cjs.js"),g=require("./Text-BWSfeB9p.cjs.js"),T=require("./use-recipe-pbWWLWIq.cjs.js"),{withProvider:B,withContext:s}=q.createSlotRecipeContext({key:"calendar"}),H=B("div","root"),A=s("div","header"),F=s("div","grids"),G=s("div","monthTitle"),L=s("table","grid"),k=s("thead","gridHeader"),M=s("th","headerCell"),N=s("tbody","gridBody"),z=s("td","bodyCell"),K=()=>{const{locale:d}=S.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),n=p.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$3b805cea1f178355),t=$.useContext(a.$dfd62f934fc76fed$export$9e31dcedda1dadc7),r=n?.visibleDuration?.months||1,o=c.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()),i=r>1;return e.jsx(F,{children:Array.from({length:r},(m,l)=>{const b=t.visibleRange.start.add({months:l}),f=new Intl.DateTimeFormat(d,{month:"long"}).format(b.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()));return e.jsxs(v.Box,{width:r==1?"full":"auto",children:[i&&e.jsx(G,{children:f}),e.jsx(L,{asChild:!0,children:e.jsxs(a.$dfd62f934fc76fed$export$5bd780d491cfc46c,{offset:{months:l},weekdayStyle:"short",children:[e.jsx(k,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$22e2d15eaa4d2377,{children:x=>e.jsx(M,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$ad2135cac3a11b3d,{children:x})})})}),e.jsx(N,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$e11f8ba65d857bff,{children:x=>{const w=x.compare(o)===0;return e.jsx(z,{asChild:!0,"data-today":w,children:e.jsx(a.$dfd62f934fc76fed$export$5d847498420df57b,{date:x})})}})})]})})]},f)})})},V=()=>{const t=(p.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$3b805cea1f178355)?.visibleDuration?.months||1)>1;return e.jsx(A,{children:e.jsxs(P.Flex,{children:[e.jsxs(y.Stack,{direction:"row",alignItems:"center",children:[e.jsx(D.VisuallyHidden,{children:e.jsx(a.$5cb03073d3f54797$export$a8a3e93435678ff9,{})}),e.jsx(h.IconButton,{slot:t?"previous":"previous-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowLeft,{})}),e.jsx(j.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:t?"4000":"2000",textAlign:"center","aria-hidden":"true",slot:t?"monthRange":"month"}),e.jsx(h.IconButton,{slot:t?"next":"next-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowRight,{})})]}),e.jsx(v.Box,{flexGrow:"1"}),e.jsxs(y.Stack,{direction:"row",alignItems:"center",children:[e.jsx(h.IconButton,{slot:"previous-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowLeft,{})}),e.jsx(j.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:"1400",textAlign:"center","aria-hidden":"true",slot:"year"}),e.jsx(h.IconButton,{slot:"next-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(u.KeyboardArrowRight,{})})]})]})})},W=({children:d})=>{const{locale:n}=S.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),t=$.useContext(C.$d2b4bc8c273e7be6$export$24d547caef80ccd1),r=$.useContext(g.$514c0188e459b4c0$export$9afb8bc826b033ea),o=$.useContext(a.$dfd62f934fc76fed$export$9e31dcedda1dadc7),i={"next-month":{onPress:()=>o.focusNextSection(),"aria-label":"Next month"},"previous-month":{onPress:()=>o.focusPreviousSection(),"aria-label":"Previous month"},"next-year":{onPress:()=>o.focusNextSection(!0),"aria-label":"Next year"},"previous-year":{onPress:()=>o.focusPreviousSection(!0),"aria-label":"Previous year"}},m=new Intl.DateTimeFormat(n,{month:"long"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),l=[new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.start.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.end.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))].join(" - "),b=new Intl.DateTimeFormat(n,{year:"numeric"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),f={month:{children:m},monthRange:{children:l},year:{children:b}};return e.jsx(p.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[C.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{...t,slots:{...t&&typeof t=="object"&&"slots"in t?t.slots:{},...i}}],[g.$514c0188e459b4c0$export$9afb8bc826b033ea,{...r,slots:{...r&&typeof r=="object"&&"slots"in r?r.slots:{},...f}}]],children:d})},_=d=>{const n=T.useRecipe({recipe:R.calendarSlotRecipe}),[t,r]=n.splitVariantProps(d),[o,i]=I.extractStyleProps(r);return e.jsx(H,{...t,...o,asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$e1aef45b828286de,{...i,children:e.jsxs(W,{children:[e.jsx(V,{}),e.jsx(K,{})]})})})};exports.Calendar=_;
|
|
2
|
+
//# sourceMappingURL=calendar-C-YasyPe.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-BgHBd6Dh.cjs.js","sources":["../../src/components/calendar/calendar.slots.tsx","../../src/components/calendar/components/calendar.grids.tsx","../../src/components/calendar/components/calendar.header.tsx","../../src/components/calendar/components/calendar.custom-context.tsx","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport type { CalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"calendar\",\n});\n\nexport interface CalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof calendarSlotRecipe> & CalendarProps<DateValue>\n > {}\nexport const CalendarRootSlot = withProvider<\n HTMLDivElement,\n CalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface CalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarHeaderSlot = withContext<\n HTMLDivElement,\n CalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface CalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarGridsSlot = withContext<\n HTMLDivElement,\n CalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface CalendarMonthTitleSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n CalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface CalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const CalendarGridSlot = withContext<\n HTMLTableElement,\n CalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface CalendarGridHeaderSlotProps extends HTMLChakraProps<\"thead\"> {}\nexport const CalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n CalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface CalendarHeaderCellSlotProps extends HTMLChakraProps<\"th\"> {}\nexport const CalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n CalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface CalendarGridBodySlotProps extends HTMLChakraProps<\"tbody\"> {}\nexport const CalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n CalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface CalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const CalendarCellSlot = withContext<\n HTMLTableCellElement,\n CalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n CalendarContext,\n CalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\n\nimport { Box } from \"@/components\";\n\nimport {\n CalendarCellSlot,\n CalendarGridBodySlot,\n CalendarGridHeaderSlot,\n CalendarGridSlot,\n CalendarGridsSlot,\n CalendarHeaderCellSlot,\n CalendarMonthTitleSlot,\n} from \"../calendar.slots\";\n\nexport const CalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(CalendarContext);\n const calendarState = useContext(CalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <CalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <CalendarMonthTitleSlot>{monthName}</CalendarMonthTitleSlot>\n )}\n <CalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <CalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <CalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </CalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </CalendarGridHeaderSlot>\n <CalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <CalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </CalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </CalendarGridBodySlot>\n </RaCalendarGrid>\n </CalendarGridSlot>\n </Box>\n );\n })}\n </CalendarGridsSlot>\n );\n};\n","import {\n CalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { CalendarHeaderSlot } from \"../calendar.slots\";\n\nexport const CalendarHeader = () => {\n const calendarProps = useSlottedContext(CalendarContext);\n\n // Needed to decide wether to show a single month or a range\n const visibleDurationMonths = calendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <CalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </CalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n CalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const CalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(CalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { CalendarProps } from \"./calendar.types\";\nimport type { DateValue } from \"react-aria\";\n\nimport { Calendar as RaCalendar } from \"react-aria-components\";\n\nimport { CalendarRootSlot } from \"./calendar.slots\";\nimport { CalendarGrids } from \"./components/calendar.grids\";\nimport { CalendarHeader } from \"./components/calendar.header\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { CalendarCustomContext } from \"./components/calendar.custom-context\";\n\n/**\n * # Calendar\n *\n * Calendars display a grid of days in one or more months and allow users to select a single date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/calendar}\n */\nexport const Calendar = (props: CalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: calendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <CalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaCalendar {...otherProps}>\n <CalendarCustomContext>\n <CalendarHeader />\n <CalendarGrids />\n </CalendarCustomContext>\n </RaCalendar>\n </CalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","CalendarRootSlot","CalendarHeaderSlot","CalendarGridsSlot","CalendarMonthTitleSlot","CalendarGridSlot","CalendarGridHeaderSlot","CalendarHeaderCellSlot","CalendarGridBodySlot","CalendarCellSlot","CalendarGrids","locale","useLocale","context","useSlottedContext","CalendarContext","calendarState","useContext","CalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","CalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","CalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","Calendar","props","recipe","useRecipe","calendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaCalendar"],"mappings":"+vBAUM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,UACP,CAAC,EAOYC,EAAmBH,EAG9B,MAAO,MAAM,EAGFI,EAAqBH,EAGhC,MAAO,QAAQ,EAGJI,EAAoBJ,EAG/B,MAAO,OAAO,EAGHK,EAAyBL,EAGpC,MAAO,YAAY,EAGRM,EAAmBN,EAG9B,QAAS,MAAM,EAGJO,EAAyBP,EAGpC,QAAS,YAAY,EAGVQ,EAAyBR,EAGpC,KAAM,YAAY,EAGPS,EAAuBT,EAGlC,QAAS,UAAU,EAGRU,EAAmBV,EAG9B,KAAM,UAAU,EC5CLW,EAAgB,IAAM,CACjC,KAAM,CAAE,OAAAC,CAAA,EAAWC,4CAAA,EACbC,EAAUC,EAAAA,0CAAkBC,2CAAe,EAC3CC,EAAgBC,EAAAA,WAAWC,2CAAoB,EAC/CC,EAAqBN,GAAS,iBAAiB,QAAU,EACzDO,EAAYC,4CAAMC,EAAAA,2CAAkB,EACpCC,EAAkBJ,EAAqB,EAE7C,OACEK,MAACrB,EAAA,CACE,SAAA,MAAM,KAAK,CAAE,OAAQgB,CAAA,EAAsB,CAACM,EAAGC,IAAU,CACxD,MAAMC,EAAWX,EAAc,aAAa,MAAM,IAAI,CACpD,OAAQU,CAAA,CACT,EACKE,EAAY,IAAI,KAAK,eAAejB,EAAQ,CAChD,MAAO,MAAA,CACR,EAAE,OAAOgB,EAAS,OAAOL,EAAAA,0CAAA,CAAkB,CAAC,EAE7C,OACEO,EAAAA,KAACC,EAAAA,IAAA,CAEC,MAAOX,GAAsB,EAAI,OAAS,OAEzC,SAAA,CAAAI,GACCC,EAAAA,IAACpB,GAAwB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AAoC,CAC3D,MAAMC,EAASC,EAAAA,UAAU,CAAE,OAAQC,EAAAA,mBAAoB,EACjD,CAACC,EAAaC,CAAc,EAAIJ,EAAO,kBAAkBD,CAAK,EAC9D,CAACM,EAAYC,CAAU,EAAIC,EAAAA,kBAAkBH,CAAc,EAEjE,OACE3C,EAAAA,IAACvB,EAAA,CAAkB,GAAGiE,EAAc,GAAGE,EAAY,QAAO,GACxD,SAAA5C,EAAAA,IAAC+C,EAAAA,0CAAA,CAAY,GAAGF,EACd,gBAACpB,EAAA,CACC,SAAA,CAAAzB,EAAAA,IAACe,EAAA,EAAe,QACf7B,EAAA,CAAA,CAAc,CAAA,CAAA,CACjB,EACF,EACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"calendar-C-YasyPe.cjs.js","sources":["../../src/components/calendar/calendar.slots.tsx","../../src/components/calendar/components/calendar.grids.tsx","../../src/components/calendar/components/calendar.header.tsx","../../src/components/calendar/components/calendar.custom-context.tsx","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport type { CalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"calendar\",\n});\n\nexport interface CalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof calendarSlotRecipe> & CalendarProps<DateValue>\n > {}\nexport const CalendarRootSlot = withProvider<\n HTMLDivElement,\n CalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface CalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarHeaderSlot = withContext<\n HTMLDivElement,\n CalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface CalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarGridsSlot = withContext<\n HTMLDivElement,\n CalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface CalendarMonthTitleSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n CalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface CalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const CalendarGridSlot = withContext<\n HTMLTableElement,\n CalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface CalendarGridHeaderSlotProps extends HTMLChakraProps<\"thead\"> {}\nexport const CalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n CalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface CalendarHeaderCellSlotProps extends HTMLChakraProps<\"th\"> {}\nexport const CalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n CalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface CalendarGridBodySlotProps extends HTMLChakraProps<\"tbody\"> {}\nexport const CalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n CalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface CalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const CalendarCellSlot = withContext<\n HTMLTableCellElement,\n CalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n CalendarContext,\n CalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\n\nimport { Box } from \"@/components\";\n\nimport {\n CalendarCellSlot,\n CalendarGridBodySlot,\n CalendarGridHeaderSlot,\n CalendarGridSlot,\n CalendarGridsSlot,\n CalendarHeaderCellSlot,\n CalendarMonthTitleSlot,\n} from \"../calendar.slots\";\n\nexport const CalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(CalendarContext);\n const calendarState = useContext(CalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <CalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <CalendarMonthTitleSlot>{monthName}</CalendarMonthTitleSlot>\n )}\n <CalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <CalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <CalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </CalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </CalendarGridHeaderSlot>\n <CalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <CalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </CalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </CalendarGridBodySlot>\n </RaCalendarGrid>\n </CalendarGridSlot>\n </Box>\n );\n })}\n </CalendarGridsSlot>\n );\n};\n","import {\n CalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { CalendarHeaderSlot } from \"../calendar.slots\";\n\nexport const CalendarHeader = () => {\n const calendarProps = useSlottedContext(CalendarContext);\n\n // Needed to decide wether to show a single month or a range\n const visibleDurationMonths = calendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <CalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </CalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n CalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const CalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(CalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { CalendarProps } from \"./calendar.types\";\nimport type { DateValue } from \"react-aria\";\n\nimport { Calendar as RaCalendar } from \"react-aria-components\";\n\nimport { CalendarRootSlot } from \"./calendar.slots\";\nimport { CalendarGrids } from \"./components/calendar.grids\";\nimport { CalendarHeader } from \"./components/calendar.header\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { CalendarCustomContext } from \"./components/calendar.custom-context\";\n\n/**\n * # Calendar\n *\n * Calendars display a grid of days in one or more months and allow users to select a single date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/calendar}\n */\nexport const Calendar = (props: CalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: calendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <CalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaCalendar {...otherProps}>\n <CalendarCustomContext>\n <CalendarHeader />\n <CalendarGrids />\n </CalendarCustomContext>\n </RaCalendar>\n </CalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","CalendarRootSlot","CalendarHeaderSlot","CalendarGridsSlot","CalendarMonthTitleSlot","CalendarGridSlot","CalendarGridHeaderSlot","CalendarHeaderCellSlot","CalendarGridBodySlot","CalendarCellSlot","CalendarGrids","locale","useLocale","context","useSlottedContext","CalendarContext","calendarState","useContext","CalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","CalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","CalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","Calendar","props","recipe","useRecipe","calendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaCalendar"],"mappings":"+vBAUM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,UACP,CAAC,EAOYC,EAAmBH,EAG9B,MAAO,MAAM,EAGFI,EAAqBH,EAGhC,MAAO,QAAQ,EAGJI,EAAoBJ,EAG/B,MAAO,OAAO,EAGHK,EAAyBL,EAGpC,MAAO,YAAY,EAGRM,EAAmBN,EAG9B,QAAS,MAAM,EAGJO,EAAyBP,EAGpC,QAAS,YAAY,EAGVQ,EAAyBR,EAGpC,KAAM,YAAY,EAGPS,EAAuBT,EAGlC,QAAS,UAAU,EAGRU,EAAmBV,EAG9B,KAAM,UAAU,EC5CLW,EAAgB,IAAM,CACjC,KAAM,CAAE,OAAAC,CAAA,EAAWC,4CAAA,EACbC,EAAUC,EAAAA,0CAAkBC,2CAAe,EAC3CC,EAAgBC,EAAAA,WAAWC,2CAAoB,EAC/CC,EAAqBN,GAAS,iBAAiB,QAAU,EACzDO,EAAYC,4CAAMC,EAAAA,2CAAkB,EACpCC,EAAkBJ,EAAqB,EAE7C,OACEK,MAACrB,EAAA,CACE,SAAA,MAAM,KAAK,CAAE,OAAQgB,CAAA,EAAsB,CAACM,EAAGC,IAAU,CACxD,MAAMC,EAAWX,EAAc,aAAa,MAAM,IAAI,CACpD,OAAQU,CAAA,CACT,EACKE,EAAY,IAAI,KAAK,eAAejB,EAAQ,CAChD,MAAO,MAAA,CACR,EAAE,OAAOgB,EAAS,OAAOL,EAAAA,0CAAA,CAAkB,CAAC,EAE7C,OACEO,EAAAA,KAACC,EAAAA,IAAA,CAEC,MAAOX,GAAsB,EAAI,OAAS,OAEzC,SAAA,CAAAI,GACC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CAGP,ECtFaW,EAAYC,GAAoC,CAC3D,MAAMC,EAASC,EAAAA,UAAU,CAAE,OAAQC,EAAAA,mBAAoB,EACjD,CAACC,EAAaC,CAAc,EAAIJ,EAAO,kBAAkBD,CAAK,EAC9D,CAACM,EAAYC,CAAU,EAAIC,EAAAA,kBAAkBH,CAAc,EAEjE,OACE3C,EAAAA,IAACvB,EAAA,CAAkB,GAAGiE,EAAc,GAAGE,EAAY,QAAO,GACxD,SAAA5C,EAAAA,IAAC+C,EAAAA,0CAAA,CAAY,GAAGF,EACd,gBAACpB,EAAA,CACC,SAAA,CAAAzB,EAAAA,IAACe,EAAA,EAAe,QACf7B,EAAA,CAAA,CAAc,CAAA,CAAA,CACjB,EACF,EACF,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const P=require("react/jsx-runtime"),g=require("@commercetools/nimbus-icons"),M=require("./extractStyleProps-
|
|
2
|
-
//# sourceMappingURL=checkbox-
|
|
1
|
+
"use strict";const P=require("react/jsx-runtime"),g=require("@commercetools/nimbus-icons"),M=require("./extractStyleProps-BsLft3q1.cjs.js"),w=require("./RSPContexts-CkSl9jRK.cjs.js"),R=require("./utils-BHdR5Nww.cjs.js"),H=require("./Form-BuOomA4T.cjs.js"),p=require("./mergeProps-BA5Cwf5w.cjs.js"),T=require("./filterDOMProps-WUskt27c.cjs.js"),N=require("./useObjectRef-dXOJdONs.cjs.js"),c=require("react"),q=require("./useFormValidation-BEaCuNx1.cjs.js"),L=require("./usePress-C8-hLXJw.cjs.js"),W=require("./useToggle-VJWgbeCC.cjs.js"),D=require("./useToggleState-Dl-o05wQ.cjs.js"),z=require("./useFocusRing-CzFer4bD.cjs.js"),A=require("./useHover-CiP9jMFy.cjs.js"),G=require("./VisuallyHidden-Bv_AJXZ7.cjs.js"),k=require("./create-slot-recipe-context-CimocFDH.cjs.js");function B(i,e,a){let n=q.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...i,value:e.isSelected}),{isInvalid:x,validationErrors:m,validationDetails:u}=n.displayValidation,{labelProps:f,inputProps:l,isSelected:d,isPressed:t,isDisabled:$,isReadOnly:b}=W.$d2c8e2b0480f3f34$export$cbe85ee05b554577({...i,isInvalid:x},e,a);q.$e93e671b31057976$export$b8473d3665f3a75a(i,n,a);let{isIndeterminate:v,isRequired:r,validationBehavior:o="aria"}=i;c.useEffect(()=>{a.current&&(a.current.indeterminate=!!v)});let{pressProps:h}=L.$f6c31cce2adf654f$export$45712eceda6fad21({isDisabled:$||b,onPress(){let{[q.$e5be200c675c3b3a$export$a763b9476acd3eb]:s}=i,{commitValidation:V}=s||n;V()}});return{labelProps:p.$3ef42575df84b30b$export$9d1611c77c2fe928(f,h),inputProps:{...l,checked:d,"aria-required":r&&o==="aria"||void 0,required:r&&o==="native"},isSelected:d,isPressed:t,isDisabled:$,isReadOnly:b,isInvalid:x,validationErrors:m,validationDetails:u}}const J=new WeakMap;function K(i,e,a){const n=D.$3017fa7ffdddec74$export$8042c6c013fd5226({isReadOnly:i.isReadOnly||e.isReadOnly,isSelected:e.isSelected(i.value),defaultSelected:e.defaultValue.includes(i.value),onChange(s){s?e.addValue(i.value):e.removeValue(i.value),i.onChange&&i.onChange(s)}});let{name:x,form:m,descriptionId:u,errorMessageId:f,validationBehavior:l}=J.get(e);var d;l=(d=i.validationBehavior)!==null&&d!==void 0?d:l;let{realtimeValidation:t}=q.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...i,value:n.isSelected,name:void 0,validationBehavior:"aria"}),$=c.useRef(q.$e5be200c675c3b3a$export$dad6ae84456c676a),b=()=>{e.setInvalid(i.value,t.isInvalid?t:$.current)};c.useEffect(b);let v=e.realtimeValidation.isInvalid?e.realtimeValidation:t,r=l==="native"?e.displayValidation:v;var o;let h=B({...i,isReadOnly:i.isReadOnly||e.isReadOnly,isDisabled:i.isDisabled||e.isDisabled,name:i.name||x,form:i.form||m,isRequired:(o=i.isRequired)!==null&&o!==void 0?o:e.isRequired,validationBehavior:l,[q.$e5be200c675c3b3a$export$a763b9476acd3eb]:{realtimeValidation:v,displayValidation:r,resetValidation:e.resetValidation,commitValidation:e.commitValidation,updateValidation(s){$.current=s,b()}}},n,a);return{...h,inputProps:{...h.inputProps,"aria-describedby":[i["aria-describedby"],e.isInvalid?f:null,u].filter(Boolean).join(" ")||void 0}}}const Q=c.createContext(null),U=c.forwardRef(function(e,a){let{inputRef:n=null,...x}=e;[e,a]=R.$64fa3d84918910a7$export$29f1550f4b0d4415(x,a,w.$4e85f108e88277b8$export$b085522c77523c51);let{validationBehavior:m}=R.$64fa3d84918910a7$export$fabf2dc03a41866e(H.$d3e0e05bdfcf66bd$export$c24727297075ec6a)||{};var u,f;let l=(f=(u=e.validationBehavior)!==null&&u!==void 0?u:m)!==null&&f!==void 0?f:"native",d=c.useContext(Q),t=N.$df56164dff5785e2$export$4338b53315abf666(c.useMemo(()=>R.$5dc95899b306f630$export$c9058316764c140e(n,e.inputRef!==void 0?e.inputRef:null),[n,e.inputRef])),{labelProps:$,inputProps:b,isSelected:v,isDisabled:r,isReadOnly:o,isPressed:h,isInvalid:s}=d?K({...R.$64fa3d84918910a7$export$ef03459518577ad4(e),value:e.value,children:typeof e.children=="function"?!0:e.children},d,t):B({...R.$64fa3d84918910a7$export$ef03459518577ad4(e),children:typeof e.children=="function"?!0:e.children,validationBehavior:l},D.$3017fa7ffdddec74$export$8042c6c013fd5226(e),t),{isFocused:V,isFocusVisible:I,focusProps:j}=z.$f7dceffc5ad7768b$export$4e328f61c538687f(),E=r||o,{hoverProps:_,isHovered:C}=A.$6179b936705e76d3$export$ae780daf29e6d456({...e,isDisabled:E}),S=R.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,defaultClassName:"react-aria-Checkbox",values:{isSelected:v,isIndeterminate:e.isIndeterminate||!1,isPressed:h,isHovered:C,isFocused:V,isFocusVisible:I,isDisabled:r,isReadOnly:o,isInvalid:s,isRequired:e.isRequired||!1}}),y=T.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return delete y.id,delete y.onClick,c.createElement("label",{...p.$3ef42575df84b30b$export$9d1611c77c2fe928(y,$,_,S),ref:a,slot:e.slot||void 0,"data-selected":v||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-pressed":h||void 0,"data-hovered":C||void 0,"data-focused":V||void 0,"data-focus-visible":I||void 0,"data-disabled":r||void 0,"data-readonly":o||void 0,"data-invalid":s||void 0,"data-required":e.isRequired||void 0},c.createElement(G.$5c3e21d68f1c4674$export$439d29a4e110a164,{elementType:"span"},c.createElement("input",{...p.$3ef42575df84b30b$export$9d1611c77c2fe928(b,j),ref:t})),S.children)}),{withProvider:X,withContext:O}=k.createSlotRecipeContext({key:"checkbox"}),Y=X(U,"root"),Z=O("span","label"),ee=O("span","indicator"),F=i=>{const{ref:e,children:a,...n}=i,x=k.useSlotRecipe({key:"checkbox"}),[m,u]=x.splitVariantProps(n),[f,l]=M.extractStyleProps(u);return P.jsx(Y,{ref:e,"data-slot":"root",...l,...m,...f,children:({isSelected:d,isIndeterminate:t,isInvalid:$,isDisabled:b,isFocused:v})=>{const r={"data-selected":d,"data-indeterminate":t,"data-invalid":$,"data-disabled":b,"data-focus":v||void 0};return P.jsxs(P.Fragment,{children:[P.jsxs(ee,{"data-slot":"indicator",...r,children:[d&&P.jsx(g.Check,{}),t&&P.jsx(g.Remove,{})]}),a&&P.jsx(Z,{"data-slot":"label",...r,children:a})]})}})};F.displayName="Checkbox";exports.Checkbox=F;
|
|
2
|
+
//# sourceMappingURL=checkbox-6DkVAh4W.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-BbdENF1i.cjs.js","sources":["../../../../node_modules/.pnpm/@react-aria+checkbox@3.16.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/checkbox/dist/useCheckbox.mjs","../../../../node_modules/.pnpm/@react-aria+checkbox@3.16.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/checkbox/dist/utils.mjs","../../../../node_modules/.pnpm/@react-aria+checkbox@3.16.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/checkbox/dist/useCheckboxGroupItem.mjs","../../../../node_modules/.pnpm/react-aria-components@1.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/react-aria-components/dist/Checkbox.mjs","../../src/components/checkbox/checkbox.slots.tsx","../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import {useEffect as $jNP0e$useEffect} from \"react\";\nimport {mergeProps as $jNP0e$mergeProps} from \"@react-aria/utils\";\nimport {useFormValidationState as $jNP0e$useFormValidationState, privateValidationStateProp as $jNP0e$privateValidationStateProp} from \"@react-stately/form\";\nimport {useFormValidation as $jNP0e$useFormValidation} from \"@react-aria/form\";\nimport {usePress as $jNP0e$usePress} from \"@react-aria/interactions\";\nimport {useToggle as $jNP0e$useToggle} from \"@react-aria/toggle\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\nfunction $406796ff087fe49b$export$e375f10ce42261c5(props, state, inputRef) {\n // Create validation state here because it doesn't make sense to add to general useToggleState.\n let validationState = (0, $jNP0e$useFormValidationState)({\n ...props,\n value: state.isSelected\n });\n let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = validationState.displayValidation;\n let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $jNP0e$useToggle)({\n ...props,\n isInvalid: isInvalid\n }, state, inputRef);\n (0, $jNP0e$useFormValidation)(props, validationState, inputRef);\n let { isIndeterminate: isIndeterminate, isRequired: isRequired, validationBehavior: validationBehavior = 'aria' } = props;\n (0, $jNP0e$useEffect)(()=>{\n // indeterminate is a property, but it can only be set via javascript\n // https://css-tricks.com/indeterminate-checkboxes/\n if (inputRef.current) inputRef.current.indeterminate = !!isIndeterminate;\n });\n // Reset validation state on label press for checkbox with a hidden input.\n let { pressProps: pressProps } = (0, $jNP0e$usePress)({\n isDisabled: isDisabled || isReadOnly,\n onPress () {\n // @ts-expect-error\n let { [(0, $jNP0e$privateValidationStateProp)]: groupValidationState } = props;\n let { commitValidation: commitValidation } = groupValidationState ? groupValidationState : validationState;\n commitValidation();\n }\n });\n return {\n labelProps: (0, $jNP0e$mergeProps)(labelProps, pressProps),\n inputProps: {\n ...inputProps,\n checked: isSelected,\n 'aria-required': isRequired && validationBehavior === 'aria' || undefined,\n required: isRequired && validationBehavior === 'native'\n },\n isSelected: isSelected,\n isPressed: isPressed,\n isDisabled: isDisabled,\n isReadOnly: isReadOnly,\n isInvalid: isInvalid,\n validationErrors: validationErrors,\n validationDetails: validationDetails\n };\n}\n\n\nexport {$406796ff087fe49b$export$e375f10ce42261c5 as useCheckbox};\n//# sourceMappingURL=useCheckbox.module.js.map\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ const $1ae600c947479353$export$ec98120685d4f57d = new WeakMap();\n\n\nexport {$1ae600c947479353$export$ec98120685d4f57d as checkboxGroupData};\n//# sourceMappingURL=utils.module.js.map\n","import {useCheckbox as $406796ff087fe49b$export$e375f10ce42261c5} from \"./useCheckbox.mjs\";\nimport {checkboxGroupData as $1ae600c947479353$export$ec98120685d4f57d} from \"./utils.mjs\";\nimport {useFormValidationState as $6clEo$useFormValidationState, DEFAULT_VALIDATION_RESULT as $6clEo$DEFAULT_VALIDATION_RESULT, privateValidationStateProp as $6clEo$privateValidationStateProp} from \"@react-stately/form\";\nimport {useRef as $6clEo$useRef, useEffect as $6clEo$useEffect} from \"react\";\nimport {useToggleState as $6clEo$useToggleState} from \"@react-stately/toggle\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\nfunction $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {\n const toggleState = (0, $6clEo$useToggleState)({\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isSelected: state.isSelected(props.value),\n defaultSelected: state.defaultValue.includes(props.value),\n onChange (isSelected) {\n if (isSelected) state.addValue(props.value);\n else state.removeValue(props.value);\n if (props.onChange) props.onChange(isSelected);\n }\n });\n let { name: name, form: form, descriptionId: descriptionId, errorMessageId: errorMessageId, validationBehavior: validationBehavior } = (0, $1ae600c947479353$export$ec98120685d4f57d).get(state);\n var _props_validationBehavior;\n validationBehavior = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : validationBehavior;\n // Local validation for this checkbox.\n let { realtimeValidation: realtimeValidation } = (0, $6clEo$useFormValidationState)({\n ...props,\n value: toggleState.isSelected,\n // Server validation is handled at the group level.\n name: undefined,\n validationBehavior: 'aria'\n });\n // Update the checkbox group state when realtime validation changes.\n let nativeValidation = (0, $6clEo$useRef)((0, $6clEo$DEFAULT_VALIDATION_RESULT));\n let updateValidation = ()=>{\n state.setInvalid(props.value, realtimeValidation.isInvalid ? realtimeValidation : nativeValidation.current);\n };\n (0, $6clEo$useEffect)(updateValidation);\n // Combine group and checkbox level validation.\n let combinedRealtimeValidation = state.realtimeValidation.isInvalid ? state.realtimeValidation : realtimeValidation;\n let displayValidation = validationBehavior === 'native' ? state.displayValidation : combinedRealtimeValidation;\n var _props_isRequired;\n let res = (0, $406796ff087fe49b$export$e375f10ce42261c5)({\n ...props,\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isDisabled: props.isDisabled || state.isDisabled,\n name: props.name || name,\n form: props.form || form,\n isRequired: (_props_isRequired = props.isRequired) !== null && _props_isRequired !== void 0 ? _props_isRequired : state.isRequired,\n validationBehavior: validationBehavior,\n [(0, $6clEo$privateValidationStateProp)]: {\n realtimeValidation: combinedRealtimeValidation,\n displayValidation: displayValidation,\n resetValidation: state.resetValidation,\n commitValidation: state.commitValidation,\n updateValidation (v) {\n nativeValidation.current = v;\n updateValidation();\n }\n }\n }, toggleState, inputRef);\n return {\n ...res,\n inputProps: {\n ...res.inputProps,\n 'aria-describedby': [\n props['aria-describedby'],\n state.isInvalid ? errorMessageId : null,\n descriptionId\n ].filter(Boolean).join(' ') || undefined\n }\n };\n}\n\n\nexport {$fba3e38d5ca8983f$export$353b32fc6898d37d as useCheckboxGroupItem};\n//# sourceMappingURL=useCheckboxGroupItem.module.js.map\n","import {CheckboxContext as $4e85f108e88277b8$export$b085522c77523c51} from \"./RSPContexts.mjs\";\nimport {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from \"./utils.mjs\";\nimport {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from \"./FieldError.mjs\";\nimport {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from \"./Form.mjs\";\nimport {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from \"./Label.mjs\";\nimport {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from \"./Text.mjs\";\nimport {useCheckboxGroup as $kPH7g$useCheckboxGroup, mergeProps as $kPH7g$mergeProps, useCheckboxGroupItem as $kPH7g$useCheckboxGroupItem, useCheckbox as $kPH7g$useCheckbox, useFocusRing as $kPH7g$useFocusRing, useHover as $kPH7g$useHover, VisuallyHidden as $kPH7g$VisuallyHidden} from \"react-aria\";\nimport {useCheckboxGroupState as $kPH7g$useCheckboxGroupState, useToggleState as $kPH7g$useToggleState} from \"react-stately\";\nimport {filterDOMProps as $kPH7g$filterDOMProps, useObjectRef as $kPH7g$useObjectRef, mergeRefs as $kPH7g$mergeRefs} from \"@react-aria/utils\";\nimport $kPH7g$react, {createContext as $kPH7g$createContext, forwardRef as $kPH7g$forwardRef, useContext as $kPH7g$useContext, useMemo as $kPH7g$useMemo} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\n\n\n\n\nconst $bc237834342dbd75$export$baf37c4be89255b8 = /*#__PURE__*/ (0, $kPH7g$createContext)(null);\nconst $bc237834342dbd75$export$139c5b8563afc1fc = /*#__PURE__*/ (0, $kPH7g$createContext)(null);\nconst $bc237834342dbd75$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, $kPH7g$forwardRef)(function CheckboxGroup(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $bc237834342dbd75$export$baf37c4be89255b8);\n let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};\n var _props_validationBehavior, _ref;\n let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';\n let state = (0, $kPH7g$useCheckboxGroupState)({\n ...props,\n validationBehavior: validationBehavior\n });\n let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);\n let { groupProps: groupProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $kPH7g$useCheckboxGroup)({\n ...props,\n label: label,\n validationBehavior: validationBehavior\n }, state);\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n values: {\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: props.isRequired || false,\n isInvalid: state.isInvalid,\n state: state\n },\n defaultClassName: 'react-aria-CheckboxGroup'\n });\n let DOMProps = (0, $kPH7g$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $kPH7g$react).createElement(\"div\", {\n ...(0, $kPH7g$mergeProps)(DOMProps, renderProps, groupProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-required\": props.isRequired || undefined,\n \"data-invalid\": state.isInvalid || undefined,\n \"data-disabled\": props.isDisabled || undefined\n }, /*#__PURE__*/ (0, $kPH7g$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $bc237834342dbd75$export$139c5b8563afc1fc,\n state\n ],\n [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n {\n ...labelProps,\n ref: labelRef,\n elementType: 'span'\n }\n ],\n [\n (0, $514c0188e459b4c0$export$9afb8bc826b033ea),\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [\n (0, $ee014567cb39d3f0$export$ff05c3ac10437e03),\n validation\n ]\n ]\n }, renderProps.children));\n});\nconst $bc237834342dbd75$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $kPH7g$forwardRef)(function Checkbox(props, ref) {\n let { inputRef: userProvidedInputRef = null, ...otherProps } = props;\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(otherProps, ref, (0, $4e85f108e88277b8$export$b085522c77523c51));\n let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};\n var _props_validationBehavior, _ref;\n let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';\n let groupState = (0, $kPH7g$useContext)($bc237834342dbd75$export$139c5b8563afc1fc);\n let inputRef = (0, $kPH7g$useObjectRef)((0, $kPH7g$useMemo)(()=>(0, $kPH7g$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [\n userProvidedInputRef,\n props.inputRef\n ]));\n let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isReadOnly: isReadOnly, isPressed: isPressed, isInvalid: isInvalid } = groupState ? (0, $kPH7g$useCheckboxGroupItem)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, groupState, inputRef) : (0, $kPH7g$useCheckbox)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n children: typeof props.children === 'function' ? true : props.children,\n validationBehavior: validationBehavior\n }, (0, $kPH7g$useToggleState)(props), inputRef);\n let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $kPH7g$useFocusRing)();\n let isInteractionDisabled = isDisabled || isReadOnly;\n let { hoverProps: hoverProps, isHovered: isHovered } = (0, $kPH7g$useHover)({\n ...props,\n isDisabled: isInteractionDisabled\n });\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-Checkbox',\n values: {\n isSelected: isSelected,\n isIndeterminate: props.isIndeterminate || false,\n isPressed: isPressed,\n isHovered: isHovered,\n isFocused: isFocused,\n isFocusVisible: isFocusVisible,\n isDisabled: isDisabled,\n isReadOnly: isReadOnly,\n isInvalid: isInvalid,\n isRequired: props.isRequired || false\n }\n });\n let DOMProps = (0, $kPH7g$filterDOMProps)(props, {\n global: true\n });\n delete DOMProps.id;\n delete DOMProps.onClick;\n return /*#__PURE__*/ (0, $kPH7g$react).createElement(\"label\", {\n ...(0, $kPH7g$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-indeterminate\": props.isIndeterminate || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-hovered\": isHovered || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-readonly\": isReadOnly || undefined,\n \"data-invalid\": isInvalid || undefined,\n \"data-required\": props.isRequired || undefined\n }, /*#__PURE__*/ (0, $kPH7g$react).createElement((0, $kPH7g$VisuallyHidden), {\n elementType: \"span\"\n }, /*#__PURE__*/ (0, $kPH7g$react).createElement(\"input\", {\n ...(0, $kPH7g$mergeProps)(inputProps, focusProps),\n ref: inputRef\n })), renderProps.children);\n});\n\n\nexport {$bc237834342dbd75$export$baf37c4be89255b8 as CheckboxGroupContext, $bc237834342dbd75$export$139c5b8563afc1fc as CheckboxGroupStateContext, $bc237834342dbd75$export$4aa08d5625cb8ead as CheckboxGroup, $bc237834342dbd75$export$48513f6b9f8ce62d as Checkbox};\n//# sourceMappingURL=Checkbox.module.js.map\n","/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport {\n Checkbox as RaCheckbox,\n type CheckboxProps,\n} from \"react-aria-components\";\nimport { checkboxSlotRecipe } from \"./checkbox.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"checkbox\",\n});\n\nexport interface CheckboxRootProps\n extends Omit<\n HTMLChakraProps<\"label\", RecipeVariantProps<typeof checkboxSlotRecipe>>,\n keyof CheckboxProps\n >,\n CheckboxProps {}\n\nexport const CheckboxRoot = withProvider<CheckboxRootProps, CheckboxRootProps>(\n RaCheckbox,\n \"root\"\n);\n\ninterface CheckboxLabelProps extends HTMLChakraProps<\"span\"> {}\nexport const CheckboxLabel = withContext<HTMLSpanElement, CheckboxLabelProps>(\n \"span\",\n \"label\"\n);\n\ninterface CheckboxIndicatorProps extends HTMLChakraProps<\"span\"> {}\nexport const CheckboxIndicator = withContext<\n HTMLSpanElement,\n CheckboxIndicatorProps\n>(\"span\", \"indicator\");\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { Check, Remove as Minus } from \"@commercetools/nimbus-icons\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { CheckboxProps } from \"./checkbox.types\";\nimport type { CheckboxRenderProps } from \"react-aria-components\";\nimport {\n CheckboxIndicator,\n CheckboxRoot,\n CheckboxLabel,\n} from \"./checkbox.slots\";\n\n/**\n * # Checkbox\n *\n * Displays a checkbox.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/checkbox}\n */\nexport const Checkbox = (props: CheckboxProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n const recipe = useSlotRecipe({ key: \"checkbox\" });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(restProps);\n\n const [styleProps, functionalProps] = extractStyleProps(remainingProps);\n\n return (\n <CheckboxRoot\n ref={forwardedRef}\n data-slot=\"root\"\n {...functionalProps}\n {...recipeProps}\n {...styleProps}\n >\n {({\n isSelected,\n isIndeterminate,\n isInvalid,\n isDisabled,\n isFocused,\n }: CheckboxRenderProps) => {\n const stateProps = {\n \"data-selected\": isSelected,\n \"data-indeterminate\": isIndeterminate,\n \"data-invalid\": isInvalid,\n \"data-disabled\": isDisabled,\n \"data-focus\": isFocused || undefined,\n };\n\n return (\n <>\n <CheckboxIndicator data-slot=\"indicator\" {...stateProps}>\n {isSelected && <Check />}\n {isIndeterminate && <Minus />}\n </CheckboxIndicator>\n\n {children && (\n <CheckboxLabel data-slot=\"label\" {...stateProps}>\n {children}\n </CheckboxLabel>\n )}\n </>\n );\n }}\n </CheckboxRoot>\n );\n};\nCheckbox.displayName = \"Checkbox\";\n"],"names":["$406796ff087fe49b$export$e375f10ce42261c5","props","state","inputRef","validationState","$jNP0e$useFormValidationState","isInvalid","validationErrors","validationDetails","labelProps","inputProps","isSelected","isPressed","isDisabled","isReadOnly","$jNP0e$useToggle","$jNP0e$useFormValidation","isIndeterminate","isRequired","validationBehavior","$jNP0e$useEffect","pressProps","$jNP0e$usePress","$jNP0e$privateValidationStateProp","groupValidationState","commitValidation","$jNP0e$mergeProps","$1ae600c947479353$export$ec98120685d4f57d","$fba3e38d5ca8983f$export$353b32fc6898d37d","toggleState","$6clEo$useToggleState","name","form","descriptionId","errorMessageId","_props_validationBehavior","realtimeValidation","$6clEo$useFormValidationState","nativeValidation","$6clEo$useRef","$6clEo$DEFAULT_VALIDATION_RESULT","updateValidation","$6clEo$useEffect","combinedRealtimeValidation","displayValidation","_props_isRequired","res","$6clEo$privateValidationStateProp","v","$bc237834342dbd75$export$139c5b8563afc1fc","$kPH7g$createContext","$bc237834342dbd75$export$48513f6b9f8ce62d","$kPH7g$forwardRef","ref","userProvidedInputRef","otherProps","$64fa3d84918910a7$export$29f1550f4b0d4415","$4e85f108e88277b8$export$b085522c77523c51","formValidationBehavior","$64fa3d84918910a7$export$fabf2dc03a41866e","$d3e0e05bdfcf66bd$export$c24727297075ec6a","_ref","groupState","$kPH7g$useContext","$kPH7g$useObjectRef","$kPH7g$useMemo","$kPH7g$mergeRefs","$kPH7g$useCheckboxGroupItem","$64fa3d84918910a7$export$ef03459518577ad4","$kPH7g$useCheckbox","$kPH7g$useToggleState","isFocused","isFocusVisible","focusProps","$kPH7g$useFocusRing","isInteractionDisabled","hoverProps","isHovered","$kPH7g$useHover","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","DOMProps","$kPH7g$filterDOMProps","$kPH7g$react","$kPH7g$mergeProps","$kPH7g$VisuallyHidden","withProvider","withContext","createSlotRecipeContext","CheckboxRoot","RaCheckbox","CheckboxLabel","CheckboxIndicator","Checkbox","forwardedRef","children","restProps","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","functionalProps","extractStyleProps","jsx","stateProps","jsxs","Fragment","Check","Minus"],"mappings":"mwBAuBA,SAASA,EAA0CC,EAAOC,EAAOC,EAAU,CAEvE,IAAIC,EAAsBC,4CAA+B,CACrD,GAAGJ,EACH,MAAOC,EAAM,UACrB,CAAK,EACG,CAAE,UAAWI,EAAW,iBAAkBC,EAAkB,kBAAmBC,GAAsBJ,EAAgB,kBACrH,CAAE,WAAYK,EAAY,WAAYC,EAAY,WAAYC,EAAY,UAAWC,EAAW,WAAYC,EAAY,WAAYC,CAAU,EAASC,4CAAkB,CACzK,GAAGd,EACH,UAAWK,CACnB,EAAOJ,EAAOC,CAAQ,EACda,4CAA0Bf,EAAOG,EAAiBD,CAAQ,EAC9D,GAAI,CAAE,gBAAiBc,EAAiB,WAAYC,EAAY,mBAAoBC,EAAqB,MAAM,EAAKlB,EAChHmB,EAAAA,UAAkB,IAAI,CAGlBjB,EAAS,UAASA,EAA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,CAAC,CACA,WAAA1F,EACA,gBAAAM,EACA,UAAAX,EACA,WAAAO,EACA,UAAA0D,CAAA,IACyB,CACzB,MAAMkC,EAAa,CACjB,gBAAiB9F,EACjB,qBAAsBM,EACtB,eAAgBX,EAChB,gBAAiBO,EACjB,aAAc0D,GAAa,MAAA,EAG7B,OACEmC,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAD,EAAAA,KAACd,GAAA,CAAkB,YAAU,YAAa,GAAGa,EAC1C,SAAA,CAAA9F,SAAeiG,EAAAA,MAAA,EAAM,EACrB3F,SAAoB4F,EAAAA,OAAA,CAAA,CAAM,CAAA,EAC7B,EAECd,GACCS,EAAAA,IAACb,EAAA,CAAc,YAAU,QAAS,GAAGc,EAClC,SAAAV,CAAA,CACH,CAAA,EAEJ,CAEJ,CAAA,CAAA,CAGN,EACAF,EAAS,YAAc","x_google_ignoreList":[0,1,2,3]}
|
|
1
|
+
{"version":3,"file":"checkbox-6DkVAh4W.cjs.js","sources":["../../../../node_modules/.pnpm/@react-aria+checkbox@3.16.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/checkbox/dist/useCheckbox.mjs","../../../../node_modules/.pnpm/@react-aria+checkbox@3.16.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/checkbox/dist/utils.mjs","../../../../node_modules/.pnpm/@react-aria+checkbox@3.16.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@react-aria/checkbox/dist/useCheckboxGroupItem.mjs","../../../../node_modules/.pnpm/react-aria-components@1.12.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/react-aria-components/dist/Checkbox.mjs","../../src/components/checkbox/checkbox.slots.tsx","../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import {useEffect as $jNP0e$useEffect} from \"react\";\nimport {mergeProps as $jNP0e$mergeProps} from \"@react-aria/utils\";\nimport {useFormValidationState as $jNP0e$useFormValidationState, privateValidationStateProp as $jNP0e$privateValidationStateProp} from \"@react-stately/form\";\nimport {useFormValidation as $jNP0e$useFormValidation} from \"@react-aria/form\";\nimport {usePress as $jNP0e$usePress} from \"@react-aria/interactions\";\nimport {useToggle as $jNP0e$useToggle} from \"@react-aria/toggle\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\nfunction $406796ff087fe49b$export$e375f10ce42261c5(props, state, inputRef) {\n // Create validation state here because it doesn't make sense to add to general useToggleState.\n let validationState = (0, $jNP0e$useFormValidationState)({\n ...props,\n value: state.isSelected\n });\n let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = validationState.displayValidation;\n let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $jNP0e$useToggle)({\n ...props,\n isInvalid: isInvalid\n }, state, inputRef);\n (0, $jNP0e$useFormValidation)(props, validationState, inputRef);\n let { isIndeterminate: isIndeterminate, isRequired: isRequired, validationBehavior: validationBehavior = 'aria' } = props;\n (0, $jNP0e$useEffect)(()=>{\n // indeterminate is a property, but it can only be set via javascript\n // https://css-tricks.com/indeterminate-checkboxes/\n if (inputRef.current) inputRef.current.indeterminate = !!isIndeterminate;\n });\n // Reset validation state on label press for checkbox with a hidden input.\n let { pressProps: pressProps } = (0, $jNP0e$usePress)({\n isDisabled: isDisabled || isReadOnly,\n onPress () {\n // @ts-expect-error\n let { [(0, $jNP0e$privateValidationStateProp)]: groupValidationState } = props;\n let { commitValidation: commitValidation } = groupValidationState ? groupValidationState : validationState;\n commitValidation();\n }\n });\n return {\n labelProps: (0, $jNP0e$mergeProps)(labelProps, pressProps),\n inputProps: {\n ...inputProps,\n checked: isSelected,\n 'aria-required': isRequired && validationBehavior === 'aria' || undefined,\n required: isRequired && validationBehavior === 'native'\n },\n isSelected: isSelected,\n isPressed: isPressed,\n isDisabled: isDisabled,\n isReadOnly: isReadOnly,\n isInvalid: isInvalid,\n validationErrors: validationErrors,\n validationDetails: validationDetails\n };\n}\n\n\nexport {$406796ff087fe49b$export$e375f10ce42261c5 as useCheckbox};\n//# sourceMappingURL=useCheckbox.module.js.map\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ const $1ae600c947479353$export$ec98120685d4f57d = new WeakMap();\n\n\nexport {$1ae600c947479353$export$ec98120685d4f57d as checkboxGroupData};\n//# sourceMappingURL=utils.module.js.map\n","import {useCheckbox as $406796ff087fe49b$export$e375f10ce42261c5} from \"./useCheckbox.mjs\";\nimport {checkboxGroupData as $1ae600c947479353$export$ec98120685d4f57d} from \"./utils.mjs\";\nimport {useFormValidationState as $6clEo$useFormValidationState, DEFAULT_VALIDATION_RESULT as $6clEo$DEFAULT_VALIDATION_RESULT, privateValidationStateProp as $6clEo$privateValidationStateProp} from \"@react-stately/form\";\nimport {useRef as $6clEo$useRef, useEffect as $6clEo$useEffect} from \"react\";\nimport {useToggleState as $6clEo$useToggleState} from \"@react-stately/toggle\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\nfunction $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {\n const toggleState = (0, $6clEo$useToggleState)({\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isSelected: state.isSelected(props.value),\n defaultSelected: state.defaultValue.includes(props.value),\n onChange (isSelected) {\n if (isSelected) state.addValue(props.value);\n else state.removeValue(props.value);\n if (props.onChange) props.onChange(isSelected);\n }\n });\n let { name: name, form: form, descriptionId: descriptionId, errorMessageId: errorMessageId, validationBehavior: validationBehavior } = (0, $1ae600c947479353$export$ec98120685d4f57d).get(state);\n var _props_validationBehavior;\n validationBehavior = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : validationBehavior;\n // Local validation for this checkbox.\n let { realtimeValidation: realtimeValidation } = (0, $6clEo$useFormValidationState)({\n ...props,\n value: toggleState.isSelected,\n // Server validation is handled at the group level.\n name: undefined,\n validationBehavior: 'aria'\n });\n // Update the checkbox group state when realtime validation changes.\n let nativeValidation = (0, $6clEo$useRef)((0, $6clEo$DEFAULT_VALIDATION_RESULT));\n let updateValidation = ()=>{\n state.setInvalid(props.value, realtimeValidation.isInvalid ? realtimeValidation : nativeValidation.current);\n };\n (0, $6clEo$useEffect)(updateValidation);\n // Combine group and checkbox level validation.\n let combinedRealtimeValidation = state.realtimeValidation.isInvalid ? state.realtimeValidation : realtimeValidation;\n let displayValidation = validationBehavior === 'native' ? state.displayValidation : combinedRealtimeValidation;\n var _props_isRequired;\n let res = (0, $406796ff087fe49b$export$e375f10ce42261c5)({\n ...props,\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isDisabled: props.isDisabled || state.isDisabled,\n name: props.name || name,\n form: props.form || form,\n isRequired: (_props_isRequired = props.isRequired) !== null && _props_isRequired !== void 0 ? _props_isRequired : state.isRequired,\n validationBehavior: validationBehavior,\n [(0, $6clEo$privateValidationStateProp)]: {\n realtimeValidation: combinedRealtimeValidation,\n displayValidation: displayValidation,\n resetValidation: state.resetValidation,\n commitValidation: state.commitValidation,\n updateValidation (v) {\n nativeValidation.current = v;\n updateValidation();\n }\n }\n }, toggleState, inputRef);\n return {\n ...res,\n inputProps: {\n ...res.inputProps,\n 'aria-describedby': [\n props['aria-describedby'],\n state.isInvalid ? errorMessageId : null,\n descriptionId\n ].filter(Boolean).join(' ') || undefined\n }\n };\n}\n\n\nexport {$fba3e38d5ca8983f$export$353b32fc6898d37d as useCheckboxGroupItem};\n//# sourceMappingURL=useCheckboxGroupItem.module.js.map\n","import {CheckboxContext as $4e85f108e88277b8$export$b085522c77523c51} from \"./RSPContexts.mjs\";\nimport {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from \"./utils.mjs\";\nimport {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from \"./FieldError.mjs\";\nimport {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from \"./Form.mjs\";\nimport {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from \"./Label.mjs\";\nimport {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from \"./Text.mjs\";\nimport {useCheckboxGroup as $kPH7g$useCheckboxGroup, mergeProps as $kPH7g$mergeProps, useCheckboxGroupItem as $kPH7g$useCheckboxGroupItem, useCheckbox as $kPH7g$useCheckbox, useFocusRing as $kPH7g$useFocusRing, useHover as $kPH7g$useHover, VisuallyHidden as $kPH7g$VisuallyHidden} from \"react-aria\";\nimport {useCheckboxGroupState as $kPH7g$useCheckboxGroupState, useToggleState as $kPH7g$useToggleState} from \"react-stately\";\nimport {filterDOMProps as $kPH7g$filterDOMProps, useObjectRef as $kPH7g$useObjectRef, mergeRefs as $kPH7g$mergeRefs} from \"@react-aria/utils\";\nimport $kPH7g$react, {createContext as $kPH7g$createContext, forwardRef as $kPH7g$forwardRef, useContext as $kPH7g$useContext, useMemo as $kPH7g$useMemo} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\n\n\n\n\nconst $bc237834342dbd75$export$baf37c4be89255b8 = /*#__PURE__*/ (0, $kPH7g$createContext)(null);\nconst $bc237834342dbd75$export$139c5b8563afc1fc = /*#__PURE__*/ (0, $kPH7g$createContext)(null);\nconst $bc237834342dbd75$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, $kPH7g$forwardRef)(function CheckboxGroup(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $bc237834342dbd75$export$baf37c4be89255b8);\n let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};\n var _props_validationBehavior, _ref;\n let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';\n let state = (0, $kPH7g$useCheckboxGroupState)({\n ...props,\n validationBehavior: validationBehavior\n });\n let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);\n let { groupProps: groupProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $kPH7g$useCheckboxGroup)({\n ...props,\n label: label,\n validationBehavior: validationBehavior\n }, state);\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n values: {\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: props.isRequired || false,\n isInvalid: state.isInvalid,\n state: state\n },\n defaultClassName: 'react-aria-CheckboxGroup'\n });\n let DOMProps = (0, $kPH7g$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $kPH7g$react).createElement(\"div\", {\n ...(0, $kPH7g$mergeProps)(DOMProps, renderProps, groupProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-required\": props.isRequired || undefined,\n \"data-invalid\": state.isInvalid || undefined,\n \"data-disabled\": props.isDisabled || undefined\n }, /*#__PURE__*/ (0, $kPH7g$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $bc237834342dbd75$export$139c5b8563afc1fc,\n state\n ],\n [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n {\n ...labelProps,\n ref: labelRef,\n elementType: 'span'\n }\n ],\n [\n (0, $514c0188e459b4c0$export$9afb8bc826b033ea),\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [\n (0, $ee014567cb39d3f0$export$ff05c3ac10437e03),\n validation\n ]\n ]\n }, renderProps.children));\n});\nconst $bc237834342dbd75$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $kPH7g$forwardRef)(function Checkbox(props, ref) {\n let { inputRef: userProvidedInputRef = null, ...otherProps } = props;\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(otherProps, ref, (0, $4e85f108e88277b8$export$b085522c77523c51));\n let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};\n var _props_validationBehavior, _ref;\n let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';\n let groupState = (0, $kPH7g$useContext)($bc237834342dbd75$export$139c5b8563afc1fc);\n let inputRef = (0, $kPH7g$useObjectRef)((0, $kPH7g$useMemo)(()=>(0, $kPH7g$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [\n userProvidedInputRef,\n props.inputRef\n ]));\n let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isReadOnly: isReadOnly, isPressed: isPressed, isInvalid: isInvalid } = groupState ? (0, $kPH7g$useCheckboxGroupItem)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, groupState, inputRef) : (0, $kPH7g$useCheckbox)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n children: typeof props.children === 'function' ? true : props.children,\n validationBehavior: validationBehavior\n }, (0, $kPH7g$useToggleState)(props), inputRef);\n let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $kPH7g$useFocusRing)();\n let isInteractionDisabled = isDisabled || isReadOnly;\n let { hoverProps: hoverProps, isHovered: isHovered } = (0, $kPH7g$useHover)({\n ...props,\n isDisabled: isInteractionDisabled\n });\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-Checkbox',\n values: {\n isSelected: isSelected,\n isIndeterminate: props.isIndeterminate || false,\n isPressed: isPressed,\n isHovered: isHovered,\n isFocused: isFocused,\n isFocusVisible: isFocusVisible,\n isDisabled: isDisabled,\n isReadOnly: isReadOnly,\n isInvalid: isInvalid,\n isRequired: props.isRequired || false\n }\n });\n let DOMProps = (0, $kPH7g$filterDOMProps)(props, {\n global: true\n });\n delete DOMProps.id;\n delete DOMProps.onClick;\n return /*#__PURE__*/ (0, $kPH7g$react).createElement(\"label\", {\n ...(0, $kPH7g$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-indeterminate\": props.isIndeterminate || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-hovered\": isHovered || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-readonly\": isReadOnly || undefined,\n \"data-invalid\": isInvalid || undefined,\n \"data-required\": props.isRequired || undefined\n }, /*#__PURE__*/ (0, $kPH7g$react).createElement((0, $kPH7g$VisuallyHidden), {\n elementType: \"span\"\n }, /*#__PURE__*/ (0, $kPH7g$react).createElement(\"input\", {\n ...(0, $kPH7g$mergeProps)(inputProps, focusProps),\n ref: inputRef\n })), renderProps.children);\n});\n\n\nexport {$bc237834342dbd75$export$baf37c4be89255b8 as CheckboxGroupContext, $bc237834342dbd75$export$139c5b8563afc1fc as CheckboxGroupStateContext, $bc237834342dbd75$export$4aa08d5625cb8ead as CheckboxGroup, $bc237834342dbd75$export$48513f6b9f8ce62d as Checkbox};\n//# sourceMappingURL=Checkbox.module.js.map\n","/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport {\n Checkbox as RaCheckbox,\n type CheckboxProps,\n} from \"react-aria-components\";\nimport { checkboxSlotRecipe } from \"./checkbox.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"checkbox\",\n});\n\nexport interface CheckboxRootProps\n extends Omit<\n HTMLChakraProps<\"label\", RecipeVariantProps<typeof checkboxSlotRecipe>>,\n keyof CheckboxProps\n >,\n CheckboxProps {}\n\nexport const CheckboxRoot = withProvider<CheckboxRootProps, CheckboxRootProps>(\n RaCheckbox,\n \"root\"\n);\n\ninterface CheckboxLabelProps extends HTMLChakraProps<\"span\"> {}\nexport const CheckboxLabel = withContext<HTMLSpanElement, CheckboxLabelProps>(\n \"span\",\n \"label\"\n);\n\ninterface CheckboxIndicatorProps extends HTMLChakraProps<\"span\"> {}\nexport const CheckboxIndicator = withContext<\n HTMLSpanElement,\n CheckboxIndicatorProps\n>(\"span\", \"indicator\");\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { Check, Remove as Minus } from \"@commercetools/nimbus-icons\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { CheckboxProps } from \"./checkbox.types\";\nimport type { CheckboxRenderProps } from \"react-aria-components\";\nimport {\n CheckboxIndicator,\n CheckboxRoot,\n CheckboxLabel,\n} from \"./checkbox.slots\";\n\n/**\n * # Checkbox\n *\n * Displays a checkbox.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/checkbox}\n */\nexport const Checkbox = (props: CheckboxProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n const recipe = useSlotRecipe({ key: \"checkbox\" });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(restProps);\n\n const [styleProps, functionalProps] = extractStyleProps(remainingProps);\n\n return (\n <CheckboxRoot\n ref={forwardedRef}\n data-slot=\"root\"\n {...functionalProps}\n {...recipeProps}\n {...styleProps}\n >\n {({\n isSelected,\n isIndeterminate,\n isInvalid,\n isDisabled,\n isFocused,\n }: CheckboxRenderProps) => {\n const stateProps = {\n \"data-selected\": isSelected,\n \"data-indeterminate\": isIndeterminate,\n \"data-invalid\": isInvalid,\n \"data-disabled\": isDisabled,\n \"data-focus\": isFocused || undefined,\n };\n\n return (\n <>\n <CheckboxIndicator data-slot=\"indicator\" {...stateProps}>\n {isSelected && <Check />}\n {isIndeterminate && <Minus />}\n </CheckboxIndicator>\n\n {children && (\n <CheckboxLabel data-slot=\"label\" {...stateProps}>\n {children}\n </CheckboxLabel>\n )}\n </>\n );\n }}\n </CheckboxRoot>\n );\n};\nCheckbox.displayName = \"Checkbox\";\n"],"names":["$406796ff087fe49b$export$e375f10ce42261c5","props","state","inputRef","validationState","$jNP0e$useFormValidationState","isInvalid","validationErrors","validationDetails","labelProps","inputProps","isSelected","isPressed","isDisabled","isReadOnly","$jNP0e$useToggle","$jNP0e$useFormValidation","isIndeterminate","isRequired","validationBehavior","$jNP0e$useEffect","pressProps","$jNP0e$usePress","$jNP0e$privateValidationStateProp","groupValidationState","commitValidation","$jNP0e$mergeProps","$1ae600c947479353$export$ec98120685d4f57d","$fba3e38d5ca8983f$export$353b32fc6898d37d","toggleState","$6clEo$useToggleState","name","form","descriptionId","errorMessageId","_props_validationBehavior","realtimeValidation","$6clEo$useFormValidationState","nativeValidation","$6clEo$useRef","$6clEo$DEFAULT_VALIDATION_RESULT","updateValidation","$6clEo$useEffect","combinedRealtimeValidation","displayValidation","_props_isRequired","res","$6clEo$privateValidationStateProp","v","$bc237834342dbd75$export$139c5b8563afc1fc","$kPH7g$createContext","$bc237834342dbd75$export$48513f6b9f8ce62d","$kPH7g$forwardRef","ref","userProvidedInputRef","otherProps","$64fa3d84918910a7$export$29f1550f4b0d4415","$4e85f108e88277b8$export$b085522c77523c51","formValidationBehavior","$64fa3d84918910a7$export$fabf2dc03a41866e","$d3e0e05bdfcf66bd$export$c24727297075ec6a","_ref","groupState","$kPH7g$useContext","$kPH7g$useObjectRef","$kPH7g$useMemo","$kPH7g$mergeRefs","$kPH7g$useCheckboxGroupItem","$64fa3d84918910a7$export$ef03459518577ad4","$kPH7g$useCheckbox","$kPH7g$useToggleState","isFocused","isFocusVisible","focusProps","$kPH7g$useFocusRing","isInteractionDisabled","hoverProps","isHovered","$kPH7g$useHover","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","DOMProps","$kPH7g$filterDOMProps","$kPH7g$react","$kPH7g$mergeProps","$kPH7g$VisuallyHidden","withProvider","withContext","createSlotRecipeContext","CheckboxRoot","RaCheckbox","CheckboxLabel","CheckboxIndicator","Checkbox","forwardedRef","children","restProps","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","functionalProps","extractStyleProps","jsx","stateProps","jsxs","Fragment","Check","Minus"],"mappings":"mwBAuBA,SAASA,EAA0CC,EAAOC,EAAOC,EAAU,CAEvE,IAAIC,EAAsBC,4CAA+B,CACrD,GAAGJ,EACH,MAAOC,EAAM,UACrB,CAAK,EACG,CAAE,UAAWI,EAAW,iBAAkBC,EAAkB,kBAAmBC,GAAsBJ,EAAgB,kBACrH,CAAE,WAAYK,EAAY,WAAYC,EAAY,WAAYC,EAAY,UAAWC,EAAW,WAAYC,EAAY,WAAYC,CAAU,EAASC,4CAAkB,CACzK,GAAGd,EACH,UAAWK,CACnB,EAAOJ,EAAOC,CAAQ,EACda,4CAA0Bf,EAAOG,EAAiBD,CAAQ,EAC9D,GAAI,CAAE,gBAAiBc,EAAiB,WAAYC,EAAY,mBAAoBC,EAAqB,MAAM,EAAKlB,EAChHmB,EAAAA,UAAkB,IAAI,CAGlBjB,EAAS,UAASA,EAAS,QAAQ,cAAgB,CAAC,CAACc,EAC7D,CAAC,EAED,GAAI,CAAE,WAAYI,CAAU,EAASC,EAAAA,0CAAiB,CAClD,WAAYT,GAAcC,EAC1B,SAAW,CAEP,GAAI,CAAE,CAAKS,EAAAA,0CAAqCC,CAAoB,EAAKvB,EACrE,CAAE,iBAAkBwB,CAAgB,EAAKD,GAA8CpB,EAC3FqB,EAAgB,CACpB,CACR,CAAK,EACD,MAAO,CACH,WAAgBC,EAAAA,0CAAmBjB,EAAYY,CAAU,EACzD,WAAY,CACR,GAAGX,EACH,QAASC,EACT,gBAAiBO,GAAcC,IAAuB,QAAU,OAChE,SAAUD,GAAcC,IAAuB,Q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