@economic/taco 1.13.3 → 1.13.4
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/components/Button/Button.stories.d.ts +1 -0
- package/dist/components/IconButton/IconButton.stories.d.ts +1 -0
- package/dist/components/Popover/Popover.d.ts +1 -0
- package/dist/esm/packages/taco/src/components/Popover/Popover.js +4 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +3 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
- package/dist/taco.cjs.development.js +7 -2
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
- package/types.json +2 -2
@@ -17,6 +17,7 @@ declare const _default: {
|
|
17
17
|
}>>) => JSX.Element) | undefined;
|
18
18
|
menu?: ((props: Partial<import("../..").MenuProps>) => JSX.Element) | undefined;
|
19
19
|
popover?: ((props: Partial<React.PropsWithChildren<{
|
20
|
+
modal?: boolean | undefined;
|
20
21
|
trigger?: JSX.Element | undefined;
|
21
22
|
}>>) => JSX.Element) | undefined;
|
22
23
|
tooltip?: string | undefined;
|
@@ -12,6 +12,7 @@ declare const _default: {
|
|
12
12
|
icon: import("../..").IconName;
|
13
13
|
menu?: ((props: Partial<import("../..").MenuProps>) => JSX.Element) | undefined;
|
14
14
|
popover?: ((props: Partial<React.PropsWithChildren<{
|
15
|
+
modal?: boolean | undefined;
|
15
16
|
trigger?: JSX.Element | undefined;
|
16
17
|
}>>) => JSX.Element) | undefined;
|
17
18
|
rounded?: boolean | undefined;
|
@@ -12,6 +12,7 @@ export declare type PopoverContentProps = Omit<PopoverPrimitive.PopoverContentPr
|
|
12
12
|
};
|
13
13
|
export declare type PopoverCloseProps = React.HTMLAttributes<HTMLButtonElement>;
|
14
14
|
export declare type PopoverProps = React.PropsWithChildren<{
|
15
|
+
modal?: boolean;
|
15
16
|
/** A trigger to be used for the popover, should not be set if `children` already contains a trigger */
|
16
17
|
trigger?: JSX.Element;
|
17
18
|
}>;
|
@@ -70,6 +70,7 @@ const Close = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/createElement
|
|
70
70
|
const Popover = /*#__PURE__*/forwardRef(function Popover(props, ref) {
|
71
71
|
const {
|
72
72
|
children,
|
73
|
+
modal = false,
|
73
74
|
trigger,
|
74
75
|
...otherProps
|
75
76
|
} = props;
|
@@ -79,7 +80,9 @@ const Popover = /*#__PURE__*/forwardRef(function Popover(props, ref) {
|
|
79
80
|
}), [otherProps]);
|
80
81
|
return /*#__PURE__*/createElement(PopoverContext.Provider, {
|
81
82
|
value: context
|
82
|
-
}, /*#__PURE__*/createElement(Root,
|
83
|
+
}, /*#__PURE__*/createElement(Root, {
|
84
|
+
modal: modal
|
85
|
+
}, trigger && /*#__PURE__*/createElement(Trigger, null, trigger), children));
|
83
86
|
});
|
84
87
|
Popover.Trigger = Trigger;
|
85
88
|
Popover.Content = Content;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Popover.js","sources":["../../../../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Placement } from '../..';\nimport { UnstyledArrow } from './Primitives';\nimport { mergeRefs } from '../../utils/mergeRefs';\nimport { getPopoverStyleClassnames } from './util';\n\ntype PopoverContextValue = { props: any; ref: React.Ref<HTMLElement> };\n\nconst PopoverContext = React.createContext<PopoverContextValue>({\n props: {},\n ref: null,\n});\n\nexport type PopoverTriggerProps = React.HTMLAttributes<HTMLElement>;\nconst Trigger = React.forwardRef(function PopoverAnchor(props: PopoverTriggerProps, externalRef: React.Ref<HTMLElement>) {\n const { ref: parentRef, props: parentProps } = React.useContext(PopoverContext);\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n console.warn(\n `Popover.Trigger requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return <PopoverPrimitive.Trigger {...parentProps} {...props} children={children} ref={refCallback} asChild />;\n});\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('hide'));\n };\n\n return children({ close, ref });\n});\n\nexport type PopoverContentRenderProps = { close: () => void };\nexport type PopoverContentProps = Omit<PopoverPrimitive.PopoverContentProps, 'side'> & {\n children: React.ReactNode | ((props: PopoverContentRenderProps) => React.ReactNode);\n /** Set the position of the Popover relative to its trigger. Default value is `bottom` */\n placement?: Placement;\n};\nconst Content = React.forwardRef(function PopoverContent(props: PopoverContentProps, ref: React.Ref<HTMLDivElement>) {\n const { placement: side, ...popoverContentProps } = props;\n const className = cn(getPopoverStyleClassnames(), props.className);\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <PopoverPrimitive.Close asChild>\n <RenderPropWrapper>{props.children}</RenderPropWrapper>\n </PopoverPrimitive.Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n {...popoverContentProps}\n className={className}\n data-taco=\"popover\"\n side={side}\n sideOffset={1}\n ref={ref}>\n {output}\n <UnstyledArrow className=\"text-white\" />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n});\n\nexport type PopoverCloseProps = React.HTMLAttributes<HTMLButtonElement>;\nconst Close = React.forwardRef(\n (props: PopoverCloseProps, ref: React.Ref<HTMLButtonElement>): JSX.Element => (\n <PopoverPrimitive.Close {...props} ref={ref} asChild />\n )\n);\n\nexport type PopoverProps = React.PropsWithChildren<{\n /** A trigger to be used for the popover, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n}>;\nexport type ForwardedPopoverWithStatics = React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps>;\n Content: React.ForwardRefExoticComponent<PopoverContentProps>;\n Close: React.ForwardRefExoticComponent<PopoverCloseProps>;\n Portal: React.FunctionComponent<PopoverPrimitive.PortalProps>;\n};\n\nexport const Popover = React.forwardRef<HTMLElement, PopoverProps>(function Popover(props, ref) {\n const { children, trigger, ...otherProps } = props;\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\n\n return (\n <PopoverContext.Provider value={context}>\n <PopoverPrimitive.Root>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </PopoverPrimitive.Root>\n </PopoverContext.Provider>\n );\n}) as ForwardedPopoverWithStatics;\nPopover.Trigger = Trigger;\nPopover.Content = Content;\nPopover.Close = Close;\nPopover.Portal = PopoverPrimitive.Portal;\n"],"names":["PopoverContext","React","props","ref","Trigger","PopoverAnchor","externalRef","parentRef","parentProps","refCallback","mergeRefs","children","type","console","warn","name","PopoverPrimitive","asChild","RenderPropWrapper","onClick","close","CustomEvent","Content","PopoverContent","placement","side","popoverContentProps","className","cn","getPopoverStyleClassnames","output","sideOffset","UnstyledArrow","Close","Popover","trigger","otherProps","context","Provider","value","Portal"],"mappings":";;;;;;;AAUA,MAAMA,cAAc,gBAAGC,aAAmB,CAAsB;EAC5DC,KAAK,EAAE,EAAE;EACTC,GAAG,EAAE;CACR,CAAC;AAGF,MAAMC,OAAO,gBAAGH,UAAgB,CAAC,SAASI,aAAa,CAACH,KAA0B,EAAEI,WAAmC;;EACnH,MAAM;IAAEH,GAAG,EAAEI,SAAS;IAAEL,KAAK,EAAEM;GAAa,GAAGP,UAAgB,CAACD,cAAc,CAAC;EAC/E,MAAMS,WAAW,GAAGC,SAAS,CAAC,CAACH,SAAS,EAAED,WAAW,CAAC,CAAC;EAEvD,IAAIK,QAAQ,GAAGT,KA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G5B,KAAK,CAACS,QAAQ;;EAG3B,oBACIV,cAACe,MAAuB,qBACpBf,cAACe,SAAwB,oBACjBU,mBAAmB;IACvBC,SAAS,EAAEA,SAAS;iBACV,SAAS;IACnBF,IAAI,EAAEA,IAAI;IACVM,UAAU,EAAE,CAAC;IACb5B,GAAG,EAAEA;MACJ2B,MAAM,eACP7B,cAAC+B,aAAa;IAACL,SAAS,EAAC;IAAe,CACjB,CACL;AAElC,CAAC,CAAC;AAGF,MAAMM,KAAK,gBAAGhC,UAAgB,CAC1B,CAACC,KAAwB,EAAEC,GAAiC,kBACxDF,cAACe,OAAsB,oBAAKd,KAAK;EAAEC,GAAG,EAAEA,GAAG;EAAEc,OAAO;GACvD,CACJ;
|
1
|
+
{"version":3,"file":"Popover.js","sources":["../../../../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Placement } from '../..';\nimport { UnstyledArrow } from './Primitives';\nimport { mergeRefs } from '../../utils/mergeRefs';\nimport { getPopoverStyleClassnames } from './util';\n\ntype PopoverContextValue = { props: any; ref: React.Ref<HTMLElement> };\n\nconst PopoverContext = React.createContext<PopoverContextValue>({\n props: {},\n ref: null,\n});\n\nexport type PopoverTriggerProps = React.HTMLAttributes<HTMLElement>;\nconst Trigger = React.forwardRef(function PopoverAnchor(props: PopoverTriggerProps, externalRef: React.Ref<HTMLElement>) {\n const { ref: parentRef, props: parentProps } = React.useContext(PopoverContext);\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n console.warn(\n `Popover.Trigger requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return <PopoverPrimitive.Trigger {...parentProps} {...props} children={children} ref={refCallback} asChild />;\n});\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('hide'));\n };\n\n return children({ close, ref });\n});\n\nexport type PopoverContentRenderProps = { close: () => void };\nexport type PopoverContentProps = Omit<PopoverPrimitive.PopoverContentProps, 'side'> & {\n children: React.ReactNode | ((props: PopoverContentRenderProps) => React.ReactNode);\n /** Set the position of the Popover relative to its trigger. Default value is `bottom` */\n placement?: Placement;\n};\nconst Content = React.forwardRef(function PopoverContent(props: PopoverContentProps, ref: React.Ref<HTMLDivElement>) {\n const { placement: side, ...popoverContentProps } = props;\n const className = cn(getPopoverStyleClassnames(), props.className);\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <PopoverPrimitive.Close asChild>\n <RenderPropWrapper>{props.children}</RenderPropWrapper>\n </PopoverPrimitive.Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n {...popoverContentProps}\n className={className}\n data-taco=\"popover\"\n side={side}\n sideOffset={1}\n ref={ref}>\n {output}\n <UnstyledArrow className=\"text-white\" />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n});\n\nexport type PopoverCloseProps = React.HTMLAttributes<HTMLButtonElement>;\nconst Close = React.forwardRef(\n (props: PopoverCloseProps, ref: React.Ref<HTMLButtonElement>): JSX.Element => (\n <PopoverPrimitive.Close {...props} ref={ref} asChild />\n )\n);\n\nexport type PopoverProps = React.PropsWithChildren<{\n modal?: boolean;\n /** A trigger to be used for the popover, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n}>;\nexport type ForwardedPopoverWithStatics = React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps>;\n Content: React.ForwardRefExoticComponent<PopoverContentProps>;\n Close: React.ForwardRefExoticComponent<PopoverCloseProps>;\n Portal: React.FunctionComponent<PopoverPrimitive.PortalProps>;\n};\n\nexport const Popover = React.forwardRef<HTMLElement, PopoverProps>(function Popover(props, ref) {\n const { children, modal = false, trigger, ...otherProps } = props;\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\n\n return (\n <PopoverContext.Provider value={context}>\n <PopoverPrimitive.Root modal={modal}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </PopoverPrimitive.Root>\n </PopoverContext.Provider>\n );\n}) as ForwardedPopoverWithStatics;\nPopover.Trigger = Trigger;\nPopover.Content = Content;\nPopover.Close = Close;\nPopover.Portal = PopoverPrimitive.Portal;\n"],"names":["PopoverContext","React","props","ref","Trigger","PopoverAnchor","externalRef","parentRef","parentProps","refCallback","mergeRefs","children","type","console","warn","name","PopoverPrimitive","asChild","RenderPropWrapper","onClick","close","CustomEvent","Content","PopoverContent","placement","side","popoverContentProps","className","cn","getPopoverStyleClassnames","output","sideOffset","UnstyledArrow","Close","Popover","modal","trigger","otherProps","context","Provider","value","Portal"],"mappings":";;;;;;;AAUA,MAAMA,cAAc,gBAAGC,aAAmB,CAAsB;EAC5DC,KAAK,EAAE,EAAE;EACTC,GAAG,EAAE;CACR,CAAC;AAGF,MAAMC,OAAO,gBAAGH,UAAgB,CAAC,SAASI,aAAa,CAACH,KAA0B,EAAEI,WAAmC;;EACnH,MAAM;IAAEH,GAAG,EAAEI,SAAS;IAAEL,KAAK,EAAEM;GAAa,GAAGP,UAAgB,CAACD,cAAc,CAAC;EAC/E,MAAMS,WAAW,GAAGC,SAAS,CAAC,CAACH,SAAS,EAAED,WAAW,CAAC,CAAC;EAEvD,IAAIK,QAAQ,GAAGT,KAAK,CAACS,QAAQ;EAE7B,kBAAIV,cAAoB,CAACC,KAAK,CAACS,QAAQ,CAAC,IAAI,2BAAOT,KAAK,CAACS,QAAQ,oDAAd,gBAAgBC,IAAI,MAAK,UAAU,EAAE;IACpFC,OAAO,CAACC,IAAI,qHAC4GZ,KAAK,CAACS,QAAQ,CAACC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2B,MAAM,eACP7B,cAAC+B,aAAa;IAACL,SAAS,EAAC;IAAe,CACjB,CACL;AAElC,CAAC,CAAC;AAGF,MAAMM,KAAK,gBAAGhC,UAAgB,CAC1B,CAACC,KAAwB,EAAEC,GAAiC,kBACxDF,cAACe,OAAsB,oBAAKd,KAAK;EAAEC,GAAG,EAAEA,GAAG;EAAEc,OAAO;GACvD,CACJ;MAcYiB,OAAO,gBAAGjC,UAAgB,CAA4B,SAASiC,OAAO,CAAChC,KAAK,EAAEC,GAAG;EAC1F,MAAM;IAAEQ,QAAQ;IAAEwB,KAAK,GAAG,KAAK;IAAEC,OAAO;IAAE,GAAGC;GAAY,GAAGnC,KAAK;EACjE,MAAMoC,OAAO,GAAGrC,OAAa,CAAC,OAAO;IAAEC,KAAK,EAAEmC,UAAU;IAAElC;GAAK,CAAC,EAAE,CAACkC,UAAU,CAAC,CAAC;EAE/E,oBACIpC,cAACD,cAAc,CAACuC,QAAQ;IAACC,KAAK,EAAEF;kBAC5BrC,cAACe,IAAqB;IAACmB,KAAK,EAAEA;KACzBC,OAAO,iBAAInC,cAACG,OAAO,QAAEgC,OAAO,CAAW,EACvCzB,QAAQ,CACW,CACF;AAElC,CAAC;AACDuB,OAAO,CAAC9B,OAAO,GAAGA,OAAO;AACzB8B,OAAO,CAACZ,OAAO,GAAGA,OAAO;AACzBY,OAAO,CAACD,KAAK,GAAGA,KAAK;AACrBC,OAAO,CAACO,MAAM,GAAGzB,MAAuB;;;;"}
|
@@ -111,7 +111,9 @@ const EditPopover = props => {
|
|
111
111
|
event.stopPropagation();
|
112
112
|
}
|
113
113
|
};
|
114
|
-
return /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps
|
114
|
+
return /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps, {
|
115
|
+
modal: true
|
116
|
+
}), /*#__PURE__*/React__default.createElement(Popover.Content, {
|
115
117
|
onCloseAutoFocus: handleCloseAutoFocus,
|
116
118
|
onInteractOutside: handleInteractOutside,
|
117
119
|
onClick: event => event.stopPropagation(),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Edit.js","sources":["../../../../../../../../src/components/Select2/components/Edit.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport * as RadioGroup from '@radix-ui/react-radio-group';\nimport { Color, colors } from '../../../utils/colors';\nimport { Button } from '../../Button/Button';\nimport { Input } from '../../Input/Input';\nimport { Popover, PopoverProps } from '../../Popover/Popover';\nimport { Icon } from '../../Icon/Icon';\nimport { Select2OptionValue } from '../types';\nimport { useSelect2Context } from './Context';\nimport { Field } from '../../Field/Field';\nimport { Group } from '../../Group/Group';\nimport { useLocalization } from '../../Provider/Provider';\n\nconst AVAILABLE_COLORS = Object.keys(colors);\n\nexport type EditPopoverProps = PopoverProps & {\n color?: Color;\n text: string;\n value: Select2OptionValue;\n};\n\nexport const EditPopover = (props: EditPopoverProps) => {\n const { color: initialColor, text: initialName, value, ...popoverProps } = props;\n const ref = React.useRef<HTMLInputElement>(null);\n const { onDelete, onEdit, searchRef, ref: selectRef } = useSelect2Context();\n const { texts } = useLocalization();\n const [name, setName] = React.useState(initialName);\n const [color, setColor] = React.useState(initialColor);\n const [validationError, setValidationError] = React.useState<Error | undefined>();\n\n const handleInputChange = event => {\n setName(event.target.value);\n setValidationError(undefined);\n };\n\n const handleInputKeyDown = close => async event => {\n event.stopPropagation();\n\n if (event.key === 'Escape') {\n close();\n } else if (event.key === 'Enter') {\n handleSave(close)(event);\n }\n };\n\n const handleDelete = close => async event => {\n event.stopPropagation();\n close();\n\n if (onDelete) {\n await onDelete(value);\n }\n };\n\n const handleSave = close => async event => {\n if (onEdit && (name !== initialName || color !== initialColor)) {\n try {\n await onEdit(value, name, color);\n close();\n } catch (error) {\n event.preventDefault();\n event.stopPropagation();\n setValidationError(error);\n ref.current?.focus();\n }\n } else {\n close();\n }\n };\n\n const handleCloseAutoFocus = event => {\n event.preventDefault();\n setName(initialName);\n setColor(initialColor);\n setValidationError(undefined);\n\n if (searchRef?.current) {\n searchRef.current?.focus();\n } else {\n selectRef.current?.focus();\n }\n };\n\n const handleInteractOutside = () => {\n setName(initialName);\n setColor(initialColor);\n };\n\n const preventKeyDownPropagation = event => {\n if (event.key !== 'Escape') {\n event.stopPropagation();\n }\n };\n\n return (\n <Popover {...popoverProps}>\n <Popover.Content\n onCloseAutoFocus={handleCloseAutoFocus}\n onInteractOutside={handleInteractOutside}\n onClick={event => event.stopPropagation()}\n placement=\"right\"\n tabIndex={-1}\n className=\"focus:!shadow-none\">\n {({ close }) => (\n <>\n <div className=\"flex w-32 flex-col space-y-2\">\n {onEdit ? (\n <>\n <Field\n className={cn('!min-h-fit', { '!pb-0': !validationError })}\n invalid={!!validationError}\n message={validationError?.message}>\n <Input\n invalid={!!validationError}\n onChange={handleInputChange}\n onKeyDown={handleInputKeyDown(close)}\n ref={ref}\n value={name}\n />\n </Field>\n {initialColor ? (\n <>\n <h5>Colours</h5>\n <Colours\n color={color}\n onChangeColor={setColor}\n onKeyDown={preventKeyDownPropagation}\n />\n </>\n ) : null}\n <Group>\n <Button onClick={close}>{texts.select2.cancel}</Button>\n <Button appearance=\"primary\" onClick={handleSave(close)}>\n {texts.select2.save}\n </Button>\n </Group>\n </>\n ) : null}\n {onEdit && onDelete ? <hr /> : null}\n {onDelete ? (\n <button\n className=\"hover:text-grey-darkest flex items-center justify-start gap-1\"\n onClick={handleDelete(close)}\n onKeyDown={preventKeyDownPropagation}>\n <Icon className=\"!h-5 !w-5\" name=\"delete-permanently\" /> {texts.select2.delete}\n </button>\n ) : null}\n </div>\n </>\n )}\n </Popover.Content>\n </Popover>\n );\n};\n\nconst Colours = props => {\n const { color, onChangeColor, onClick, onKeyDown } = props;\n const { texts } = useLocalization();\n\n return (\n <RadioGroup.Root\n aria-label={texts.select2.chooseColor}\n className=\"grid grid-cols-4 gap-2 focus:outline-none\"\n onClick={onClick}\n onKeyDown={onKeyDown}\n onValueChange={color => onChangeColor(color)}\n value={color}>\n {AVAILABLE_COLORS.map((availableColor: string) => (\n <RadioGroup.Item\n aria-label={color}\n className={cn('flex h-6 w-6 cursor-pointer items-center justify-center rounded', colors[availableColor])}\n key={availableColor}\n onFocus={() => onChangeColor(availableColor)}\n value={availableColor}>\n <RadioGroup.Indicator asChild>\n <Icon name=\"tick\" className=\"!h-5 !w-5\" />\n </RadioGroup.Indicator>\n </RadioGroup.Item>\n ))}\n </RadioGroup.Root>\n );\n};\n"],"names":["AVAILABLE_COLORS","Object","keys","colors","EditPopover","props","color","initialColor","text","initialName","value","popoverProps","ref","React","useRef","onDelete","onEdit","searchRef","selectRef","useSelect2Context","texts","useLocalization","name","setName","useState","setColor","validationError","setValidationError","handleInputChange","event","target","undefined","handleInputKeyDown","close","stopPropagation","key","handleSave","handleDelete","error","preventDefault","current","focus","handleCloseAutoFocus","handleInteractOutside","preventKeyDownPropagation","Popover","Content","onCloseAutoFocus","onInteractOutside","onClick","placement","tabIndex","className","Field","cn","invalid","message","Input","onChange","onKeyDown","Colours","onChangeColor","Group","Button","select2","cancel","appearance","save","Icon","delete","RadioGroup","chooseColor","onValueChange","map","availableColor","onFocus","asChild"],"mappings":";;;;;;;;;;;;;;AAcA,MAAMA,gBAAgB,gBAAGC,MAAM,CAACC,IAAI,CAACC,MAAM,CAAC;MAQ/BC,WAAW,GAAIC,KAAuB;EAC/C,MAAM;IAAEC,KAAK,EAAEC,YAAY;IAAEC,IAAI,EAAEC,WAAW;IAAEC,KAAK;IAAE,GAAGC;GAAc,GAAGN,KAAK;EAChF,MAAMO,GAAG,GAAGC,cAAK,CAACC,MAAM,CAAmB,IAAI,CAAC;EAChD,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,SAAS;IAAEL,GAAG,EAAEM;GAAW,GAAGC,iBAAiB,EAAE;EAC3E,MAAM;IAAEC;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGV,cAAK,CAACW,QAAQ,CAACf,WAAW,CA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O;IAChBU,SAAS,EAAEA,SAAS;IACpBa,aAAa,EAAElE,KAAK,IAAIuD,aAAa,CAACvD,KAAK,CAAC;IAC5CI,KAAK,EAAEJ;KACNN,gBAAgB,CAACyE,GAAG,CAAEC,cAAsB,iBACzC7D,6BAACyD,IAAe;kBACAhE,KAAK;IACjB8C,SAAS,EAAEE,EAAE,CAAC,iEAAiE,EAAEnD,MAAM,CAACuE,cAAc,CAAC,CAAC;IACxGvC,GAAG,EAAEuC,cAAc;IACnBC,OAAO,EAAE,MAAMd,aAAa,CAACa,cAAc,CAAC;IAC5ChE,KAAK,EAAEgE;kBACP7D,6BAACyD,SAAoB;IAACM,OAAO;kBACzB/D,6BAACuD,IAAI;IAAC9C,IAAI,EAAC,MAAM;IAAC8B,SAAS,EAAC;IAAc,CACvB,CAE9B,CAAC,CACY;AAE1B,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Edit.js","sources":["../../../../../../../../src/components/Select2/components/Edit.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport * as RadioGroup from '@radix-ui/react-radio-group';\nimport { Color, colors } from '../../../utils/colors';\nimport { Button } from '../../Button/Button';\nimport { Input } from '../../Input/Input';\nimport { Popover, PopoverProps } from '../../Popover/Popover';\nimport { Icon } from '../../Icon/Icon';\nimport { Select2OptionValue } from '../types';\nimport { useSelect2Context } from './Context';\nimport { Field } from '../../Field/Field';\nimport { Group } from '../../Group/Group';\nimport { useLocalization } from '../../Provider/Provider';\n\nconst AVAILABLE_COLORS = Object.keys(colors);\n\nexport type EditPopoverProps = PopoverProps & {\n color?: Color;\n text: string;\n value: Select2OptionValue;\n};\n\nexport const EditPopover = (props: EditPopoverProps) => {\n const { color: initialColor, text: initialName, value, ...popoverProps } = props;\n const ref = React.useRef<HTMLInputElement>(null);\n const { onDelete, onEdit, searchRef, ref: selectRef } = useSelect2Context();\n const { texts } = useLocalization();\n const [name, setName] = React.useState(initialName);\n const [color, setColor] = React.useState(initialColor);\n const [validationError, setValidationError] = React.useState<Error | undefined>();\n\n const handleInputChange = event => {\n setName(event.target.value);\n setValidationError(undefined);\n };\n\n const handleInputKeyDown = close => async event => {\n event.stopPropagation();\n\n if (event.key === 'Escape') {\n close();\n } else if (event.key === 'Enter') {\n handleSave(close)(event);\n }\n };\n\n const handleDelete = close => async event => {\n event.stopPropagation();\n close();\n\n if (onDelete) {\n await onDelete(value);\n }\n };\n\n const handleSave = close => async event => {\n if (onEdit && (name !== initialName || color !== initialColor)) {\n try {\n await onEdit(value, name, color);\n close();\n } catch (error) {\n event.preventDefault();\n event.stopPropagation();\n setValidationError(error);\n ref.current?.focus();\n }\n } else {\n close();\n }\n };\n\n const handleCloseAutoFocus = event => {\n event.preventDefault();\n setName(initialName);\n setColor(initialColor);\n setValidationError(undefined);\n\n if (searchRef?.current) {\n searchRef.current?.focus();\n } else {\n selectRef.current?.focus();\n }\n };\n\n const handleInteractOutside = () => {\n setName(initialName);\n setColor(initialColor);\n };\n\n const preventKeyDownPropagation = event => {\n if (event.key !== 'Escape') {\n event.stopPropagation();\n }\n };\n\n return (\n <Popover {...popoverProps} modal>\n <Popover.Content\n onCloseAutoFocus={handleCloseAutoFocus}\n onInteractOutside={handleInteractOutside}\n onClick={event => event.stopPropagation()}\n placement=\"right\"\n tabIndex={-1}\n className=\"focus:!shadow-none\">\n {({ close }) => (\n <>\n <div className=\"flex w-32 flex-col space-y-2\">\n {onEdit ? (\n <>\n <Field\n className={cn('!min-h-fit', { '!pb-0': !validationError })}\n invalid={!!validationError}\n message={validationError?.message}>\n <Input\n invalid={!!validationError}\n onChange={handleInputChange}\n onKeyDown={handleInputKeyDown(close)}\n ref={ref}\n value={name}\n />\n </Field>\n {initialColor ? (\n <>\n <h5>Colours</h5>\n <Colours\n color={color}\n onChangeColor={setColor}\n onKeyDown={preventKeyDownPropagation}\n />\n </>\n ) : null}\n <Group>\n <Button onClick={close}>{texts.select2.cancel}</Button>\n <Button appearance=\"primary\" onClick={handleSave(close)}>\n {texts.select2.save}\n </Button>\n </Group>\n </>\n ) : null}\n {onEdit && onDelete ? <hr /> : null}\n {onDelete ? (\n <button\n className=\"hover:text-grey-darkest flex items-center justify-start gap-1\"\n onClick={handleDelete(close)}\n onKeyDown={preventKeyDownPropagation}>\n <Icon className=\"!h-5 !w-5\" name=\"delete-permanently\" /> {texts.select2.delete}\n </button>\n ) : null}\n </div>\n </>\n )}\n </Popover.Content>\n </Popover>\n );\n};\n\nconst Colours = props => {\n const { color, onChangeColor, onClick, onKeyDown } = props;\n const { texts } = useLocalization();\n\n return (\n <RadioGroup.Root\n aria-label={texts.select2.chooseColor}\n className=\"grid grid-cols-4 gap-2 focus:outline-none\"\n onClick={onClick}\n onKeyDown={onKeyDown}\n onValueChange={color => onChangeColor(color)}\n value={color}>\n {AVAILABLE_COLORS.map((availableColor: string) => (\n <RadioGroup.Item\n aria-label={color}\n className={cn('flex h-6 w-6 cursor-pointer items-center justify-center rounded', colors[availableColor])}\n key={availableColor}\n onFocus={() => onChangeColor(availableColor)}\n value={availableColor}>\n <RadioGroup.Indicator asChild>\n <Icon name=\"tick\" className=\"!h-5 !w-5\" />\n </RadioGroup.Indicator>\n </RadioGroup.Item>\n ))}\n </RadioGroup.Root>\n );\n};\n"],"names":["AVAILABLE_COLORS","Object","keys","colors","EditPopover","props","color","initialColor","text","initialName","value","popoverProps","ref","React","useRef","onDelete","onEdit","searchRef","selectRef","useSelect2Context","texts","useLocalization","name","setName","useState","setColor","validationError","setValidationError","handleInputChange","event","target","undefined","handleInputKeyDown","close","stopPropagation","key","handleSave","handleDelete","error","preventDefault","current","focus","handleCloseAutoFocus","handleInteractOutside","preventKeyDownPropagation","Popover","modal","Content","onCloseAutoFocus","onInteractOutside","onClick","placement","tabIndex","className","Field","cn","invalid","message","Input","onChange","onKeyDown","Colours","onChangeColor","Group","Button","select2","cancel","appearance","save","Icon","delete","RadioGroup","chooseColor","onValueChange","map","availableColor","onFocus","asChild"],"mappings":";;;;;;;;;;;;;;AAcA,MAAMA,gBA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EAAEb,YAAY,CAACJ,KAAK,CAAC;IAC5B2B,SAAS,EAAEhB;kBACX/B,6BAACwD,IAAI;IAAChB,SAAS,EAAC,WAAW;IAAC/B,IAAI,EAAC;IAAuB,OAAEF,KAAK,CAAC6C,OAAO,CAACK,MAAM,CACzE,GACT,IAAI,CACN,CAEb,CACa,CACZ;AAElB;AAEA,MAAMT,OAAO,GAAGxD,KAAK;EACjB,MAAM;IAAEC,KAAK;IAAEwD,aAAa;IAAEZ,OAAO;IAAEU;GAAW,GAAGvD,KAAK;EAC1D,MAAM;IAAEe;GAAO,GAAGC,eAAe,EAAE;EAEnC,oBACIR,6BAAC0D,IAAe;kBACAnD,KAAK,CAAC6C,OAAO,CAACO,WAAW;IACrCnB,SAAS,EAAC,2CAA2C;IACrDH,OAAO,EAAEA,OAAO;IAChBU,SAAS,EAAEA,SAAS;IACpBa,aAAa,EAAEnE,KAAK,IAAIwD,aAAa,CAACxD,KAAK,CAAC;IAC5CI,KAAK,EAAEJ;KACNN,gBAAgB,CAAC0E,GAAG,CAAEC,cAAsB,iBACzC9D,6BAAC0D,IAAe;kBACAjE,KAAK;IACjB+C,SAAS,EAAEE,EAAE,CAAC,iEAAiE,EAAEpD,MAAM,CAACwE,cAAc,CAAC,CAAC;IACxGxC,GAAG,EAAEwC,cAAc;IACnBC,OAAO,EAAE,MAAMd,aAAa,CAACa,cAAc,CAAC;IAC5CjE,KAAK,EAAEiE;kBACP9D,6BAAC0D,SAAoB;IAACM,OAAO;kBACzBhE,6BAACwD,IAAI;IAAC/C,IAAI,EAAC,MAAM;IAAC+B,SAAS,EAAC;IAAc,CACvB,CAE9B,CAAC,CACY;AAE1B,CAAC;;;;"}
|
@@ -5235,6 +5235,7 @@ const Close$1 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React
|
|
5235
5235
|
const Popover = /*#__PURE__*/React.forwardRef(function Popover(props, ref) {
|
5236
5236
|
const {
|
5237
5237
|
children,
|
5238
|
+
modal = false,
|
5238
5239
|
trigger,
|
5239
5240
|
...otherProps
|
5240
5241
|
} = props;
|
@@ -5244,7 +5245,9 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(props, ref) {
|
|
5244
5245
|
}), [otherProps]);
|
5245
5246
|
return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
|
5246
5247
|
value: context
|
5247
|
-
}, /*#__PURE__*/React.createElement(PopoverPrimitive.Root,
|
5248
|
+
}, /*#__PURE__*/React.createElement(PopoverPrimitive.Root, {
|
5249
|
+
modal: modal
|
5250
|
+
}, trigger && /*#__PURE__*/React.createElement(Trigger$2, null, trigger), children));
|
5248
5251
|
});
|
5249
5252
|
Popover.Trigger = Trigger$2;
|
5250
5253
|
Popover.Content = Content$3;
|
@@ -7723,7 +7726,9 @@ const EditPopover = props => {
|
|
7723
7726
|
event.stopPropagation();
|
7724
7727
|
}
|
7725
7728
|
};
|
7726
|
-
return /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps
|
7729
|
+
return /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps, {
|
7730
|
+
modal: true
|
7731
|
+
}), /*#__PURE__*/React__default.createElement(Popover.Content, {
|
7727
7732
|
onCloseAutoFocus: handleCloseAutoFocus,
|
7728
7733
|
onInteractOutside: handleInteractOutside,
|
7729
7734
|
onClick: event => event.stopPropagation(),
|