@chayns-components/core 5.0.0-beta.1118 → 5.0.0-beta.1122

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.
Files changed (29) hide show
  1. package/lib/cjs/components/tag-input/TagInput.js +25 -11
  2. package/lib/cjs/components/tag-input/TagInput.js.map +1 -1
  3. package/lib/cjs/components/verification-badge/VerificationBadge.js +15 -0
  4. package/lib/cjs/components/verification-badge/VerificationBadge.js.map +1 -0
  5. package/lib/cjs/components/verification-badge/VerificationBadge.styles.js +10 -0
  6. package/lib/cjs/components/verification-badge/VerificationBadge.styles.js.map +1 -0
  7. package/lib/cjs/hooks/container.js +39 -0
  8. package/lib/cjs/hooks/container.js.map +1 -0
  9. package/lib/cjs/index.js +20 -0
  10. package/lib/cjs/index.js.map +1 -1
  11. package/lib/cjs/types/tagInput.js.map +1 -1
  12. package/lib/esm/components/tag-input/TagInput.js +25 -11
  13. package/lib/esm/components/tag-input/TagInput.js.map +1 -1
  14. package/lib/esm/components/verification-badge/VerificationBadge.js +8 -0
  15. package/lib/esm/components/verification-badge/VerificationBadge.js.map +1 -0
  16. package/lib/esm/components/verification-badge/VerificationBadge.styles.js +3 -0
  17. package/lib/esm/components/verification-badge/VerificationBadge.styles.js.map +1 -0
  18. package/lib/esm/hooks/container.js +33 -0
  19. package/lib/esm/hooks/container.js.map +1 -0
  20. package/lib/esm/index.js +2 -0
  21. package/lib/esm/index.js.map +1 -1
  22. package/lib/esm/types/tagInput.js.map +1 -1
  23. package/lib/types/components/tag-input/TagInput.d.ts +14 -1
  24. package/lib/types/components/verification-badge/VerificationBadge.d.ts +6 -0
  25. package/lib/types/components/verification-badge/VerificationBadge.styles.d.ts +1 -0
  26. package/lib/types/hooks/container.d.ts +14 -0
  27. package/lib/types/index.d.ts +3 -0
  28. package/lib/types/types/tagInput.d.ts +2 -0
  29. package/package.json +2 -2
@@ -17,8 +17,11 @@ const TagInput = /*#__PURE__*/(0, _react.forwardRef)(({
17
17
  placeholder,
18
18
  tags,
19
19
  onRemove,
20
+ onChange,
20
21
  onAdd,
21
- onChange
22
+ leftElement,
23
+ shouldAllowMultiple = true,
24
+ shouldPreventEnter
22
25
  }, ref) => {
23
26
  const [internalTags, setInternalTags] = (0, _react.useState)();
24
27
  const [currentValue, setCurrentValue] = (0, _react.useState)('');
@@ -27,20 +30,25 @@ const TagInput = /*#__PURE__*/(0, _react.forwardRef)(({
27
30
  const theme = (0, _styledComponents.useTheme)();
28
31
  (0, _react.useEffect)(() => {
29
32
  if (tags) {
30
- setInternalTags(tags);
33
+ setInternalTags(shouldAllowMultiple ? tags : tags.slice(0, 1));
31
34
  }
32
- }, [tags]);
35
+ }, [shouldAllowMultiple, tags]);
36
+ const handleResetValue = () => {
37
+ setCurrentValue('');
38
+ };
33
39
  const shouldChangeColor = (0, _react.useMemo)(() => areaProvider.shouldChangeColor ?? false, [areaProvider.shouldChangeColor]);
34
40
  (0, _react.useImperativeHandle)(ref, () => ({
35
- getUnsavedTagText: currentValue !== '' ? currentValue : undefined
41
+ getUnsavedTagText: currentValue !== '' ? currentValue : undefined,
42
+ resetValue: handleResetValue
36
43
  }), [currentValue]);
37
44
  const handleKeyDown = (0, _react.useCallback)(event => {
38
- if (event.key === 'Enter') {
45
+ if (event.key === 'Enter' && !shouldPreventEnter) {
39
46
  setCurrentValue(prevValue => {
40
47
  if (!prevValue) {
41
48
  return '';
42
49
  }
43
50
  setInternalTags(prevTags => {
51
+ if (!shouldAllowMultiple && ((prevTags === null || prevTags === void 0 ? void 0 : prevTags.length) ?? 0) > 0) return prevTags;
44
52
  const newTag = {
45
53
  id: (0, _uuid.v4)(),
46
54
  text: prevValue
@@ -80,7 +88,7 @@ const TagInput = /*#__PURE__*/(0, _react.forwardRef)(({
80
88
  return updatedTags;
81
89
  });
82
90
  }
83
- }, [currentValue, internalTags, onAdd, onRemove, selectedId]);
91
+ }, [currentValue, internalTags, onAdd, onRemove, selectedId, shouldAllowMultiple, shouldPreventEnter]);
84
92
  const handleChange = (0, _react.useCallback)(event => {
85
93
  setCurrentValue(event.target.value);
86
94
  if (typeof onChange === 'function') {
@@ -106,26 +114,32 @@ const TagInput = /*#__PURE__*/(0, _react.forwardRef)(({
106
114
  }
107
115
  internalTags.forEach(({
108
116
  text,
109
- id
117
+ id,
118
+ rightElement
110
119
  }) => {
111
120
  items.push(/*#__PURE__*/_react.default.createElement(_Badge.default, {
112
121
  key: `tag-input-${id}`,
113
122
  backgroundColor: id === selectedId ? theme['206'] ?? undefined : undefined
114
- }, /*#__PURE__*/_react.default.createElement(_TagInput.StyledTagInputTagWrapper, null, /*#__PURE__*/_react.default.createElement(_TagInput.StyledTagInputTagWrapperText, null, text), /*#__PURE__*/_react.default.createElement(_Icon.default, {
123
+ }, /*#__PURE__*/_react.default.createElement(_TagInput.StyledTagInputTagWrapper, null, /*#__PURE__*/_react.default.createElement(_TagInput.StyledTagInputTagWrapperText, null, text), rightElement, /*#__PURE__*/_react.default.createElement(_Icon.default, {
115
124
  icons: ['ts-wrong'],
116
- onClick: () => handleIconClick(id)
125
+ onClick: event => {
126
+ event.preventDefault();
127
+ event.stopPropagation();
128
+ handleIconClick(id);
129
+ }
117
130
  }))));
118
131
  });
119
132
  return items;
120
133
  }, [handleIconClick, internalTags, selectedId, theme]);
134
+ const shouldShowInput = (0, _react.useMemo)(() => shouldAllowMultiple || ((internalTags === null || internalTags === void 0 ? void 0 : internalTags.length) ?? 0) < 1, [internalTags === null || internalTags === void 0 ? void 0 : internalTags.length, shouldAllowMultiple]);
121
135
  return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_TagInput.StyledTagInput, {
122
136
  $shouldChangeColor: shouldChangeColor
123
- }, content, /*#__PURE__*/_react.default.createElement(_TagInput.StyledTagInputTagInput, {
137
+ }, leftElement && leftElement, content, shouldShowInput && /*#__PURE__*/_react.default.createElement(_TagInput.StyledTagInputTagInput, {
124
138
  placeholder: tags && tags.length > 0 ? undefined : placeholder,
125
139
  onKeyDown: handleKeyDown,
126
140
  onChange: handleChange,
127
141
  value: currentValue
128
- })), [content, currentValue, handleChange, handleKeyDown, placeholder, shouldChangeColor, tags]);
142
+ })), [content, currentValue, handleChange, handleKeyDown, leftElement, placeholder, shouldChangeColor, shouldShowInput, tags]);
129
143
  });
130
144
  var _default = exports.default = TagInput;
131
145
  //# sourceMappingURL=TagInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TagInput.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_uuid","_Badge","_interopRequireDefault","_Icon","_TagInput","_AreaContextProvider","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TagInput","forwardRef","placeholder","tags","onRemove","onAdd","onChange","ref","internalTags","setInternalTags","useState","currentValue","setCurrentValue","selectedId","setSelectedId","areaProvider","useContext","AreaContext","theme","useTheme","useEffect","shouldChangeColor","useMemo","useImperativeHandle","getUnsavedTagText","undefined","handleKeyDown","useCallback","event","key","prevValue","prevTags","newTag","id","uuidv4","text","_internalTags","newSelectedId","length","prevState","_prevState","removedId","updatedTags","filter","tag","handleChange","target","value","handleIconClick","content","items","forEach","push","createElement","backgroundColor","StyledTagInputTagWrapper","StyledTagInputTagWrapperText","icons","onClick","StyledTagInput","$shouldChangeColor","StyledTagInputTagInput","onKeyDown","_default","exports"],"sources":["../../../../src/components/tag-input/TagInput.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ChangeEvent,\n type KeyboardEvent,\n type ReactElement,\n useImperativeHandle,\n useContext,\n ChangeEventHandler,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport type { Tag } from '../../types/tagInput';\nimport Badge from '../badge/Badge';\nimport Icon from '../icon/Icon';\nimport {\n StyledTagInput,\n StyledTagInputTagInput,\n StyledTagInputTagWrapper,\n StyledTagInputTagWrapperText,\n} from './TagInput.styles';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport type TagInputProps = {\n /**\n * Function to be executed when a tag is added.\n */\n onAdd?: (tag: Tag) => void;\n /**\n * Function to be executed when the value of the input is changed.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when a tag is removed.\n */\n onRemove?: (id: string) => void;\n /**\n * The placeholder that should be displayed.\n */\n placeholder?: string;\n /**\n * The tags that should be displayed.\n */\n tags?: Tag[];\n};\n\nexport type TagInputRef = {\n getUnsavedTagText: Tag['text'] | undefined;\n};\n\nconst TagInput = forwardRef<TagInputRef, TagInputProps>(\n ({ placeholder, tags, onRemove, onAdd, onChange }, ref) => {\n const [internalTags, setInternalTags] = useState<Tag[]>();\n const [currentValue, setCurrentValue] = useState('');\n const [selectedId, setSelectedId] = useState<Tag['id']>();\n\n const areaProvider = useContext(AreaContext);\n\n const theme = useTheme() as Theme;\n\n useEffect(() => {\n if (tags) {\n setInternalTags(tags);\n }\n }, [tags]);\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n getUnsavedTagText: currentValue !== '' ? currentValue : undefined,\n }),\n [currentValue],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Enter') {\n setCurrentValue((prevValue) => {\n if (!prevValue) {\n return '';\n }\n\n setInternalTags((prevTags) => {\n const newTag = { id: uuidv4(), text: prevValue };\n\n if (typeof onAdd === 'function') {\n onAdd(newTag);\n }\n\n return prevTags ? [...prevTags, newTag] : [newTag];\n });\n\n return '';\n });\n }\n\n if (event.key === 'Backspace' && currentValue === '') {\n if (!selectedId) {\n if (!internalTags) {\n return;\n }\n\n const newSelectedId = internalTags[internalTags.length - 1]?.id;\n\n setSelectedId(newSelectedId);\n\n return;\n }\n\n setInternalTags((prevState) => {\n if (!prevState) {\n return prevState;\n }\n\n const removedId = prevState[prevState.length - 1]?.id;\n\n if (!removedId) {\n return prevState;\n }\n\n const updatedTags = (prevState ?? []).filter((tag) => tag.id !== removedId);\n\n if (typeof onRemove === 'function') {\n onRemove(removedId);\n }\n\n setSelectedId(undefined);\n\n return updatedTags;\n });\n }\n },\n [currentValue, internalTags, onAdd, onRemove, selectedId],\n );\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setCurrentValue(event.target.value);\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n\n if (event.target.value !== '') {\n setSelectedId(undefined);\n }\n },\n [onChange],\n );\n\n const handleIconClick = useCallback(\n (id: string) => {\n setInternalTags((prevState) => {\n const updatedTags = (prevState ?? []).filter((tag) => tag.id !== id);\n\n if (typeof onRemove === 'function') {\n onRemove(id);\n }\n\n return updatedTags;\n });\n },\n [onRemove],\n );\n\n const content = useMemo(() => {\n const items: ReactElement[] = [];\n\n if (!internalTags) {\n return items;\n }\n\n internalTags.forEach(({ text, id }) => {\n items.push(\n <Badge\n key={`tag-input-${id}`}\n backgroundColor={\n id === selectedId ? ((theme['206'] as string) ?? undefined) : undefined\n }\n >\n <StyledTagInputTagWrapper>\n <StyledTagInputTagWrapperText>{text}</StyledTagInputTagWrapperText>\n <Icon icons={['ts-wrong']} onClick={() => handleIconClick(id)} />\n </StyledTagInputTagWrapper>\n </Badge>,\n );\n });\n\n return items;\n }, [handleIconClick, internalTags, selectedId, theme]);\n\n return useMemo(\n () => (\n <StyledTagInput $shouldChangeColor={shouldChangeColor}>\n {content}\n <StyledTagInputTagInput\n placeholder={tags && tags.length > 0 ? undefined : placeholder}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n value={currentValue}\n />\n </StyledTagInput>\n ),\n [\n content,\n currentValue,\n handleChange,\n handleKeyDown,\n placeholder,\n shouldChangeColor,\n tags,\n ],\n );\n },\n);\n\nexport default TagInput;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OA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","require","_styledComponents","_uuid","_Badge","_interopRequireDefault","_Icon","_TagInput","_AreaContextProvider","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TagInput","forwardRef","placeholder","tags","onRemove","onChange","onAdd","leftElement","shouldAllowMultiple","shouldPreventEnter","ref","internalTags","setInternalTags","useState","currentValue","setCurrentValue","selectedId","setSelectedId","areaProvider","useContext","AreaContext","theme","useTheme","useEffect","slice","handleResetValue","shouldChangeColor","useMemo","useImperativeHandle","getUnsavedTagText","undefined","resetValue","handleKeyDown","useCallback","event","key","prevValue","prevTags","length","newTag","id","uuidv4","text","_internalTags","newSelectedId","prevState","_prevState","removedId","updatedTags","filter","tag","handleChange","target","value","handleIconClick","content","items","forEach","rightElement","push","createElement","backgroundColor","StyledTagInputTagWrapper","StyledTagInputTagWrapperText","icons","onClick","preventDefault","stopPropagation","shouldShowInput","StyledTagInput","$shouldChangeColor","StyledTagInputTagInput","onKeyDown","_default","exports"],"sources":["../../../../src/components/tag-input/TagInput.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ChangeEvent,\n type KeyboardEvent,\n type ReactElement,\n useImperativeHandle,\n useContext,\n ChangeEventHandler,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport type { Tag } from '../../types/tagInput';\nimport Badge from '../badge/Badge';\nimport Icon from '../icon/Icon';\nimport {\n StyledTagInput,\n StyledTagInputTagInput,\n StyledTagInputTagWrapper,\n StyledTagInputTagWrapperText,\n} from './TagInput.styles';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport type TagInputProps = {\n /**\n * An element that should be displayed on the left side of the input.\n */\n leftElement?: ReactElement;\n /**\n * Function to be executed when a tag is added.\n */\n onAdd?: (tag: Tag) => void;\n /**\n * Function to be executed when the value of the input is changed.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when a tag is removed.\n */\n onRemove?: (id: string) => void;\n /**\n * The placeholder that should be displayed.\n */\n placeholder?: string;\n /**\n * The tags that should be displayed.\n */\n tags?: Tag[];\n /**\n * Whether multiple tags should be allowed.\n */\n shouldAllowMultiple?: boolean;\n /**\n * Whether the enter key should be prevented.\n */\n shouldPreventEnter?: boolean;\n};\n\nexport type TagInputRef = {\n getUnsavedTagText: Tag['text'] | undefined;\n resetValue: () => void;\n};\n\nconst TagInput = forwardRef<TagInputRef, TagInputProps>(\n (\n {\n placeholder,\n tags,\n onRemove,\n onChange,\n onAdd,\n leftElement,\n shouldAllowMultiple = true,\n shouldPreventEnter,\n },\n ref,\n ) => {\n const [internalTags, setInternalTags] = useState<Tag[]>();\n const [currentValue, setCurrentValue] = useState('');\n const [selectedId, setSelectedId] = useState<Tag['id']>();\n\n const areaProvider = useContext(AreaContext);\n\n const theme = useTheme() as Theme;\n\n useEffect(() => {\n if (tags) {\n setInternalTags(shouldAllowMultiple ? tags : tags.slice(0, 1));\n }\n }, [shouldAllowMultiple, tags]);\n\n const handleResetValue = () => {\n setCurrentValue('');\n };\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n getUnsavedTagText: currentValue !== '' ? currentValue : undefined,\n resetValue: handleResetValue,\n }),\n [currentValue],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Enter' && !shouldPreventEnter) {\n setCurrentValue((prevValue) => {\n if (!prevValue) {\n return '';\n }\n\n setInternalTags((prevTags) => {\n if (!shouldAllowMultiple && (prevTags?.length ?? 0) > 0)\n return prevTags;\n\n const newTag = { id: uuidv4(), text: prevValue };\n\n if (typeof onAdd === 'function') {\n onAdd(newTag);\n }\n\n return prevTags ? [...prevTags, newTag] : [newTag];\n });\n\n return '';\n });\n }\n\n if (event.key === 'Backspace' && currentValue === '') {\n if (!selectedId) {\n if (!internalTags) {\n return;\n }\n\n const newSelectedId = internalTags[internalTags.length - 1]?.id;\n\n setSelectedId(newSelectedId);\n\n return;\n }\n\n setInternalTags((prevState) => {\n if (!prevState) {\n return prevState;\n }\n\n const removedId = prevState[prevState.length - 1]?.id;\n\n if (!removedId) {\n return prevState;\n }\n\n const updatedTags = (prevState ?? []).filter((tag) => tag.id !== removedId);\n\n if (typeof onRemove === 'function') {\n onRemove(removedId);\n }\n\n setSelectedId(undefined);\n\n return updatedTags;\n });\n }\n },\n [\n currentValue,\n internalTags,\n onAdd,\n onRemove,\n selectedId,\n shouldAllowMultiple,\n shouldPreventEnter,\n ],\n );\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setCurrentValue(event.target.value);\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n\n if (event.target.value !== '') {\n setSelectedId(undefined);\n }\n },\n [onChange],\n );\n\n const handleIconClick = useCallback(\n (id: string) => {\n setInternalTags((prevState) => {\n const updatedTags = (prevState ?? []).filter((tag) => tag.id !== id);\n\n if (typeof onRemove === 'function') {\n onRemove(id);\n }\n\n return updatedTags;\n });\n },\n [onRemove],\n );\n\n const content = useMemo(() => {\n const items: ReactElement[] = [];\n\n if (!internalTags) {\n return items;\n }\n\n internalTags.forEach(({ text, id, rightElement }) => {\n items.push(\n <Badge\n key={`tag-input-${id}`}\n backgroundColor={\n id === selectedId ? ((theme['206'] as string) ?? undefined) : undefined\n }\n >\n <StyledTagInputTagWrapper>\n <StyledTagInputTagWrapperText>{text}</StyledTagInputTagWrapperText>\n {rightElement}\n <Icon\n icons={['ts-wrong']}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n\n handleIconClick(id);\n }}\n />\n </StyledTagInputTagWrapper>\n </Badge>,\n );\n });\n\n return items;\n }, [handleIconClick, internalTags, selectedId, theme]);\n\n const shouldShowInput = useMemo(\n () => shouldAllowMultiple || (internalTags?.length ?? 0) < 1,\n [internalTags?.length, shouldAllowMultiple],\n );\n\n return useMemo(\n () => (\n <StyledTagInput $shouldChangeColor={shouldChangeColor}>\n {leftElement && leftElement}\n {content}\n {shouldShowInput && (\n <StyledTagInputTagInput\n placeholder={tags && tags.length > 0 ? undefined : placeholder}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n value={currentValue}\n />\n )}\n </StyledTagInput>\n ),\n [\n content,\n currentValue,\n handleChange,\n handleKeyDown,\n leftElement,\n placeholder,\n shouldChangeColor,\n shouldShowInput,\n tags,\n ],\n );\n },\n);\n\nexport default TagInput;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAaA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAMA,IAAAO,oBAAA,GAAAP,OAAA;AAAmE,SAAAI,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAS,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAA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AA,GAEaiB,QAAQ","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _VerificationBadge = require("./VerificationBadge.styles");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const VerificationBadge = () => /*#__PURE__*/_react.default.createElement(_VerificationBadge.StyledVerificationBadge, {
11
+ className: "vcid-check--blue"
12
+ }, /*#__PURE__*/_react.default.createElement("span", null), /*#__PURE__*/_react.default.createElement("span", null), /*#__PURE__*/_react.default.createElement("span", null));
13
+ VerificationBadge.displayName = 'VerificationBadge';
14
+ var _default = exports.default = VerificationBadge;
15
+ //# sourceMappingURL=VerificationBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerificationBadge.js","names":["_react","_interopRequireDefault","require","_VerificationBadge","e","__esModule","default","VerificationBadge","createElement","StyledVerificationBadge","className","displayName","_default","exports"],"sources":["../../../../src/components/verification-badge/VerificationBadge.tsx"],"sourcesContent":["import React from 'react';\nimport { StyledVerificationBadge } from './VerificationBadge.styles';\n\nconst VerificationBadge = () => (\n <StyledVerificationBadge className=\"vcid-check--blue\">\n <span />\n <span />\n <span />\n </StyledVerificationBadge>\n);\n\nVerificationBadge.displayName = 'VerificationBadge';\n\nexport default VerificationBadge;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAAqE,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErE,MAAMG,iBAAiB,GAAGA,CAAA,kBACtBP,MAAA,CAAAM,OAAA,CAAAE,aAAA,CAACL,kBAAA,CAAAM,uBAAuB;EAACC,SAAS,EAAC;AAAkB,gBACjDV,MAAA,CAAAM,OAAA,CAAAE,aAAA,aAAO,CAAC,eACRR,MAAA,CAAAM,OAAA,CAAAE,aAAA,aAAO,CAAC,eACRR,MAAA,CAAAM,OAAA,CAAAE,aAAA,aAAO,CACc,CAC5B;AAEDD,iBAAiB,CAACI,WAAW,GAAG,mBAAmB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAErCC,iBAAiB","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledVerificationBadge = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const StyledVerificationBadge = exports.StyledVerificationBadge = _styledComponents.default.span``;
10
+ //# sourceMappingURL=VerificationBadge.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerificationBadge.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledVerificationBadge","exports","styled","span"],"sources":["../../../../src/components/verification-badge/VerificationBadge.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledVerificationBadge = styled.span``;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAGE,yBAAM,CAACC,IAAI,EAAE","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useContainer = exports.ContainerAnchor = void 0;
7
+ var _react = require("react");
8
+ let ContainerAnchor = exports.ContainerAnchor = /*#__PURE__*/function (ContainerAnchor) {
9
+ ContainerAnchor["TAPP"] = ".tapp";
10
+ ContainerAnchor["BODY"] = "body";
11
+ ContainerAnchor["DIALOG"] = ".dialog-inner";
12
+ ContainerAnchor["PAGE"] = ".page-provider";
13
+ return ContainerAnchor;
14
+ }({});
15
+ const DEFAULT_CONTAINER_ANCHORS = [ContainerAnchor.DIALOG, ContainerAnchor.PAGE, ContainerAnchor.TAPP, ContainerAnchor.BODY];
16
+ const useContainer = ({
17
+ ref,
18
+ container,
19
+ anchors = DEFAULT_CONTAINER_ANCHORS
20
+ }) => {
21
+ const [newContainer, setNewContainer] = (0, _react.useState)(container ?? null);
22
+
23
+ // Get the closest container if none is set
24
+ (0, _react.useEffect)(() => {
25
+ if (ref.current && !container) {
26
+ const el = ref.current;
27
+ const element = el.closest(anchors === null || anchors === void 0 ? void 0 : anchors.join(', '));
28
+ setNewContainer(element);
29
+ }
30
+ }, [anchors, container, ref]);
31
+ (0, _react.useEffect)(() => {
32
+ if (container instanceof Element) {
33
+ setNewContainer(container);
34
+ }
35
+ }, [container]);
36
+ return newContainer;
37
+ };
38
+ exports.useContainer = useContainer;
39
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.js","names":["_react","require","ContainerAnchor","exports","DEFAULT_CONTAINER_ANCHORS","DIALOG","PAGE","TAPP","BODY","useContainer","ref","container","anchors","newContainer","setNewContainer","useState","useEffect","current","el","element","closest","join","Element"],"sources":["../../../src/hooks/container.ts"],"sourcesContent":["import { MutableRefObject, useEffect, useState } from 'react';\n\nexport enum ContainerAnchor {\n TAPP = '.tapp',\n BODY = 'body',\n DIALOG = '.dialog-inner',\n PAGE = '.page-provider',\n}\n\nconst DEFAULT_CONTAINER_ANCHORS = [\n ContainerAnchor.DIALOG,\n ContainerAnchor.PAGE,\n ContainerAnchor.TAPP,\n ContainerAnchor.BODY,\n];\n\ninterface UseContainerProps {\n ref: MutableRefObject<HTMLDivElement | HTMLLabelElement | HTMLSpanElement | null>;\n container?: Element | null;\n anchors?: ContainerAnchor[];\n}\n\nexport const useContainer = ({\n ref,\n container,\n anchors = DEFAULT_CONTAINER_ANCHORS,\n}: UseContainerProps) => {\n const [newContainer, setNewContainer] = useState<Element | null>(container ?? null);\n\n // Get the closest container if none is set\n useEffect(() => {\n if (ref.current && !container) {\n const el = ref.current as HTMLElement;\n\n const element = el.closest(anchors?.join(', '));\n\n setNewContainer(element);\n }\n }, [anchors, container, ref]);\n\n useEffect(() => {\n if (container instanceof Element) {\n setNewContainer(container);\n }\n }, [container]);\n\n return newContainer;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAA8D,IAElDC,eAAe,GAAAC,OAAA,CAAAD,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAO3B,MAAME,yBAAyB,GAAG,CAC9BF,eAAe,CAACG,MAAM,EACtBH,eAAe,CAACI,IAAI,EACpBJ,eAAe,CAACK,IAAI,EACpBL,eAAe,CAACM,IAAI,CACvB;AAQM,MAAMC,YAAY,GAAGA,CAAC;EACzBC,GAAG;EACHC,SAAS;EACTC,OAAO,GAAGR;AACK,CAAC,KAAK;EACrB,MAAM,CAACS,YAAY,EAAEC,eAAe,CAAC,GAAG,IAAAC,eAAQ,EAAiBJ,SAAS,IAAI,IAAI,CAAC;;EAEnF;EACA,IAAAK,gBAAS,EAAC,MAAM;IACZ,IAAIN,GAAG,CAACO,OAAO,IAAI,CAACN,SAAS,EAAE;MAC3B,MAAMO,EAAE,GAAGR,GAAG,CAACO,OAAsB;MAErC,MAAME,OAAO,GAAGD,EAAE,CAACE,OAAO,CAACR,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAES,IAAI,CAAC,IAAI,CAAC,CAAC;MAE/CP,eAAe,CAACK,OAAO,CAAC;IAC5B;EACJ,CAAC,EAAE,CAACP,OAAO,EAAED,SAAS,EAAED,GAAG,CAAC,CAAC;EAE7B,IAAAM,gBAAS,EAAC,MAAM;IACZ,IAAIL,SAAS,YAAYW,OAAO,EAAE;MAC9BR,eAAe,CAACH,SAAS,CAAC;IAC9B;EACJ,CAAC,EAAE,CAACA,SAAS,CAAC,CAAC;EAEf,OAAOE,YAAY;AACvB,CAAC;AAACV,OAAA,CAAAM,YAAA,GAAAA,YAAA","ignoreList":[]}
package/lib/cjs/index.js CHANGED
@@ -105,6 +105,12 @@ Object.defineProperty(exports, "ComboBoxDirection", {
105
105
  return _comboBox.ComboBoxDirection;
106
106
  }
107
107
  });
108
+ Object.defineProperty(exports, "ContainerAnchor", {
109
+ enumerable: true,
110
+ get: function () {
111
+ return _container.ContainerAnchor;
112
+ }
113
+ });
108
114
  Object.defineProperty(exports, "ContentCard", {
109
115
  enumerable: true,
110
116
  get: function () {
@@ -387,6 +393,12 @@ Object.defineProperty(exports, "Truncation", {
387
393
  return _Truncation.default;
388
394
  }
389
395
  });
396
+ Object.defineProperty(exports, "VerificationBadge", {
397
+ enumerable: true,
398
+ get: function () {
399
+ return _VerificationBadge.default;
400
+ }
401
+ });
390
402
  Object.defineProperty(exports, "filterFilesByMimeType", {
391
403
  enumerable: true,
392
404
  get: function () {
@@ -441,6 +453,12 @@ Object.defineProperty(exports, "useColorScheme", {
441
453
  return _ColorSchemeProvider.useColorScheme;
442
454
  }
443
455
  });
456
+ Object.defineProperty(exports, "useContainer", {
457
+ enumerable: true,
458
+ get: function () {
459
+ return _container.useContainer;
460
+ }
461
+ });
444
462
  Object.defineProperty(exports, "useElementSize", {
445
463
  enumerable: true,
446
464
  get: function () {
@@ -453,12 +471,14 @@ var _AccordionGroup = _interopRequireDefault(require("./components/accordion/acc
453
471
  var _AccordionIntro = _interopRequireDefault(require("./components/accordion/accordion-intro/AccordionIntro"));
454
472
  var _AccordionItem = _interopRequireDefault(require("./components/accordion/accordion-item/AccordionItem"));
455
473
  var _AmountControl = _interopRequireDefault(require("./components/amount-control/AmountControl"));
474
+ var _VerificationBadge = _interopRequireDefault(require("./components/verification-badge/VerificationBadge"));
456
475
  var _AreaContextProvider = _interopRequireWildcard(require("./components/area-provider/AreaContextProvider"));
457
476
  var _Badge = _interopRequireDefault(require("./components/badge/Badge"));
458
477
  var _Button = _interopRequireDefault(require("./components/button/Button"));
459
478
  var _Checkbox = _interopRequireDefault(require("./components/checkbox/Checkbox"));
460
479
  var _ColorSchemeProvider = _interopRequireWildcard(require("./components/color-scheme-provider/ColorSchemeProvider"));
461
480
  var _badge = require("./types/badge");
481
+ var _container = require("./hooks/container");
462
482
  var _FileList = _interopRequireDefault(require("./components/file-list/FileList"));
463
483
  var _FileSelect = _interopRequireDefault(require("./components/file-select/FileSelect"));
464
484
  var _ComboBox = _interopRequireDefault(require("./components/combobox/ComboBox"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_badge","_FileList","_FileSelect","_ComboBox","_ContentCard","_HighlightSlider","_ContextMenu","_ExpandableContent","_FileInput","_FilterButton","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_popup","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingBar","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_useElementSize","_comboBox","_contentCard","_contextMenu","_file","_filterButtons","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './types/badge';\nexport type {\n ColorSchemeContextProps,\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport {\n default as ComboBox,\n type ComboBoxTextStyles,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSLider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport {\n default as ContextMenu,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport type { BrowserName } from './types/chayns';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAA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C,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAApE,uBAAAmE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_VerificationBadge","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_badge","_container","_FileList","_FileSelect","_ComboBox","_ContentCard","_HighlightSlider","_ContextMenu","_ExpandableContent","_FileInput","_FilterButton","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_popup","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingBar","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_useElementSize","_comboBox","_contentCard","_contextMenu","_file","_filterButtons","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './types/badge';\nexport type {\n ColorSchemeContextProps,\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport {\n default as ComboBox,\n type ComboBoxTextStyles,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSLider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport {\n default as ContextMenu,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport type { BrowserName } from './types/chayns';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,C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,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAAtE,uBAAAqE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"tagInput.js","names":[],"sources":["../../../src/types/tagInput.ts"],"sourcesContent":["export interface Tag {\n id: string;\n text: string;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"tagInput.js","names":[],"sources":["../../../src/types/tagInput.ts"],"sourcesContent":["import { ReactNode } from 'react';\n\nexport interface Tag {\n id: string;\n text: string;\n rightElement?: ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
@@ -10,8 +10,11 @@ const TagInput = /*#__PURE__*/forwardRef((_ref, ref) => {
10
10
  placeholder,
11
11
  tags,
12
12
  onRemove,
13
+ onChange,
13
14
  onAdd,
14
- onChange
15
+ leftElement,
16
+ shouldAllowMultiple = true,
17
+ shouldPreventEnter
15
18
  } = _ref;
16
19
  const [internalTags, setInternalTags] = useState();
17
20
  const [currentValue, setCurrentValue] = useState('');
@@ -20,20 +23,25 @@ const TagInput = /*#__PURE__*/forwardRef((_ref, ref) => {
20
23
  const theme = useTheme();
21
24
  useEffect(() => {
22
25
  if (tags) {
23
- setInternalTags(tags);
26
+ setInternalTags(shouldAllowMultiple ? tags : tags.slice(0, 1));
24
27
  }
25
- }, [tags]);
28
+ }, [shouldAllowMultiple, tags]);
29
+ const handleResetValue = () => {
30
+ setCurrentValue('');
31
+ };
26
32
  const shouldChangeColor = useMemo(() => areaProvider.shouldChangeColor ?? false, [areaProvider.shouldChangeColor]);
27
33
  useImperativeHandle(ref, () => ({
28
- getUnsavedTagText: currentValue !== '' ? currentValue : undefined
34
+ getUnsavedTagText: currentValue !== '' ? currentValue : undefined,
35
+ resetValue: handleResetValue
29
36
  }), [currentValue]);
30
37
  const handleKeyDown = useCallback(event => {
31
- if (event.key === 'Enter') {
38
+ if (event.key === 'Enter' && !shouldPreventEnter) {
32
39
  setCurrentValue(prevValue => {
33
40
  if (!prevValue) {
34
41
  return '';
35
42
  }
36
43
  setInternalTags(prevTags => {
44
+ if (!shouldAllowMultiple && (prevTags?.length ?? 0) > 0) return prevTags;
37
45
  const newTag = {
38
46
  id: uuidv4(),
39
47
  text: prevValue
@@ -71,7 +79,7 @@ const TagInput = /*#__PURE__*/forwardRef((_ref, ref) => {
71
79
  return updatedTags;
72
80
  });
73
81
  }
74
- }, [currentValue, internalTags, onAdd, onRemove, selectedId]);
82
+ }, [currentValue, internalTags, onAdd, onRemove, selectedId, shouldAllowMultiple, shouldPreventEnter]);
75
83
  const handleChange = useCallback(event => {
76
84
  setCurrentValue(event.target.value);
77
85
  if (typeof onChange === 'function') {
@@ -98,26 +106,32 @@ const TagInput = /*#__PURE__*/forwardRef((_ref, ref) => {
98
106
  internalTags.forEach(_ref2 => {
99
107
  let {
100
108
  text,
101
- id
109
+ id,
110
+ rightElement
102
111
  } = _ref2;
103
112
  items.push(/*#__PURE__*/React.createElement(Badge, {
104
113
  key: `tag-input-${id}`,
105
114
  backgroundColor: id === selectedId ? theme['206'] ?? undefined : undefined
106
- }, /*#__PURE__*/React.createElement(StyledTagInputTagWrapper, null, /*#__PURE__*/React.createElement(StyledTagInputTagWrapperText, null, text), /*#__PURE__*/React.createElement(Icon, {
115
+ }, /*#__PURE__*/React.createElement(StyledTagInputTagWrapper, null, /*#__PURE__*/React.createElement(StyledTagInputTagWrapperText, null, text), rightElement, /*#__PURE__*/React.createElement(Icon, {
107
116
  icons: ['ts-wrong'],
108
- onClick: () => handleIconClick(id)
117
+ onClick: event => {
118
+ event.preventDefault();
119
+ event.stopPropagation();
120
+ handleIconClick(id);
121
+ }
109
122
  }))));
110
123
  });
111
124
  return items;
112
125
  }, [handleIconClick, internalTags, selectedId, theme]);
126
+ const shouldShowInput = useMemo(() => shouldAllowMultiple || (internalTags?.length ?? 0) < 1, [internalTags?.length, shouldAllowMultiple]);
113
127
  return useMemo(() => /*#__PURE__*/React.createElement(StyledTagInput, {
114
128
  $shouldChangeColor: shouldChangeColor
115
- }, content, /*#__PURE__*/React.createElement(StyledTagInputTagInput, {
129
+ }, leftElement && leftElement, content, shouldShowInput && /*#__PURE__*/React.createElement(StyledTagInputTagInput, {
116
130
  placeholder: tags && tags.length > 0 ? undefined : placeholder,
117
131
  onKeyDown: handleKeyDown,
118
132
  onChange: handleChange,
119
133
  value: currentValue
120
- })), [content, currentValue, handleChange, handleKeyDown, placeholder, shouldChangeColor, tags]);
134
+ })), [content, currentValue, handleChange, handleKeyDown, leftElement, placeholder, shouldChangeColor, shouldShowInput, tags]);
121
135
  });
122
136
  export default TagInput;
123
137
  //# sourceMappingURL=TagInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TagInput.js","names":["React","forwardRef","useCallback","useEffect","useMemo","useState","useImperativeHandle","useContext","useTheme","v4","uuidv4","Badge","Icon","StyledTagInput","StyledTagInputTagInput","StyledTagInputTagWrapper","StyledTagInputTagWrapperText","AreaContext","TagInput","_ref","ref","placeholder","tags","onRemove","onAdd","onChange","internalTags","setInternalTags","currentValue","setCurrentValue","selectedId","setSelectedId","areaProvider","theme","shouldChangeColor","getUnsavedTagText","undefined","handleKeyDown","event","key","prevValue","prevTags","newTag","id","text","newSelectedId","length","prevState","removedId","updatedTags","filter","tag","handleChange","target","value","handleIconClick","content","items","forEach","_ref2","push","createElement","backgroundColor","icons","onClick","$shouldChangeColor","onKeyDown"],"sources":["../../../../src/components/tag-input/TagInput.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ChangeEvent,\n type KeyboardEvent,\n type ReactElement,\n useImperativeHandle,\n useContext,\n ChangeEventHandler,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport type { Tag } from '../../types/tagInput';\nimport Badge from '../badge/Badge';\nimport Icon from '../icon/Icon';\nimport {\n StyledTagInput,\n StyledTagInputTagInput,\n StyledTagInputTagWrapper,\n StyledTagInputTagWrapperText,\n} from './TagInput.styles';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport type TagInputProps = {\n /**\n * Function to be executed when a tag is added.\n */\n onAdd?: (tag: Tag) => void;\n /**\n * Function to be executed when the value of the input is changed.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when a tag is removed.\n */\n onRemove?: (id: string) => void;\n /**\n * The placeholder that should be displayed.\n */\n placeholder?: string;\n /**\n * The tags that should be displayed.\n */\n tags?: Tag[];\n};\n\nexport type TagInputRef = {\n getUnsavedTagText: Tag['text'] | undefined;\n};\n\nconst TagInput = forwardRef<TagInputRef, TagInputProps>(\n ({ placeholder, tags, onRemove, onAdd, onChange }, ref) => {\n const [internalTags, setInternalTags] = useState<Tag[]>();\n const [currentValue, setCurrentValue] = useState('');\n const [selectedId, setSelectedId] = useState<Tag['id']>();\n\n const areaProvider = useContext(AreaContext);\n\n const theme = useTheme() as Theme;\n\n useEffect(() => {\n if (tags) {\n setInternalTags(tags);\n }\n }, [tags]);\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n getUnsavedTagText: currentValue !== '' ? currentValue : undefined,\n }),\n [currentValue],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Enter') {\n setCurrentValue((prevValue) => {\n if (!prevValue) {\n return '';\n }\n\n setInternalTags((prevTags) => {\n const newTag = { id: uuidv4(), text: prevValue };\n\n if (typeof onAdd === 'function') {\n onAdd(newTag);\n }\n\n return prevTags ? [...prevTags, newTag] : [newTag];\n });\n\n return '';\n });\n }\n\n if (event.key === 'Backspace' && currentValue === '') {\n if (!selectedId) {\n if (!internalTags) {\n return;\n }\n\n const newSelectedId = internalTags[internalTags.length - 1]?.id;\n\n setSelectedId(newSelectedId);\n\n return;\n }\n\n setInternalTags((prevState) => {\n if (!prevState) {\n return prevState;\n }\n\n const removedId = prevState[prevState.length - 1]?.id;\n\n if (!removedId) {\n return prevState;\n }\n\n const updatedTags = (prevState ?? []).filter((tag) => tag.id !== removedId);\n\n if (typeof onRemove === 'function') {\n onRemove(removedId);\n }\n\n setSelectedId(undefined);\n\n return updatedTags;\n });\n }\n },\n [currentValue, internalTags, onAdd, onRemove, selectedId],\n );\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setCurrentValue(event.target.value);\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n\n if (event.target.value !== '') {\n setSelectedId(undefined);\n }\n },\n [onChange],\n );\n\n const handleIconClick = useCallback(\n (id: string) => {\n setInternalTags((prevState) => {\n const updatedTags = (prevState ?? []).filter((tag) => tag.id !== id);\n\n if (typeof onRemove === 'function') {\n onRemove(id);\n }\n\n return updatedTags;\n });\n },\n [onRemove],\n );\n\n const content = useMemo(() => {\n const items: ReactElement[] = [];\n\n if (!internalTags) {\n return items;\n }\n\n internalTags.forEach(({ text, id }) => {\n items.push(\n <Badge\n key={`tag-input-${id}`}\n backgroundColor={\n id === selectedId ? ((theme['206'] as string) ?? undefined) : undefined\n }\n >\n <StyledTagInputTagWrapper>\n <StyledTagInputTagWrapperText>{text}</StyledTagInputTagWrapperText>\n <Icon icons={['ts-wrong']} onClick={() => handleIconClick(id)} />\n </StyledTagInputTagWrapper>\n </Badge>,\n );\n });\n\n return items;\n }, [handleIconClick, internalTags, selectedId, theme]);\n\n return useMemo(\n () => (\n <StyledTagInput $shouldChangeColor={shouldChangeColor}>\n {content}\n <StyledTagInputTagInput\n placeholder={tags && tags.length > 0 ? undefined : placeholder}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n value={currentValue}\n />\n </StyledTagInput>\n ),\n [\n content,\n currentValue,\n handleChange,\n handleKeyDown,\n placeholder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forwardRef","useCallback","useEffect","useMemo","useState","useImperativeHandle","useContext","useTheme","v4","uuidv4","Badge","Icon","StyledTagInput","StyledTagInputTagInput","StyledTagInputTagWrapper","StyledTagInputTagWrapperText","AreaContext","TagInput","_ref","ref","placeholder","tags","onRemove","onChange","onAdd","leftElement","shouldAllowMultiple","shouldPreventEnter","internalTags","setInternalTags","currentValue","setCurrentValue","selectedId","setSelectedId","areaProvider","theme","slice","handleResetValue","shouldChangeColor","getUnsavedTagText","undefined","resetValue","handleKeyDown","event","key","prevValue","prevTags","length","newTag","id","text","newSelectedId","prevState","removedId","updatedTags","filter","tag","handleChange","target","value","handleIconClick","content","items","forEach","_ref2","rightElement","push","createElement","backgroundColor","icons","onClick","preventDefault","stopPropagation","shouldShowInput","$shouldChangeColor","onKeyDown"],"sources":["../../../../src/components/tag-input/TagInput.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ChangeEvent,\n type KeyboardEvent,\n type ReactElement,\n useImperativeHandle,\n useContext,\n ChangeEventHandler,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport type { Tag } from '../../types/tagInput';\nimport Badge from '../badge/Badge';\nimport Icon from '../icon/Icon';\nimport {\n StyledTagInput,\n StyledTagInputTagInput,\n StyledTagInputTagWrapper,\n StyledTagInputTagWrapperText,\n} from './TagInput.styles';\nimport { AreaContext } from '../area-provider/AreaContextProvider';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport type TagInputProps = {\n /**\n * An element that should be displayed on the left side of the input.\n */\n leftElement?: ReactElement;\n /**\n * Function to be executed when a tag is added.\n */\n onAdd?: (tag: Tag) => void;\n /**\n * Function to be executed when the value of the input is changed.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when a tag is removed.\n */\n onRemove?: (id: string) => void;\n /**\n * The placeholder that should be displayed.\n */\n placeholder?: string;\n /**\n * The tags that should be displayed.\n */\n tags?: Tag[];\n /**\n * Whether multiple tags should be allowed.\n */\n shouldAllowMultiple?: boolean;\n /**\n * Whether the enter key should be prevented.\n */\n shouldPreventEnter?: boolean;\n};\n\nexport type TagInputRef = {\n getUnsavedTagText: Tag['text'] | undefined;\n resetValue: () => void;\n};\n\nconst TagInput = forwardRef<TagInputRef, TagInputProps>(\n (\n {\n placeholder,\n tags,\n onRemove,\n onChange,\n onAdd,\n leftElement,\n shouldAllowMultiple = true,\n shouldPreventEnter,\n },\n ref,\n ) => {\n const [internalTags, setInternalTags] = useState<Tag[]>();\n const [currentValue, setCurrentValue] = useState('');\n const [selectedId, setSelectedId] = useState<Tag['id']>();\n\n const areaProvider = useContext(AreaContext);\n\n const theme = useTheme() as Theme;\n\n useEffect(() => {\n if (tags) {\n setInternalTags(shouldAllowMultiple ? tags : tags.slice(0, 1));\n }\n }, [shouldAllowMultiple, tags]);\n\n const handleResetValue = () => {\n setCurrentValue('');\n };\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n getUnsavedTagText: currentValue !== '' ? currentValue : undefined,\n resetValue: handleResetValue,\n }),\n [currentValue],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Enter' && !shouldPreventEnter) {\n setCurrentValue((prevValue) => {\n if (!prevValue) {\n return '';\n }\n\n setInternalTags((prevTags) => {\n if (!shouldAllowMultiple && (prevTags?.length ?? 0) > 0)\n return prevTags;\n\n const newTag = { id: uuidv4(), text: prevValue };\n\n if (typeof onAdd === 'function') {\n onAdd(newTag);\n }\n\n return prevTags ? [...prevTags, newTag] : [newTag];\n });\n\n return '';\n });\n }\n\n if (event.key === 'Backspace' && currentValue === '') {\n if (!selectedId) {\n if (!internalTags) {\n return;\n }\n\n const newSelectedId = internalTags[internalTags.length - 1]?.id;\n\n setSelectedId(newSelectedId);\n\n return;\n }\n\n setInternalTags((prevState) => {\n if (!prevState) {\n return prevState;\n }\n\n const removedId = prevState[prevState.length - 1]?.id;\n\n if (!removedId) {\n return prevState;\n }\n\n const updatedTags = (prevState ?? []).filter((tag) => tag.id !== removedId);\n\n if (typeof onRemove === 'function') {\n onRemove(removedId);\n }\n\n setSelectedId(undefined);\n\n return updatedTags;\n });\n }\n },\n [\n currentValue,\n internalTags,\n onAdd,\n onRemove,\n selectedId,\n shouldAllowMultiple,\n shouldPreventEnter,\n ],\n );\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setCurrentValue(event.target.value);\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n\n if (event.target.value !== '') {\n setSelectedId(undefined);\n }\n },\n [onChange],\n );\n\n const handleIconClick = useCallback(\n (id: string) => {\n setInternalTags((prevState) => {\n const updatedTags = (prevState ?? []).filter((tag) => tag.id !== id);\n\n if (typeof onRemove === 'function') {\n onRemove(id);\n }\n\n return updatedTags;\n });\n },\n [onRemove],\n );\n\n const content = useMemo(() => {\n const items: ReactElement[] = [];\n\n if (!internalTags) {\n return items;\n }\n\n internalTags.forEach(({ text, id, rightElement }) => {\n items.push(\n <Badge\n key={`tag-input-${id}`}\n backgroundColor={\n id === selectedId ? ((theme['206'] as string) ?? undefined) : undefined\n }\n >\n <StyledTagInputTagWrapper>\n <StyledTagInputTagWrapperText>{text}</StyledTagInputTagWrapperText>\n {rightElement}\n <Icon\n icons={['ts-wrong']}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n\n handleIconClick(id);\n }}\n />\n </StyledTagInputTagWrapper>\n </Badge>,\n );\n });\n\n return items;\n }, [handleIconClick, internalTags, selectedId, theme]);\n\n const shouldShowInput = useMemo(\n () => shouldAllowMultiple || (internalTags?.length ?? 0) < 1,\n [internalTags?.length, shouldAllowMultiple],\n );\n\n return useMemo(\n () => (\n <StyledTagInput $shouldChangeColor={shouldChangeColor}>\n {leftElement && leftElement}\n {content}\n {shouldShowInput && (\n <StyledTagInputTagInput\n placeholder={tags && tags.length > 0 ? undefined : placeholder}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n value={currentValue}\n />\n )}\n </StyledTagInput>\n ),\n [\n content,\n currentValue,\n handleChange,\n handleKeyDown,\n leftElement,\n placeholder,\n shouldChangeColor,\n shouldShowInput,\n tags,\n ],\n );\n },\n);\n\nexport default TagInput;\n"],"mappings":"AAAA,OAAOA,KAAK,IACRC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,QAAQ,EAIRC,mBAAmB,EACnBC,UAAU,QAEP,OAAO;AACd,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,OAAOC,KAAK,MAAM,gBAAgB;AAClC,OAAOC,IAAI,MAAM,cAAc;AAC/B,SACIC,cAAc,EACdC,sBAAsB,EACtBC,wBAAwB,EACxBC,4BAA4B,QACzB,mBAAmB;AAC1B,SAASC,WAAW,QAAQ,sCAAsC;AA2ClE,MAAMC,QAAQ,gBAAGjB,UAAU,CACvB,CAAAkB,IAAA,EAWIC,GAAG,KACF;EAAA,IAXD;IACIC,WAAW;IACXC,IAAI;IACJC,QAAQ;IACRC,QAAQ;IACRC,KAAK;IACLC,WAAW;IACXC,mBAAmB,GAAG,IAAI;IAC1BC;EACJ,CAAC,GAAAT,IAAA;EAGD,MAAM,CAACU,YAAY,EAAEC,eAAe,CAAC,GAAGzB,QAAQ,CAAQ,CAAC;EACzD,MAAM,CAAC0B,YAAY,EAAEC,eAAe,CAAC,GAAG3B,QAAQ,CAAC,EAAE,CAAC;EACpD,MAAM,CAAC4B,UAAU,EAAEC,aAAa,CAAC,GAAG7B,QAAQ,CAAY,CAAC;EAEzD,MAAM8B,YAAY,GAAG5B,UAAU,CAACU,WAAW,CAAC;EAE5C,MAAMmB,KAAK,GAAG5B,QAAQ,CAAC,CAAU;EAEjCL,SAAS,CAAC,MAAM;IACZ,IAAImB,IAAI,EAAE;MACNQ,e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vB;MAAE,CACL,CACqB,CACvB,CACX,CAAC;IACL,CAAC,CAAC;IAEF,OAAOa,KAAK;EAChB,CAAC,EAAE,CAACF,eAAe,EAAEhC,YAAY,EAAEI,UAAU,EAAEG,KAAK,CAAC,CAAC;EAEtD,MAAMsC,eAAe,GAAGtE,OAAO,CAC3B,MAAMuB,mBAAmB,IAAI,CAACE,YAAY,EAAEmB,MAAM,IAAI,CAAC,IAAI,CAAC,EAC5D,CAACnB,YAAY,EAAEmB,MAAM,EAAErB,mBAAmB,CAC9C,CAAC;EAED,OAAOvB,OAAO,CACV,mBACIJ,KAAA,CAAAoE,aAAA,CAACvD,cAAc;IAAC8D,kBAAkB,EAAEpC;EAAkB,GACjDb,WAAW,IAAIA,WAAW,EAC1BoC,OAAO,EACPY,eAAe,iBACZ1E,KAAA,CAAAoE,aAAA,CAACtD,sBAAsB;IACnBO,WAAW,EAAEC,IAAI,IAAIA,IAAI,CAAC0B,MAAM,GAAG,CAAC,GAAGP,SAAS,GAAGpB,WAAY;IAC/DuD,SAAS,EAAEjC,aAAc;IACzBnB,QAAQ,EAAEkC,YAAa;IACvBE,KAAK,EAAE7B;EAAa,CACvB,CAEO,CACnB,EACD,CACI+B,OAAO,EACP/B,YAAY,EACZ2B,YAAY,EACZf,aAAa,EACbjB,WAAW,EACXL,WAAW,EACXkB,iBAAiB,EACjBmC,eAAe,EACfpD,IAAI,CAEZ,CAAC;AACL,CACJ,CAAC;AAED,eAAeJ,QAAQ","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { StyledVerificationBadge } from './VerificationBadge.styles';
3
+ const VerificationBadge = () => /*#__PURE__*/React.createElement(StyledVerificationBadge, {
4
+ className: "vcid-check--blue"
5
+ }, /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null));
6
+ VerificationBadge.displayName = 'VerificationBadge';
7
+ export default VerificationBadge;
8
+ //# sourceMappingURL=VerificationBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerificationBadge.js","names":["React","StyledVerificationBadge","VerificationBadge","createElement","className","displayName"],"sources":["../../../../src/components/verification-badge/VerificationBadge.tsx"],"sourcesContent":["import React from 'react';\nimport { StyledVerificationBadge } from './VerificationBadge.styles';\n\nconst VerificationBadge = () => (\n <StyledVerificationBadge className=\"vcid-check--blue\">\n <span />\n <span />\n <span />\n </StyledVerificationBadge>\n);\n\nVerificationBadge.displayName = 'VerificationBadge';\n\nexport default VerificationBadge;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,uBAAuB,QAAQ,4BAA4B;AAEpE,MAAMC,iBAAiB,GAAGA,CAAA,kBACtBF,KAAA,CAAAG,aAAA,CAACF,uBAAuB;EAACG,SAAS,EAAC;AAAkB,gBACjDJ,KAAA,CAAAG,aAAA,aAAO,CAAC,eACRH,KAAA,CAAAG,aAAA,aAAO,CAAC,eACRH,KAAA,CAAAG,aAAA,aAAO,CACc,CAC5B;AAEDD,iBAAiB,CAACG,WAAW,GAAG,mBAAmB;AAEnD,eAAeH,iBAAiB","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import styled from 'styled-components';
2
+ export const StyledVerificationBadge = styled.span``;
3
+ //# sourceMappingURL=VerificationBadge.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerificationBadge.styles.js","names":["styled","StyledVerificationBadge","span"],"sources":["../../../../src/components/verification-badge/VerificationBadge.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledVerificationBadge = styled.span``;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,MAAMC,uBAAuB,GAAGD,MAAM,CAACE,IAAI,EAAE","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ import { useEffect, useState } from 'react';
2
+ export let ContainerAnchor = /*#__PURE__*/function (ContainerAnchor) {
3
+ ContainerAnchor["TAPP"] = ".tapp";
4
+ ContainerAnchor["BODY"] = "body";
5
+ ContainerAnchor["DIALOG"] = ".dialog-inner";
6
+ ContainerAnchor["PAGE"] = ".page-provider";
7
+ return ContainerAnchor;
8
+ }({});
9
+ const DEFAULT_CONTAINER_ANCHORS = [ContainerAnchor.DIALOG, ContainerAnchor.PAGE, ContainerAnchor.TAPP, ContainerAnchor.BODY];
10
+ export const useContainer = _ref => {
11
+ let {
12
+ ref,
13
+ container,
14
+ anchors = DEFAULT_CONTAINER_ANCHORS
15
+ } = _ref;
16
+ const [newContainer, setNewContainer] = useState(container ?? null);
17
+
18
+ // Get the closest container if none is set
19
+ useEffect(() => {
20
+ if (ref.current && !container) {
21
+ const el = ref.current;
22
+ const element = el.closest(anchors?.join(', '));
23
+ setNewContainer(element);
24
+ }
25
+ }, [anchors, container, ref]);
26
+ useEffect(() => {
27
+ if (container instanceof Element) {
28
+ setNewContainer(container);
29
+ }
30
+ }, [container]);
31
+ return newContainer;
32
+ };
33
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.js","names":["useEffect","useState","ContainerAnchor","DEFAULT_CONTAINER_ANCHORS","DIALOG","PAGE","TAPP","BODY","useContainer","_ref","ref","container","anchors","newContainer","setNewContainer","current","el","element","closest","join","Element"],"sources":["../../../src/hooks/container.ts"],"sourcesContent":["import { MutableRefObject, useEffect, useState } from 'react';\n\nexport enum ContainerAnchor {\n TAPP = '.tapp',\n BODY = 'body',\n DIALOG = '.dialog-inner',\n PAGE = '.page-provider',\n}\n\nconst DEFAULT_CONTAINER_ANCHORS = [\n ContainerAnchor.DIALOG,\n ContainerAnchor.PAGE,\n ContainerAnchor.TAPP,\n ContainerAnchor.BODY,\n];\n\ninterface UseContainerProps {\n ref: MutableRefObject<HTMLDivElement | HTMLLabelElement | HTMLSpanElement | null>;\n container?: Element | null;\n anchors?: ContainerAnchor[];\n}\n\nexport const useContainer = ({\n ref,\n container,\n anchors = DEFAULT_CONTAINER_ANCHORS,\n}: UseContainerProps) => {\n const [newContainer, setNewContainer] = useState<Element | null>(container ?? null);\n\n // Get the closest container if none is set\n useEffect(() => {\n if (ref.current && !container) {\n const el = ref.current as HTMLElement;\n\n const element = el.closest(anchors?.join(', '));\n\n setNewContainer(element);\n }\n }, [anchors, container, ref]);\n\n useEffect(() => {\n if (container instanceof Element) {\n setNewContainer(container);\n }\n }, [container]);\n\n return newContainer;\n};\n"],"mappings":"AAAA,SAA2BA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE7D,WAAYC,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAO3B,MAAMC,yBAAyB,GAAG,CAC9BD,eAAe,CAACE,MAAM,EACtBF,eAAe,CAACG,IAAI,EACpBH,eAAe,CAACI,IAAI,EACpBJ,eAAe,CAACK,IAAI,CACvB;AAQD,OAAO,MAAMC,YAAY,GAAGC,IAAA,IAIH;EAAA,IAJI;IACzBC,GAAG;IACHC,SAAS;IACTC,OAAO,GAAGT;EACK,CAAC,GAAAM,IAAA;EAChB,MAAM,CAACI,YAAY,EAAEC,eAAe,CAAC,GAAGb,QAAQ,CAAiBU,SAAS,IAAI,IAAI,CAAC;;EAEnF;EACAX,SAAS,CAAC,MAAM;IACZ,IAAIU,GAAG,CAACK,OAAO,IAAI,CAACJ,SAAS,EAAE;MAC3B,MAAMK,EAAE,GAAGN,GAAG,CAACK,OAAsB;MAErC,MAAME,OAAO,GAAGD,EAAE,CAACE,OAAO,CAACN,OAAO,EAAEO,IAAI,CAAC,IAAI,CAAC,CAAC;MAE/CL,eAAe,CAACG,OAAO,CAAC;IAC5B;EACJ,CAAC,EAAE,CAACL,OAAO,EAAED,SAAS,EAAED,GAAG,CAAC,CAAC;EAE7BV,SAAS,CAAC,MAAM;IACZ,IAAIW,SAAS,YAAYS,OAAO,EAAE;MAC9BN,eAAe,CAACH,SAAS,CAAC;IAC9B;EACJ,CAAC,EAAE,CAACA,SAAS,CAAC,CAAC;EAEf,OAAOE,YAAY;AACvB,CAAC","ignoreList":[]}
package/lib/esm/index.js CHANGED
@@ -6,12 +6,14 @@ export { default as AccordionGroup } from './components/accordion/accordion-grou
6
6
  export { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';
7
7
  export { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';
8
8
  export { default as AmountControl } from './components/amount-control/AmountControl';
9
+ export { default as VerificationBadge } from './components/verification-badge/VerificationBadge';
9
10
  export { AreaContext, default as AreaProvider } from './components/area-provider/AreaContextProvider';
10
11
  export { default as Badge } from './components/badge/Badge';
11
12
  export { default as Button } from './components/button/Button';
12
13
  export { default as Checkbox } from './components/checkbox/Checkbox';
13
14
  export { default as ColorSchemeProvider, useColorScheme } from './components/color-scheme-provider/ColorSchemeProvider';
14
15
  export { BadgeSize, BadgeDesign } from './types/badge';
16
+ export { useContainer, ContainerAnchor } from './hooks/container';
15
17
  export { default as FileList } from './components/file-list/FileList';
16
18
  export { default as FileSelect } from './components/file-select/FileSelect';
17
19
  export { default as ComboBox } from './components/combobox/ComboBox';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","useColorScheme","BadgeSize","BadgeDesign","FileList","FileSelect","ComboBox","ContentCard","HighlightSLider","ContextMenu","ExpandableContent","FileInput","FilterButton","FilterButtons","GridImage","Icon","Input","InputSize","List","ListItemContent","ListItem","MentionFinder","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","PopupAlignment","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingBar","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ComboBoxDirection","ContentCardType","ContextMenuAlignment","isValidFileType","FilterButtonItemShape","FilterButtonSize","ClampPosition","getIsTouch","filterFilesByMimeType","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './types/badge';\nexport type {\n ColorSchemeContextProps,\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport {\n default as ComboBox,\n type ComboBoxTextStyles,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSLider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport {\n default as ContextMenu,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport type { BrowserName } from './types/chayns';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":"AAAA;;AAEA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,OAAO,IAAIG,cAAc,QAAQ,uDAAuD;AACjG,SAASH,OAAO,IAAII,cAAc,QAAQ,uDAAuD;AACjG,SAASJ,OAAO,IAAIK,aAAa,QAAQ,qDAAqD;AAC9F,SAASL,OAAO,IAAIM,aAAa,QAAQ,2CAA2C;AACpF,SACIC,WAAW,EACXP,OAAO,IAAIQ,YAAY,QACpB,gDAAgD;AACvD,SAASR,OAAO,IAAIS,KAAK,QAAQ,0BAA0B;AAC3D,SAAST,OAA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,gBAAgB,QAAQ,uBAAuB;AAW/E,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,qBAAqB,EAAEC,oBAAoB,EAAEC,WAAW,QAAQ,oBAAoB;AAC7F,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,UAAU,QAAQ,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","VerificationBadge","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","useColorScheme","BadgeSize","BadgeDesign","useContainer","ContainerAnchor","FileList","FileSelect","ComboBox","ContentCard","HighlightSLider","ContextMenu","ExpandableContent","FileInput","FilterButton","FilterButtons","GridImage","Icon","Input","InputSize","List","ListItemContent","ListItem","MentionFinder","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","PopupAlignment","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingBar","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ComboBoxDirection","ContentCardType","ContextMenuAlignment","isValidFileType","FilterButtonItemShape","FilterButtonSize","ClampPosition","getIsTouch","filterFilesByMimeType","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './types/badge';\nexport type {\n ColorSchemeContextProps,\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport {\n default as ComboBox,\n type ComboBoxTextStyles,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as HighlightSLider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport {\n default as ContextMenu,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport type { BrowserName } from './types/chayns';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\n"],"mappings":"AAAA;;AAEA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,OAAO,IAAIG,cAAc,QAAQ,uDAAuD;AACjG,SAASH,OAAO,IAAII,cAAc,QAAQ,uDAAuD;AACjG,SAASJ,OAAO,IAAIK,aAAa,QAAQ,qDAAqD;AAC9F,SAASL,OAAO,IAAIM,aAAa,QAAQ,2CAA2C;AACpF,SAASN,OAAO,IAAIO,iBAAiB,QAAQ,mDAAmD;AAChG,SACIC,WAAW,EACXR,OAAO,IAAIS,YAAY,QACpB,gDAAgD;AACvD,SAAST,OAAO,IAAIU,KAAK,QAAQ,0BAA0B;AAC3D,SAASV,OAAO,IAAIW,MAAM,QAAQ,4BAA4B;AAC9D,SAASX,OAAO,IAAIY,QAAQ,QAAQ,gCAAgC;AACpE,SACIZ,OAAO,IAAIa,mBAAmB,EAC9BC,cAAc,QACX,wDAAwD;AAC/D,SAASC,SAAS,EAAEC,WAAW,QAAQ,eAAe;AAMtD,SAASC,YAAY,EAAEC,eAAe,QAAQ,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e,QAAQ,yBAAyB;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,UAAU,QAAQ,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"tagInput.js","names":[],"sources":["../../../src/types/tagInput.ts"],"sourcesContent":["export interface Tag {\n id: string;\n text: string;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"tagInput.js","names":[],"sources":["../../../src/types/tagInput.ts"],"sourcesContent":["import { ReactNode } from 'react';\n\nexport interface Tag {\n id: string;\n text: string;\n rightElement?: ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,6 +1,10 @@
1
- import React, { ChangeEventHandler } from 'react';
1
+ import React, { type ReactElement, ChangeEventHandler } from 'react';
2
2
  import type { Tag } from '../../types/tagInput';
3
3
  export type TagInputProps = {
4
+ /**
5
+ * An element that should be displayed on the left side of the input.
6
+ */
7
+ leftElement?: ReactElement;
4
8
  /**
5
9
  * Function to be executed when a tag is added.
6
10
  */
@@ -21,9 +25,18 @@ export type TagInputProps = {
21
25
  * The tags that should be displayed.
22
26
  */
23
27
  tags?: Tag[];
28
+ /**
29
+ * Whether multiple tags should be allowed.
30
+ */
31
+ shouldAllowMultiple?: boolean;
32
+ /**
33
+ * Whether the enter key should be prevented.
34
+ */
35
+ shouldPreventEnter?: boolean;
24
36
  };
25
37
  export type TagInputRef = {
26
38
  getUnsavedTagText: Tag['text'] | undefined;
39
+ resetValue: () => void;
27
40
  };
28
41
  declare const TagInput: React.ForwardRefExoticComponent<TagInputProps & React.RefAttributes<TagInputRef>>;
29
42
  export default TagInput;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const VerificationBadge: {
3
+ (): React.JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default VerificationBadge;
@@ -0,0 +1 @@
1
+ export declare const StyledVerificationBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
@@ -0,0 +1,14 @@
1
+ import { MutableRefObject } from 'react';
2
+ export declare enum ContainerAnchor {
3
+ TAPP = ".tapp",
4
+ BODY = "body",
5
+ DIALOG = ".dialog-inner",
6
+ PAGE = ".page-provider"
7
+ }
8
+ interface UseContainerProps {
9
+ ref: MutableRefObject<HTMLDivElement | HTMLLabelElement | HTMLSpanElement | null>;
10
+ container?: Element | null;
11
+ anchors?: ContainerAnchor[];
12
+ }
13
+ export declare const useContainer: ({ ref, container, anchors, }: UseContainerProps) => Element | null;
14
+ export {};
@@ -4,6 +4,7 @@ export { default as AccordionGroup } from './components/accordion/accordion-grou
4
4
  export { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';
5
5
  export { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';
6
6
  export { default as AmountControl } from './components/amount-control/AmountControl';
7
+ export { default as VerificationBadge } from './components/verification-badge/VerificationBadge';
7
8
  export { AreaContext, default as AreaProvider, } from './components/area-provider/AreaContextProvider';
8
9
  export { default as Badge } from './components/badge/Badge';
9
10
  export { default as Button } from './components/button/Button';
@@ -11,6 +12,7 @@ export { default as Checkbox } from './components/checkbox/Checkbox';
11
12
  export { default as ColorSchemeProvider, useColorScheme, } from './components/color-scheme-provider/ColorSchemeProvider';
12
13
  export { BadgeSize, BadgeDesign } from './types/badge';
13
14
  export type { ColorSchemeContextProps, FramerMotionBugFix, WithTheme, } from './components/color-scheme-provider/ColorSchemeProvider';
15
+ export { useContainer, ContainerAnchor } from './hooks/container';
14
16
  export { default as FileList, type IFileItem as FileListItem, } from './components/file-list/FileList';
15
17
  export { default as FileSelect } from './components/file-select/FileSelect';
16
18
  export { default as ComboBox, type ComboBoxTextStyles, type IComboBoxItem as ComboBoxItem, type IComboBoxItems as ComboBoxItems, } from './components/combobox/ComboBox';
@@ -78,3 +80,4 @@ export { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './util
78
80
  export { isTobitEmployee } from './utils/isTobitEmployee';
79
81
  export { getUsableHeight } from './utils/pageProvider';
80
82
  export { uploadFile } from './utils/uploadFile';
83
+ export type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';
@@ -1,4 +1,6 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface Tag {
2
3
  id: string;
3
4
  text: string;
5
+ rightElement?: ReactNode;
4
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.0-beta.1118",
3
+ "version": "5.0.0-beta.1122",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "48311ec34b2f3cb85fa7aad8bc7a17a848b826bd"
89
+ "gitHead": "a6b475119ed3cf672d0c7ec50c6b6df4249765d2"
90
90
  }