@bikdotai/bik-component-library 0.0.836 → 0.0.837-0

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 (51) hide show
  1. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  2. package/dist/cjs/components/checkBox/CheckBox.js +1 -1
  3. package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
  4. package/dist/cjs/components/dropdown/ChipInput.js +1 -1
  5. package/dist/cjs/components/dropdown/ChipInput.js.map +1 -1
  6. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  7. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  8. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  9. package/dist/cjs/components/input/Input.js +1 -1
  10. package/dist/cjs/components/input/Input.js.map +1 -1
  11. package/dist/cjs/components/input/Input.styled.js +25 -12
  12. package/dist/cjs/components/input/Input.styled.js.map +1 -1
  13. package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
  14. package/dist/cjs/components/product-picker-v2/collectionScreen.js.map +1 -1
  15. package/dist/cjs/components/product-picker-v2/product.js +1 -1
  16. package/dist/cjs/components/product-picker-v2/product.js.map +1 -1
  17. package/dist/cjs/components/tabs/Tabs.js +1 -1
  18. package/dist/cjs/components/tabs/Tabs.js.map +1 -1
  19. package/dist/cjs/components/tabs/Tabs.styles.js +22 -8
  20. package/dist/cjs/components/tabs/Tabs.styles.js.map +1 -1
  21. package/dist/cjs/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
  22. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  23. package/dist/esm/components/checkBox/CheckBox.d.ts +2 -0
  24. package/dist/esm/components/checkBox/CheckBox.js +61 -51
  25. package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
  26. package/dist/esm/components/dropdown/ChipInput.d.ts +1 -0
  27. package/dist/esm/components/dropdown/ChipInput.js +37 -30
  28. package/dist/esm/components/dropdown/ChipInput.js.map +1 -1
  29. package/dist/esm/components/dropdown/Dropdown.d.ts +2 -0
  30. package/dist/esm/components/dropdown/Dropdown.js +95 -88
  31. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  32. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  33. package/dist/esm/components/input/Input.js +104 -101
  34. package/dist/esm/components/input/Input.js.map +1 -1
  35. package/dist/esm/components/input/Input.model.d.ts +2 -0
  36. package/dist/esm/components/input/Input.styled.d.ts +2 -0
  37. package/dist/esm/components/input/Input.styled.js +38 -25
  38. package/dist/esm/components/input/Input.styled.js.map +1 -1
  39. package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -0
  40. package/dist/esm/components/product-picker-v2/collectionScreen.js.map +1 -1
  41. package/dist/esm/components/product-picker-v2/product.js +47 -46
  42. package/dist/esm/components/product-picker-v2/product.js.map +1 -1
  43. package/dist/esm/components/tabs/Tabs.js +93 -73
  44. package/dist/esm/components/tabs/Tabs.js.map +1 -1
  45. package/dist/esm/components/tabs/Tabs.model.d.ts +7 -0
  46. package/dist/esm/components/tabs/Tabs.styles.d.ts +2 -0
  47. package/dist/esm/components/tabs/Tabs.styles.js +23 -9
  48. package/dist/esm/components/tabs/Tabs.styles.js.map +1 -1
  49. package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
  50. package/dist/esm/icons/index.d.ts +25 -25
  51. package/package.json +4 -2
@@ -1,11 +1,11 @@
1
- import i, { css as o } from "styled-components";
2
- import { BodyCaption as r, BodySecondary as h, BodyPrimary as n } from "../TypographyStyle.js";
1
+ import i, { css as n } from "styled-components";
2
+ import { BodyCaption as r, BodySecondary as d, BodyPrimary as a } from "../TypographyStyle.js";
3
3
  import { COLORS as e } from "../../constants/Theme.js";
4
- const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e.stroke.brand : s ? e.stroke.negative.vibrant : e.stroke.primary, x = (t) => t.hideBorder ? 0 : t.version === "2.0" ? 0.5 : 1, p = i.div`
4
+ const s = ({ isActive: t, isInvalid: h, hightlightInputColor: o }) => t ? o || e.stroke.brand : h ? e.stroke.negative.vibrant : e.stroke.primary, x = (t) => t.hideBorder ? 0 : t.version === "2.0" ? 0.5 : 1, p = i.div`
5
5
  border-radius: ${(t) => t.version === "2.0" ? 8 : 4}px;
6
6
  background: ${(t) => ["disabled", "read-only", "disabled-invalid"].includes(t.state) ? e.background.base : "#fff"};
7
7
  border: ${(t) => x(t)}px solid
8
- ${(t) => d({
8
+ ${(t) => s({
9
9
  isActive: t.isActive,
10
10
  isInvalid: t.isInvalid,
11
11
  hightlightInputColor: t.hightlightInputColor
@@ -20,9 +20,22 @@ const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e
20
20
  gap: 8px;
21
21
  overflow: hidden;
22
22
 
23
- ${(t) => t.state === "read-only" ? "opacity: 0.7" : ""};
23
+ ${(t) => t.state === "read-only" && !t.solidDisabled ? "opacity: 0.7" : ""};
24
24
  ${(t) => t.state === "read-only" ? "pointer-events: none" : ""};
25
- `, v = i.div`
25
+ ${(t) => t.solidDisabled && ["disabled", "read-only", "disabled-invalid"].includes(t.state) ? n`
26
+ input,
27
+ textarea {
28
+ color: ${e.content.secondary};
29
+ -webkit-text-fill-color: ${e.content.secondary};
30
+ opacity: 1;
31
+ &::placeholder {
32
+ color: ${e.content.secondary};
33
+ -webkit-text-fill-color: ${e.content.secondary};
34
+ opacity: 1;
35
+ }
36
+ }
37
+ ` : ""};
38
+ `, u = i.div`
26
39
  min-height: ${(t) => t.iconSize};
27
40
  min-width: ${(t) => t.iconSize};
28
41
  display: flex;
@@ -30,7 +43,7 @@ const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e
30
43
  justify-content: center;
31
44
  overflow: hidden;
32
45
  ${(t) => t.isLeft ? `margin-left:${t.variant && ["small", "x-small"].includes(t.variant) ? "0px" : "8px"}` : `margin-right: ${t.variant && ["small", "x-small"].includes(t.variant) ? "0px" : "8px"}`};
33
- `, a = o`
46
+ `, l = n`
34
47
  flex-grow: 1;
35
48
  overflow: hidden;
36
49
  height: 100%;
@@ -67,8 +80,8 @@ const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e
67
80
  min-height: 100px;
68
81
  resize: none;
69
82
  }
70
- `, u = i(n)`
71
- ${a};
83
+ `, v = i(a)`
84
+ ${l};
72
85
  ${(t) => t.height && t.type !== "multiline" ? { height: t.height } : {}};
73
86
 
74
87
  ${(t) => t.autoGrow && t.minHeight && `
@@ -78,8 +91,8 @@ const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e
78
91
  max-height: ${t.maxHeight || "100px"};
79
92
  }
80
93
  `}
81
- `, f = i(h)`
82
- ${a};
94
+ `, $ = i(d)`
95
+ ${l};
83
96
  input {
84
97
  min-height: 20px;
85
98
  &::-webkit-outer-spin-button,
@@ -89,8 +102,8 @@ const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e
89
102
  }
90
103
  }
91
104
  ${(t) => t.height && t.type !== "multiline" ? { height: t.height } : {}};
92
- `, $ = i(r)`
93
- ${a};
105
+ `, f = i(r)`
106
+ ${l};
94
107
  input {
95
108
  min-height: 16px;
96
109
  &::-webkit-outer-spin-button,
@@ -118,10 +131,10 @@ const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e
118
131
  color: ${e.content.negative};
119
132
  padding-left: 4px;
120
133
  }
121
- `, w = i(h)`
134
+ `, y = i(d)`
122
135
  color: ${e.content.secondary} !important;
123
136
  margin-top: ${(t) => t.position === "BOTTOM" ? "8px" : "0px"};
124
- `, y = i(r)`
137
+ `, w = i(r)`
125
138
  white-space: pre-wrap;
126
139
  margin-top: 8px;
127
140
  color: ${(t) => t.invalid ? e.content.negative : e.content.secondary} !important;
@@ -138,8 +151,8 @@ const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e
138
151
  `, k = i.div`
139
152
  ${(t) => t.width ? `width: ${t.width}` : ""};
140
153
  ${(t) => t.height && t.type == "multiline" ? `height: ${t.height}` : ""};
141
- ${(t) => t.state === "disabled" || t.state === "disabled-invalid" ? o`
142
- opacity: 0.5;
154
+ ${(t) => t.state === "disabled" || t.state === "disabled-invalid" ? n`
155
+ opacity: ${t.solidDisabled ? 1 : 0.5};
143
156
  pointer-events: none;
144
157
  ` : ""};
145
158
  display: flex;
@@ -156,26 +169,26 @@ const d = ({ isActive: t, isInvalid: s, hightlightInputColor: l }) => t ? l || e
156
169
  align-items: center;
157
170
  justify-content: space-between;
158
171
  }
159
- `, I = i(n)`
172
+ `, I = i(a)`
160
173
  overflow: unset;
161
174
  margin-left: ${(t) => t.variant && ["small", "x-small"].includes(t.variant) ? "" : "16px"};
162
175
  font-size: ${(t) => t.variant === "x-small" ? "12px" : t.variant === "small" ? "14px" : "16px"};
163
176
  line-height: ${(t) => t.variant === "x-small" ? "16px" : t.variant === "small" ? "20px" : "24px"};
164
- `, C = i(n)`
177
+ `, C = i(a)`
165
178
  overflow: unset;
166
179
  margin-right: ${(t) => t.variant && ["small", "x-small"].includes(t.variant) ? "" : "16px"};
167
180
  font-size: ${(t) => t.variant === "x-small" ? "12px" : t.variant === "small" ? "14px" : "16px"};
168
181
  line-height: ${(t) => t.variant === "x-small" ? "16px" : t.variant === "small" ? "20px" : "24px"};
169
182
  `;
170
183
  export {
171
- v as IconHolder,
172
- u as InputContainer,
173
- f as InputContainerSmall,
174
- $ as InputContainerXSmall,
175
- y as InputFooter,
184
+ u as IconHolder,
185
+ v as InputContainer,
186
+ $ as InputContainerSmall,
187
+ f as InputContainerXSmall,
188
+ w as InputFooter,
176
189
  b as InputHeader,
177
190
  p as InputWrapper,
178
- w as MaxCharStyle,
191
+ y as MaxCharStyle,
179
192
  I as PrefixHolder,
180
193
  k as RootContainer,
181
194
  C as SuffixHolder
@@ -1 +1 @@
1
- {"version":3,"file":"Input.styled.js","sources":["../../../../src/components/input/Input.styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tBodySecondary,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { InputStateI, InputTypeI, InputVariant } from './Input.model';\n\nconst getBorderColor = ({ isActive, isInvalid, hightlightInputColor }) => {\n\tif (isActive) {\n\t\treturn hightlightInputColor ? hightlightInputColor : COLORS.stroke.brand;\n\t} else if (isInvalid) {\n\t\treturn COLORS.stroke.negative.vibrant;\n\t}\n\treturn COLORS.stroke.primary;\n};\n\nconst getBorderWidth = (props: {\n\tversion?: '1.0' | '2.0' | '3.0';\n\thideBorder?: boolean;\n}) => {\n\treturn props.hideBorder ? 0 : props.version === '2.0' ? 0.5 : 1;\n};\n\nexport const InputWrapper = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tisActive?: boolean;\n\tisInvalid?: boolean;\n\tstate?: InputStateI;\n\tvariant?: InputVariant;\n\tversion?: '1.0' | '2.0' | '3.0';\n\thightlightInputColor?: string;\n\thideBorder?: boolean;\n}>`\n\tborder-radius: ${(props) => (props.version === '2.0' ? 8 : 4)}px;\n\tbackground: ${(props) =>\n\t\t['disabled', 'read-only', 'disabled-invalid'].includes(props.state!)\n\t\t\t? COLORS.background.base\n\t\t\t: '#fff'};\n\tborder: ${(props) => getBorderWidth(props)}px solid\n\t\t${(props) =>\n\t\t\tgetBorderColor({\n\t\t\t\tisActive: props.isActive,\n\t\t\t\tisInvalid: props.isInvalid,\n\t\t\t\thightlightInputColor: props.hightlightInputColor,\n\t\t\t})};\n\t${(props) =>\n\t\tprops.isActive\n\t\t\t? `box-shadow: inset 0px 0px 0px 1px ${\n\t\t\t\t\tprops.hightlightInputColor\n\t\t\t\t\t\t? props.hightlightInputColor\n\t\t\t\t\t\t: COLORS.stroke.brand\n\t\t\t };`\n\t\t\t: ''};\n\tpadding: ${(props) => (props.variant === 'small' ? '6px' : '8px')};\n\theight: ${(props) => props.height || '100%'};\n\t${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? 'max-height: 44px'\n\t\t\t: 'min-height: 48px'};\n\tdisplay: flex;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tgap: 8px;\n\toverflow: hidden;\n\n\t${(props) => (props.state === 'read-only' ? 'opacity: 0.7' : '')};\n\t${(props) => (props.state === 'read-only' ? 'pointer-events: none' : '')};\n`;\n\nexport const IconHolder = styled.div<{\n\tisLeft?: boolean;\n\ticonSize?: string;\n\tvariant?: InputVariant;\n}>`\n\tmin-height: ${(props) => props.iconSize};\n\tmin-width: ${(props) => props.iconSize};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\toverflow: hidden;\n\t${(props) =>\n\t\tprops.isLeft\n\t\t\t? `margin-left:${\n\t\t\t\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t\t\t\t? '0px'\n\t\t\t\t\t\t: '8px'\n\t\t\t }`\n\t\t\t: `margin-right: ${\n\t\t\t\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t\t\t\t? '0px'\n\t\t\t\t\t\t: '8px'\n\t\t\t }`};\n`;\n\nconst inputCss = css`\n\tflex-grow: 1;\n\toverflow: hidden;\n\theight: 100%;\n\n\tinput,\n\ttextarea {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: none;\n\t\tmin-height: 24px;\n\t\toutline: none;\n\t\tfont-size: inherit;\n\t\tline-height: inherit;\n\t\tfont-weight: inherit;\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t\tbackground: transparent;\n\t\t&::placeholder {\n\t\t\tfont-family: Inter;\n\t\t\tcolor: ${COLORS.content.placeholder};\n\t\t}\n\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\n\ttextarea {\n\t\theight: 100%;\n\t\tfont-family: Inter;\n\t\tmin-height: 100px;\n\t\tresize: none;\n\t}\n`;\n\nexport const InputContainer = styled(BodyPrimary)<{\n\theight?: string;\n\ttype?: InputTypeI;\n\tautoGrow?: boolean;\n\tminHeight?: string;\n\tmaxHeight?: string;\n}>`\n\t${inputCss};\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n\n\t${(props) =>\n\t\tprops.autoGrow &&\n\t\tprops.minHeight &&\n\t\t`\n\ttextarea {\n\t\theight: ${props.minHeight};\n\t\tmin-height: ${props.minHeight};\n\t\tmax-height: ${props.maxHeight || '100px'};\n\t}\n\t`}\n`;\n\nexport const InputContainerSmall = styled(BodySecondary)<{\n\theight?: string;\n\ttype?: InputTypeI;\n}>`\n\t${inputCss};\n\tinput {\n\t\tmin-height: 20px;\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n`;\n\nexport const InputContainerXSmall = styled(BodyCaption)<{\n\theight?: string;\n\ttype?: InputTypeI;\n}>`\n\t${inputCss};\n\tinput {\n\t\tmin-height: 16px;\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n`;\n\nexport const InputHeader = styled.div<{\n\tinvalid?: boolean;\n\tmaxCharAlignment?: boolean;\n}>`\n\tdisplay: flex;\n\tjustify-content: space-between;\n\t${(props) => (props.maxCharAlignment ? 'align-items: flex-end;' : '')}\n\tmargin-bottom: 8px;\n\t.label__container {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 2px;\n\t\t> div:first-of-type {\n\t\t\t${(props) =>\n\t\t\t\tprops.invalid ? `color: ${COLORS.content.negative} !important` : ''};\n\t\t}\n\t}\n\n\tspan {\n\t\tcolor: ${COLORS.content.negative};\n\t\tpadding-left: 4px;\n\t}\n`;\n\nexport const MaxCharStyle = styled(BodySecondary)<{ position?: string }>`\n\tcolor: ${COLORS.content.secondary} !important;\n\tmargin-top: ${(props) => (props.position === 'BOTTOM' ? '8px' : '0px')};\n`;\n\nexport const InputFooter = styled(BodyCaption)<{ invalid?: boolean }>`\n\twhite-space: pre-wrap;\n\tmargin-top: 8px;\n\tcolor: ${(props) =>\n\t\tprops.invalid\n\t\t\t? COLORS.content.negative\n\t\t\t: COLORS.content.secondary} !important;\n\t/* position: absolute; */\n\t/* left: 0px;\n\ttop: 100%; */\n\tdisplay: flex !important;\n\tgap: 6px;\n\tmin-height: 16px;\n\t> svg {\n\t\twidth: 16px;\n\t\theight: 16px;\n\t}\n`;\n\nexport const RootContainer = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tstate?: InputStateI;\n\ttype: InputTypeI;\n}>`\n\t${(props) => (props.width ? `width: ${props.width}` : '')};\n\t${(props) =>\n\t\tprops.height && props.type == 'multiline' ? `height: ${props.height}` : ''};\n\t${(props) =>\n\t\tprops.state === 'disabled' || props.state === 'disabled-invalid'\n\t\t\t? css`\n\t\t\t\t\topacity: 0.5;\n\t\t\t\t\tpointer-events: none;\n\t\t\t `\n\t\t\t: ''};\n\tdisplay: flex;\n\tflex-direction: column-reverse;\n\tposition: relative;\n\t.truncate-class {\n\t\tmax-width: 180px;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\t.flex-align-center {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t}\n`;\n\nexport const PrefixHolder = styled(BodyPrimary)<{ variant?: InputVariant }>`\n\toverflow: unset;\n\tmargin-left: ${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? ''\n\t\t\t: '16px'};\n\tfont-size: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '12px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '14px'\n\t\t\t: '16px'};\n\tline-height: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '16px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '20px'\n\t\t\t: '24px'};\n`;\n\nexport const SuffixHolder = styled(BodyPrimary)<{ variant?: InputVariant }>`\n\toverflow: unset;\n\tmargin-right: ${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? ''\n\t\t\t: '16px'};\n\tfont-size: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '12px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '14px'\n\t\t\t: '16px'};\n\tline-height: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '16px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '20px'\n\t\t\t: '24px'};\n`;\n"],"names":["getBorderColor","isActive","isInvalid","hightlightInputColor","COLORS","getBorderWidth","props","InputWrapper","styled","IconHolder","inputCss","css","InputContainer","BodyPrimary","InputContainerSmall","BodySecondary","InputContainerXSmall","BodyCaption","InputHeader","MaxCharStyle","InputFooter","RootContainer","PrefixHolder","SuffixHolder"],"mappings":";;;AASA,MAAMA,IAAiB,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,sBAAAC,QAC1CF,IACIE,KAA8CC,EAAO,OAAO,QACzDF,IACHE,EAAO,OAAO,SAAS,UAExBA,EAAO,OAAO,SAGhBC,IAAiB,CAACC,MAIhBA,EAAM,aAAa,IAAIA,EAAM,YAAY,QAAQ,MAAM,GAGlDC,IAAeC,EAAO;AAAA,kBAWjB,CAACF,MAAWA,EAAM,YAAY,QAAQ,IAAI,CAAE;AAAA,eAC/C,CAACA,MACd,CAAC,YAAY,aAAa,kBAAkB,EAAE,SAASA,EAAM,KAAM,IAChEF,EAAO,WAAW,OAClB,MAAM;AAAA,WACA,CAACE,MAAUD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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAahBiB,IAAgBb,EAAO;AAAA,GAMjC,CAACF,MAAWA,EAAM,QAAQ,UAAUA,EAAM,KAAK,KAAK,EAAG;AAAA,GACvD,CAACA,MACFA,EAAM,UAAUA,EAAM,QAAQ,cAAc,WAAWA,EAAM,MAAM,KAAK,EAAE;AAAA,GACzE,CAACA,MACFA,EAAM,UAAU,cAAcA,EAAM,UAAU,qBAC3CK;AAAA;AAAA;AAAA,SAIA,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAiBMW,IAAed,EAAOK,CAAW;AAAA;AAAA,gBAE9B,CAACP,MACfA,EAAM,WAAW,CAAC,SAAS,SAAS,EAAE,SAASA,EAAM,OAAO,IACzD,KACA,MAAM;AAAA,cACG,CAACA,MACbA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,gBACK,CAACA,MACfA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,GAGEiB,IAAef,EAAOK,CAAW;AAAA;AAAA,iBAE7B,CAACP,MAChBA,EAAM,WAAW,CAAC,SAAS,SAAS,EAAE,SAASA,EAAM,OAAO,IACzD,KACA,MAAM;AAAA,cACG,CAACA,MACbA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,gBACK,CAACA,MACfA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA;"}
1
+ {"version":3,"file":"Input.styled.js","sources":["../../../../src/components/input/Input.styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tBodySecondary,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { InputStateI, InputTypeI, InputVariant } from './Input.model';\n\nconst getBorderColor = ({ isActive, isInvalid, hightlightInputColor }) => {\n\tif (isActive) {\n\t\treturn hightlightInputColor ? hightlightInputColor : COLORS.stroke.brand;\n\t} else if (isInvalid) {\n\t\treturn COLORS.stroke.negative.vibrant;\n\t}\n\treturn COLORS.stroke.primary;\n};\n\nconst getBorderWidth = (props: {\n\tversion?: '1.0' | '2.0' | '3.0';\n\thideBorder?: boolean;\n}) => {\n\treturn props.hideBorder ? 0 : props.version === '2.0' ? 0.5 : 1;\n};\n\nexport const InputWrapper = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tisActive?: boolean;\n\tisInvalid?: boolean;\n\tstate?: InputStateI;\n\tvariant?: InputVariant;\n\tversion?: '1.0' | '2.0' | '3.0';\n\thightlightInputColor?: string;\n\thideBorder?: boolean;\n\tsolidDisabled?: boolean;\n}>`\n\tborder-radius: ${(props) => (props.version === '2.0' ? 8 : 4)}px;\n\tbackground: ${(props) =>\n\t\t['disabled', 'read-only', 'disabled-invalid'].includes(props.state!)\n\t\t\t? COLORS.background.base\n\t\t\t: '#fff'};\n\tborder: ${(props) => getBorderWidth(props)}px solid\n\t\t${(props) =>\n\t\t\tgetBorderColor({\n\t\t\t\tisActive: props.isActive,\n\t\t\t\tisInvalid: props.isInvalid,\n\t\t\t\thightlightInputColor: props.hightlightInputColor,\n\t\t\t})};\n\t${(props) =>\n\t\tprops.isActive\n\t\t\t? `box-shadow: inset 0px 0px 0px 1px ${\n\t\t\t\t\tprops.hightlightInputColor\n\t\t\t\t\t\t? props.hightlightInputColor\n\t\t\t\t\t\t: COLORS.stroke.brand\n\t\t\t };`\n\t\t\t: ''};\n\tpadding: ${(props) => (props.variant === 'small' ? '6px' : '8px')};\n\theight: ${(props) => props.height || '100%'};\n\t${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? 'max-height: 44px'\n\t\t\t: 'min-height: 48px'};\n\tdisplay: flex;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tgap: 8px;\n\toverflow: hidden;\n\n\t${(props) =>\n\t\tprops.state === 'read-only' && !props.solidDisabled ? 'opacity: 0.7' : ''};\n\t${(props) => (props.state === 'read-only' ? 'pointer-events: none' : '')};\n\t${(props) =>\n\t\tprops.solidDisabled &&\n\t\t['disabled', 'read-only', 'disabled-invalid'].includes(props.state!)\n\t\t\t? css`\n\t\t\t\t\tinput,\n\t\t\t\t\ttextarea {\n\t\t\t\t\t\tcolor: ${COLORS.content.secondary};\n\t\t\t\t\t\t-webkit-text-fill-color: ${COLORS.content.secondary};\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t&::placeholder {\n\t\t\t\t\t\t\tcolor: ${COLORS.content.secondary};\n\t\t\t\t\t\t\t-webkit-text-fill-color: ${COLORS.content.secondary};\n\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t `\n\t\t\t: ''};\n`;\n\nexport const IconHolder = styled.div<{\n\tisLeft?: boolean;\n\ticonSize?: string;\n\tvariant?: InputVariant;\n}>`\n\tmin-height: ${(props) => props.iconSize};\n\tmin-width: ${(props) => props.iconSize};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\toverflow: hidden;\n\t${(props) =>\n\t\tprops.isLeft\n\t\t\t? `margin-left:${\n\t\t\t\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t\t\t\t? '0px'\n\t\t\t\t\t\t: '8px'\n\t\t\t }`\n\t\t\t: `margin-right: ${\n\t\t\t\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t\t\t\t? '0px'\n\t\t\t\t\t\t: '8px'\n\t\t\t }`};\n`;\n\nconst inputCss = css`\n\tflex-grow: 1;\n\toverflow: hidden;\n\theight: 100%;\n\n\tinput,\n\ttextarea {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: none;\n\t\tmin-height: 24px;\n\t\toutline: none;\n\t\tfont-size: inherit;\n\t\tline-height: inherit;\n\t\tfont-weight: inherit;\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t\tbackground: transparent;\n\t\t&::placeholder {\n\t\t\tfont-family: Inter;\n\t\t\tcolor: ${COLORS.content.placeholder};\n\t\t}\n\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\n\ttextarea {\n\t\theight: 100%;\n\t\tfont-family: Inter;\n\t\tmin-height: 100px;\n\t\tresize: none;\n\t}\n`;\n\nexport const InputContainer = styled(BodyPrimary)<{\n\theight?: string;\n\ttype?: InputTypeI;\n\tautoGrow?: boolean;\n\tminHeight?: string;\n\tmaxHeight?: string;\n}>`\n\t${inputCss};\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n\n\t${(props) =>\n\t\tprops.autoGrow &&\n\t\tprops.minHeight &&\n\t\t`\n\ttextarea {\n\t\theight: ${props.minHeight};\n\t\tmin-height: ${props.minHeight};\n\t\tmax-height: ${props.maxHeight || '100px'};\n\t}\n\t`}\n`;\n\nexport const InputContainerSmall = styled(BodySecondary)<{\n\theight?: string;\n\ttype?: InputTypeI;\n}>`\n\t${inputCss};\n\tinput {\n\t\tmin-height: 20px;\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n`;\n\nexport const InputContainerXSmall = styled(BodyCaption)<{\n\theight?: string;\n\ttype?: InputTypeI;\n}>`\n\t${inputCss};\n\tinput {\n\t\tmin-height: 16px;\n\t\t&::-webkit-outer-spin-button,\n\t\t&::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t${(props) =>\n\t\tprops.height && props.type !== 'multiline' ? { height: props.height } : {}};\n`;\n\nexport const InputHeader = styled.div<{\n\tinvalid?: boolean;\n\tmaxCharAlignment?: boolean;\n}>`\n\tdisplay: flex;\n\tjustify-content: space-between;\n\t${(props) => (props.maxCharAlignment ? 'align-items: flex-end;' : '')}\n\tmargin-bottom: 8px;\n\t.label__container {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 2px;\n\t\t> div:first-of-type {\n\t\t\t${(props) =>\n\t\t\t\tprops.invalid ? `color: ${COLORS.content.negative} !important` : ''};\n\t\t}\n\t}\n\n\tspan {\n\t\tcolor: ${COLORS.content.negative};\n\t\tpadding-left: 4px;\n\t}\n`;\n\nexport const MaxCharStyle = styled(BodySecondary)<{ position?: string }>`\n\tcolor: ${COLORS.content.secondary} !important;\n\tmargin-top: ${(props) => (props.position === 'BOTTOM' ? '8px' : '0px')};\n`;\n\nexport const InputFooter = styled(BodyCaption)<{ invalid?: boolean }>`\n\twhite-space: pre-wrap;\n\tmargin-top: 8px;\n\tcolor: ${(props) =>\n\t\tprops.invalid\n\t\t\t? COLORS.content.negative\n\t\t\t: COLORS.content.secondary} !important;\n\t/* position: absolute; */\n\t/* left: 0px;\n\ttop: 100%; */\n\tdisplay: flex !important;\n\tgap: 6px;\n\tmin-height: 16px;\n\t> svg {\n\t\twidth: 16px;\n\t\theight: 16px;\n\t}\n`;\n\nexport const RootContainer = styled.div<{\n\twidth?: string;\n\theight?: string;\n\tstate?: InputStateI;\n\ttype: InputTypeI;\n\tsolidDisabled?: boolean;\n}>`\n\t${(props) => (props.width ? `width: ${props.width}` : '')};\n\t${(props) =>\n\t\tprops.height && props.type == 'multiline' ? `height: ${props.height}` : ''};\n\t${(props) =>\n\t\tprops.state === 'disabled' || props.state === 'disabled-invalid'\n\t\t\t? css`\n\t\t\t\t\topacity: ${props.solidDisabled ? 1 : 0.5};\n\t\t\t\t\tpointer-events: none;\n\t\t\t `\n\t\t\t: ''};\n\tdisplay: flex;\n\tflex-direction: column-reverse;\n\tposition: relative;\n\t.truncate-class {\n\t\tmax-width: 180px;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\t.flex-align-center {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t}\n`;\n\nexport const PrefixHolder = styled(BodyPrimary)<{ variant?: InputVariant }>`\n\toverflow: unset;\n\tmargin-left: ${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? ''\n\t\t\t: '16px'};\n\tfont-size: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '12px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '14px'\n\t\t\t: '16px'};\n\tline-height: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '16px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '20px'\n\t\t\t: '24px'};\n`;\n\nexport const SuffixHolder = styled(BodyPrimary)<{ variant?: InputVariant }>`\n\toverflow: unset;\n\tmargin-right: ${(props) =>\n\t\tprops.variant && ['small', 'x-small'].includes(props.variant)\n\t\t\t? ''\n\t\t\t: '16px'};\n\tfont-size: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '12px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '14px'\n\t\t\t: '16px'};\n\tline-height: ${(props) =>\n\t\tprops.variant === 'x-small'\n\t\t\t? '16px'\n\t\t\t: props.variant === 'small'\n\t\t\t? '20px'\n\t\t\t: '24px'};\n`;\n"],"names":["getBorderColor","isActive","isInvalid","hightlightInputColor","COLORS","getBorderWidth","props","InputWrapper","styled","css","IconHolder","inputCss","InputContainer","BodyPrimary","InputContainerSmall","BodySecondary","InputContainerXSmall","BodyCaption","InputHeader","MaxCharStyle","InputFooter","RootContainer","PrefixHolder","SuffixHolder"],"mappings":";;;AASA,MAAMA,IAAiB,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,sBAAAC,QAC1CF,IACIE,KAA8CC,EAAO,OAAO,QACzDF,IACHE,EAAO,OAAO,SAA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SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,gBACK,CAACA,MACfA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,GAGEiB,IAAef,EAAOK,CAAW;AAAA;AAAA,iBAE7B,CAACP,MAChBA,EAAM,WAAW,CAAC,SAAS,SAAS,EAAE,SAASA,EAAM,OAAO,IACzD,KACA,MAAM;AAAA,cACG,CAACA,MACbA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA,gBACK,CAACA,MACfA,EAAM,YAAY,YACf,SACAA,EAAM,YAAY,UAClB,SACA,MAAM;AAAA;"}
@@ -142,6 +142,7 @@ const Ce = (c, n, l) => {
142
142
  isDisabled: d,
143
143
  isChecked: f,
144
144
  isPartiallyChecked: b,
145
+ ariaLabel: l.name,
145
146
  onValueChange: function(h, g, s) {
146
147
  s?.stopPropagation(), o(h ? {
147
148
  type: "selected",
@@ -1 +1 @@
1
- {"version":3,"file":"collectionScreen.js","sources":["../../../../src/components/product-picker-v2/collectionScreen.tsx"],"sourcesContent":["import type { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';\nimport ChevronRight from '@src/assets/icons/chevronRight.svg';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { CheckBox } from '../checkBox';\nimport { IconButton } from '../icon-button';\nimport { Tag } from '../tag';\nimport { Tooltip } from '../tooltips';\nimport { BodyPrimary, TitleRegular } from '../TypographyStyle';\nimport { EmptyState } from './emptyState';\nimport { ProductPickerShimmer } from './ProductPickerShimmer';\nimport type {\n\tCollectionsActions,\n\tSelectedCollectionsActions,\n} from './reducers';\nimport {\n\tCollectionCardDetailStyle,\n\tCollectionCardInfoStyle,\n\tCollectionCardStyle,\n\tCollectionNameHolder,\n} from './style';\nimport type {\n\tCollection,\n\tCollectionFetcherReturn,\n\tSelectedItems,\n} from './type';\nimport { isCollectionPartiallyChecked } from './utility';\n\nexport const truncate = (str: string, n: number, useWordBoundary: boolean) => {\n\tif (!str) return '';\n\tif (str.length <= n) {\n\t\treturn str;\n\t}\n\tconst subString = str.slice(0, n - 1); // the original check\n\treturn (\n\t\t(useWordBoundary\n\t\t\t? subString.slice(0, subString.lastIndexOf(' '))\n\t\t\t: subString) + '...'\n\t);\n};\n\ninterface CollectionsScreenInterface {\n\tcustomCollectionRestriction?: boolean;\n\tdataLoading: boolean;\n\tcollections: { [key: string]: Collection };\n\tselectedCollections: SelectedItems;\n\tcollectionFetcher: (\n\t\toffset: number,\n\t\tstoreId: string,\n\t\tappType: ApplicationType,\n\t) => CollectionFetcherReturn;\n\tstoreId: string;\n\tselectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;\n\tsetCollectionId: React.Dispatch<React.SetStateAction<string>>;\n\tsetSelectedCollectionId: React.Dispatch<React.SetStateAction<string>>;\n\tsetScreen: React.Dispatch<React.SetStateAction<string>>;\n\tcollectionsDispatch: React.Dispatch<CollectionsActions>;\n\tsetSaveDisabled: React.Dispatch<boolean>;\n\tpagingControls: {\n\t\tcurPage: number;\n\t\tsetCurPage: React.Dispatch<React.SetStateAction<number>>;\n\t};\n\thideCollectionCheckbox?: boolean;\n\trenderWithoutModal?: boolean;\n\tpickerType?: 'COLLECTION' | 'PRODUCT';\n\tscrollContainerRef: React.RefObject<HTMLDivElement>;\n\tappType: ApplicationType;\n\tlimit?: number;\n\texactLimit?: number;\n}\n\nexport const CollectionsScreen = (props: CollectionsScreenInterface) => {\n\tconst {\n\t\tcustomCollectionRestriction,\n\t\tdataLoading,\n\t\tcollections,\n\t\tselectedCollectionsDispatch,\n\t\tsetCollectionId,\n\t\tsetSelectedCollectionId,\n\t\tselectedCollections,\n\t\tsetScreen,\n\t\tcollectionFetcher,\n\t\tcollectionsDispatch,\n\t\tpagingControls,\n\t\tstoreId,\n\t\tsetSaveDisabled,\n\t\thideCollectionCheckbox,\n\t\trenderWithoutModal,\n\t\tpickerType,\n\t\tscrollContainerRef,\n\t\tappType,\n\t\tlimit,\n\t\texactLimit,\n\t} = props;\n\n\tconst nextPageRef = useRef(pagingControls.curPage);\n\tconst isCustomSelected = customCollectionRestriction\n\t\t? selectedCollections?.['isCustom']\n\t\t: false || false;\n\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst hasAllCollectionsLoaded = useRef(false);\n\tconst isFetchingRef = useRef(false);\n\n\t/**\n\t * Pagination logic. When scroll bar is end of the container, gets the next 10 collections from api and fetches fb status for those 10 collections.\n\t * After that, Increments next page ref which acts as offset.\n\t */\n\tconst handleScroll = () => {\n\t\tif (!scrollContainerRef || !scrollContainerRef?.current) {\n\t\t\treturn;\n\t\t}\n\t\tconst { scrollTop, clientHeight, scrollHeight } =\n\t\t\tscrollContainerRef.current;\n\n\t\tif (\n\t\t\tscrollTop + clientHeight >= scrollHeight - 20 &&\n\t\t\t!hasAllCollectionsLoaded.current &&\n\t\t\t!isFetchingRef.current\n\t\t) {\n\t\t\tsetSaveDisabled(true);\n\t\t\tsetIsLoading(true);\n\n\t\t\tisFetchingRef.current = true;\n\n\t\t\tsetSaveDisabled(true);\n\t\t\tsetIsLoading(true);\n\t\t\tcollectionFetcher(nextPageRef.current, storeId, appType)\n\t\t\t\t.then((collectionsParsed) => {\n\t\t\t\t\tcollectionsDispatch({\n\t\t\t\t\t\ttype: 'paged',\n\t\t\t\t\t\tdata: collectionsParsed?.collections || {},\n\t\t\t\t\t});\n\t\t\t\t\tpagingControls.setCurPage(nextPageRef.current + 1);\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\tsetSaveDisabled(false);\n\n\t\t\t\t\tisFetchingRef.current = false;\n\n\t\t\t\t\t// We decide that all collections are loaded if the API response has 0 collections. This stops the scroll effect.\n\t\t\t\t\tif (!Object.keys(collectionsParsed?.collections).length) {\n\t\t\t\t\t\thasAllCollectionsLoaded.current = true;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch();\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tscrollContainerRef?.current?.addEventListener('scroll', handleScroll);\n\t\treturn () => {\n\t\t\tscrollContainerRef?.current?.removeEventListener('scroll', handleScroll);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tnextPageRef.current = pagingControls.curPage;\n\t}, [pagingControls.curPage]);\n\n\t// Calculate current count of selected collections for limit enforcement\n\tconst selectedCollectionCount = Object.keys(selectedCollections || {}).filter(\n\t\t(k) => k !== 'isCustom',\n\t).length;\n\n\treturn (\n\t\t<div>\n\t\t\t{Object.keys(collections ?? {})?.length ? (\n\t\t\t\tObject.keys(collections).map((key: string) => {\n\t\t\t\t\tconst isChecked = selectedCollections?.[key]\n\t\t\t\t\t\t? pickerType === 'PRODUCT'\n\t\t\t\t\t\t\t? !!Object.keys(selectedCollections?.[key]?.products ?? {}).length\n\t\t\t\t\t\t\t: true\n\t\t\t\t\t\t: false;\n\n\t\t\t\t\t// For COLLECTION picker, check if limit is reached\n\t\t\t\t\tconst isLimitReached =\n\t\t\t\t\t\tpickerType === 'COLLECTION' &&\n\t\t\t\t\t\t!isChecked &&\n\t\t\t\t\t\t((!!exactLimit && selectedCollectionCount >= exactLimit) ||\n\t\t\t\t\t\t\t(!!limit && selectedCollectionCount >= limit));\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CollectionCard\n\t\t\t\t\t\t\tcustomCollectionRestriction={customCollectionRestriction}\n\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\tdata={collections[key]}\n\t\t\t\t\t\t\tisDisabled={\n\t\t\t\t\t\t\t\t(isCustomSelected && !selectedCollections?.[key]) ||\n\t\t\t\t\t\t\t\tisLimitReached\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisChecked={isChecked}\n\t\t\t\t\t\t\tisPartiallyChecked={isCollectionPartiallyChecked(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tcollections?.[key],\n\t\t\t\t\t\t\t\tselectedCollections,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tselectedCollectionsDispatch={selectedCollectionsDispatch}\n\t\t\t\t\t\t\tsetCollectionId={setCollectionId}\n\t\t\t\t\t\t\tsetSelectedCollectionId={setSelectedCollectionId}\n\t\t\t\t\t\t\tsetScreen={setScreen}\n\t\t\t\t\t\t\tid={key}\n\t\t\t\t\t\t\thideCollectionCheckbox={hideCollectionCheckbox || key === '-1'}\n\t\t\t\t\t\t\tselectedCollections={selectedCollections}\n\t\t\t\t\t\t\trenderWithoutModal={renderWithoutModal}\n\t\t\t\t\t\t\tpickerType={pickerType}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t) : dataLoading ? (\n\t\t\t\t<ProductPickerShimmer />\n\t\t\t) : (\n\t\t\t\t<EmptyState\n\t\t\t\t\ttitle=\"No collections to show\"\n\t\t\t\t\tsubtitle=\"We couldn’t find any collection.\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{isLoading && <ProductPickerShimmer />}\n\t\t</div>\n\t);\n};\n\nexport interface CollectionCardInterface {\n\tcustomCollectionRestriction?: boolean;\n\tdata?: Collection;\n\tselectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;\n\tsetCollectionId: React.Dispatch<React.SetStateAction<string>>;\n\tsetSelectedCollectionId: React.Dispatch<React.SetStateAction<string>>;\n\tsetScreen: React.Dispatch<React.SetStateAction<string>>;\n\tid: string;\n\tisChecked: boolean;\n\tisDisabled: boolean;\n\tisPartiallyChecked: boolean;\n\thideCollectionCheckbox?: boolean;\n\trenderWithoutModal?: boolean;\n\tpickerType?: 'COLLECTION' | 'PRODUCT';\n\tselectedCollections: SelectedItems;\n\tusedInSearch?: boolean;\n}\n\nexport const CollectionCard = (props: CollectionCardInterface) => {\n\tconst {\n\t\tcustomCollectionRestriction,\n\t\tdata,\n\t\tselectedCollectionsDispatch,\n\t\tsetCollectionId,\n\t\tsetSelectedCollectionId,\n\t\tisPartiallyChecked,\n\t\tsetScreen,\n\t\tid,\n\t\tisChecked,\n\t\tisDisabled,\n\t\thideCollectionCheckbox,\n\t\tpickerType,\n\t\tusedInSearch,\n\t} = props;\n\n\tconst onClickChevron = (event) => {\n\t\tif (isDisabled) {\n\t\t\treturn;\n\t\t}\n\t\tif (pickerType === 'COLLECTION') {\n\t\t\tevent.stopPropagation();\n\t\t\tselectedCollectionsDispatch({\n\t\t\t\ttype: 'reset',\n\t\t\t\tdata: {},\n\t\t\t});\n\n\t\t\tselectedCollectionsDispatch({\n\t\t\t\ttype: 'selected',\n\t\t\t\tdata: {\n\t\t\t\t\tid,\n\t\t\t\t\tval: data,\n\t\t\t\t\tisRestricted: customCollectionRestriction,\n\t\t\t\t},\n\t\t\t});\n\t\t\tsetCollectionId(id);\n\t\t\tsetSelectedCollectionId(id);\n\t\t\treturn;\n\t\t}\n\t\tsetCollectionId(id);\n\t\tsetSelectedCollectionId(id);\n\t\tsetScreen('products');\n\t};\n\n\tif (!data) {\n\t\treturn <></>;\n\t}\n\n\treturn (\n\t\t<CollectionCardStyle\n\t\t\tisDisabled={isDisabled}\n\t\t\tonClick={onClickChevron}\n\t\t\tisActive={isChecked}\n\t\t\tusedInSearch={usedInSearch ?? false}\n\t\t>\n\t\t\t<CollectionCardInfoStyle>\n\t\t\t\t{!hideCollectionCheckbox && (\n\t\t\t\t\t<CheckBox\n\t\t\t\t\t\tisDisabled={isDisabled}\n\t\t\t\t\t\tisChecked={isChecked}\n\t\t\t\t\t\tisPartiallyChecked={isPartiallyChecked}\n\t\t\t\t\t\tonValueChange={function (\n\t\t\t\t\t\t\tchecked: boolean,\n\t\t\t\t\t\t\t_value?: string,\n\t\t\t\t\t\t\tevent?: React.MouseEvent,\n\t\t\t\t\t\t): void {\n\t\t\t\t\t\t\tevent?.stopPropagation();\n\t\t\t\t\t\t\tchecked\n\t\t\t\t\t\t\t\t? selectedCollectionsDispatch({\n\t\t\t\t\t\t\t\t\t\ttype: 'selected',\n\t\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\tval: data,\n\t\t\t\t\t\t\t\t\t\t\tisRestricted: customCollectionRestriction,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t: selectedCollectionsDispatch({\n\t\t\t\t\t\t\t\t\t\ttype: 'unselected',\n\t\t\t\t\t\t\t\t\t\tdata: { id },\n\t\t\t\t\t\t\t\t });\n\n\t\t\t\t\t\t\tif (!checked) {\n\t\t\t\t\t\t\t\tsetSelectedCollectionId('');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetSelectedCollectionId(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<CollectionCardDetailStyle>\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tbody={data.name}\n\t\t\t\t\t\tplacement={'bottom'}\n\t\t\t\t\t\tdelay={400}\n\t\t\t\t\t\tvariant=\"light\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CollectionNameHolder>\n\t\t\t\t\t\t\t{!usedInSearch ? (\n\t\t\t\t\t\t\t\t<TitleRegular numberOfLines={1}>{data.name}</TitleRegular>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<BodyPrimary numberOfLines={1}>{data.name}</BodyPrimary>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t{data.isSmartCollection ? (\n\t\t\t\t\t\t\t\t<div style={{ display: 'flex' }}>\n\t\t\t\t\t\t\t\t\t<Tag tagText={'Smart Collection'} type=\"warning\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</CollectionNameHolder>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t</CollectionCardDetailStyle>\n\t\t\t</CollectionCardInfoStyle>\n\t\t\t{pickerType !== 'COLLECTION' && (\n\t\t\t\t<IconButton\n\t\t\t\t\theight={12}\n\t\t\t\t\twidth={12}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\tIcon={ChevronRight}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</CollectionCardStyle>\n\t);\n};\n"],"names":["truncate","str","useWordBoundary","subString","CollectionsScreen","props","customCollectionRestriction","dataLoading","collections","selectedCollectionsDispatch","setCollectionId","setSelectedCollectionId","selectedCollections","setScreen","collectionFetcher","collectionsDispatch","pagingControls","storeId","setSaveDisabled","hideCollectionCheckbox","renderWithoutModal","pickerType","scrollContainerRef","appType","limit","exactLimit","nextPageRef","useRef","isCustomSelected","isLoading","setIsLoading","useState","hasAllCollectionsLoaded","isFetchingRef","handleScroll","scrollTop","clientHeight","scrollHeight","collectionsParsed","useEffect","selectedCollectionCount","k","key","isChecked","isLimitReached","jsx","CollectionCard","isCollectionPartiallyChecked","ProductPickerShimmer","EmptyState","data","isPartiallyChecked","id","isDisabled","usedInSearch","onClickChevron","event","jsxs","CollectionCardStyle","CollectionCardInfoStyle","CheckBox","checked","_value","CollectionCardDetailStyle","Tooltip","CollectionNameHolder","BodyPrimary","TitleRegular","Tag","Fragment","IconButton","ChevronRight"],"mappings":";;;;;;;;;;;;AA2BO,MAAMA,KAAW,CAACC,GAAa,GAAWC,MAA6B;AAC7E,MAAI,CAACD,EAAK,QAAO;AACjB,MAAIA,EAAI,UAAU;AACjB,WAAOA;AAER,QAAME,IAAYF,EAAI,MAAM,GAAG,IAAI,CAAC;AACpC,SAEIE,EAAU,MAAM,GAAGA,EAAU,YAAY,GAAG,CAAC,IAChC;AAElB,GAgCaC,KAAoB,CAACC,MAAsC;AACvE,QAAM;AAAA,IACL,6BAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,gBAAAC;A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ACN,MAAM;AAAA,oBACL,IAAAT;AAAA,oBACA,KAAKF;AAAA,oBACL,cAAc5C;AAAA,kBAAA;AAAA,gBACf,IAE4B;AAAA,kBAC5B,MAAM;AAAA,kBACN,MAAM,EAAE,IAAA8C,EAAA;AAAA,gBAAG,CAHV,GASHzC,EAHIkD,IAGoBT,IAFA,EAEE;AAAA,cAE5B;AAAA,YAAA;AAAA,UAAA;AAAA,4BAGDW,GAAA,EACA,UAAA,gBAAAlB;AAAA,YAACmB;AAAA,YAAA;AAAA,cACA,MAAMd,EAAK;AAAA,cACX,WAAW;AAAA,cACX,OAAO;AAAA,cACP,SAAQ;AAAA,cAER,4BAACe,GAAA,EACC,UAAA;AAAA,gBAACX,IAGD,gBAAAT,EAACqB,GAAA,EAAY,eAAe,GAAI,YAAK,MAAK,IAF1C,gBAAArB,EAACsB,GAAA,EAAa,eAAe,GAAI,UAAAjB,EAAK,KAAA,CAAK;AAAA,gBAK3CA,EAAK,oBACL,gBAAAL,EAAC,OAAA,EAAI,OAAO,EAAE,SAAS,OAAA,GACtB,UAAA,gBAAAA,EAACuB,KAAI,SAAS,oBAAoB,MAAK,UAAA,CAAU,GAClD,IAEA,gBAAAvB,EAAAwB,GAAA,CAAA,CAAE;AAAA,cAAA,EAAA,CAEJ;AAAA,YAAA;AAAA,UAAA,EACD,CACD;AAAA,QAAA,GACD;AAAA,QACChD,MAAe,gBACf,gBAAAwB;AAAA,UAACyB;AAAA,UAAA;AAAA,YACA,QAAQ;AAAA,YACR,OAAO;AAAA,YACP,UAAUjB;AAAA,YACV,MAAMkB;AAAAA,UAAA;AAAA,QAAA;AAAA,MACP;AAAA,IAAA;AAAA,EAAA,IA3EK,gBAAA1B,EAAAwB,GAAA,EAAE;AA+EX;"}
1
+ {"version":3,"file":"collectionScreen.js","sources":["../../../../src/components/product-picker-v2/collectionScreen.tsx"],"sourcesContent":["import type { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';\nimport ChevronRight from '@src/assets/icons/chevronRight.svg';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { CheckBox } from '../checkBox';\nimport { IconButton } from '../icon-button';\nimport { Tag } from '../tag';\nimport { Tooltip } from '../tooltips';\nimport { BodyPrimary, TitleRegular } from '../TypographyStyle';\nimport { EmptyState } from './emptyState';\nimport { ProductPickerShimmer } from './ProductPickerShimmer';\nimport type {\n\tCollectionsActions,\n\tSelectedCollectionsActions,\n} from './reducers';\nimport {\n\tCollectionCardDetailStyle,\n\tCollectionCardInfoStyle,\n\tCollectionCardStyle,\n\tCollectionNameHolder,\n} from './style';\nimport type {\n\tCollection,\n\tCollectionFetcherReturn,\n\tSelectedItems,\n} from './type';\nimport { isCollectionPartiallyChecked } from './utility';\n\nexport const truncate = (str: string, n: number, useWordBoundary: boolean) => {\n\tif (!str) return '';\n\tif (str.length <= n) {\n\t\treturn str;\n\t}\n\tconst subString = str.slice(0, n - 1); // the original check\n\treturn (\n\t\t(useWordBoundary\n\t\t\t? subString.slice(0, subString.lastIndexOf(' '))\n\t\t\t: subString) + '...'\n\t);\n};\n\ninterface CollectionsScreenInterface {\n\tcustomCollectionRestriction?: boolean;\n\tdataLoading: boolean;\n\tcollections: { [key: string]: Collection };\n\tselectedCollections: SelectedItems;\n\tcollectionFetcher: (\n\t\toffset: number,\n\t\tstoreId: string,\n\t\tappType: ApplicationType,\n\t) => CollectionFetcherReturn;\n\tstoreId: string;\n\tselectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;\n\tsetCollectionId: React.Dispatch<React.SetStateAction<string>>;\n\tsetSelectedCollectionId: React.Dispatch<React.SetStateAction<string>>;\n\tsetScreen: React.Dispatch<React.SetStateAction<string>>;\n\tcollectionsDispatch: React.Dispatch<CollectionsActions>;\n\tsetSaveDisabled: React.Dispatch<boolean>;\n\tpagingControls: {\n\t\tcurPage: number;\n\t\tsetCurPage: React.Dispatch<React.SetStateAction<number>>;\n\t};\n\thideCollectionCheckbox?: boolean;\n\trenderWithoutModal?: boolean;\n\tpickerType?: 'COLLECTION' | 'PRODUCT';\n\tscrollContainerRef: React.RefObject<HTMLDivElement>;\n\tappType: ApplicationType;\n\tlimit?: number;\n\texactLimit?: number;\n}\n\nexport const CollectionsScreen = (props: CollectionsScreenInterface) => {\n\tconst {\n\t\tcustomCollectionRestriction,\n\t\tdataLoading,\n\t\tcollections,\n\t\tselectedCollectionsDispatch,\n\t\tsetCollectionId,\n\t\tsetSelectedCollectionId,\n\t\tselectedCollections,\n\t\tsetScreen,\n\t\tcollectionFetcher,\n\t\tcollectionsDispatch,\n\t\tpagingControls,\n\t\tstoreId,\n\t\tsetSaveDisabled,\n\t\thideCollectionCheckbox,\n\t\trenderWithoutModal,\n\t\tpickerType,\n\t\tscrollContainerRef,\n\t\tappType,\n\t\tlimit,\n\t\texactLimit,\n\t} = props;\n\n\tconst nextPageRef = useRef(pagingControls.curPage);\n\tconst isCustomSelected = customCollectionRestriction\n\t\t? selectedCollections?.['isCustom']\n\t\t: false || false;\n\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst hasAllCollectionsLoaded = useRef(false);\n\tconst isFetchingRef = useRef(false);\n\n\t/**\n\t * Pagination logic. When scroll bar is end of the container, gets the next 10 collections from api and fetches fb status for those 10 collections.\n\t * After that, Increments next page ref which acts as offset.\n\t */\n\tconst handleScroll = () => {\n\t\tif (!scrollContainerRef || !scrollContainerRef?.current) {\n\t\t\treturn;\n\t\t}\n\t\tconst { scrollTop, clientHeight, scrollHeight } =\n\t\t\tscrollContainerRef.current;\n\n\t\tif (\n\t\t\tscrollTop + clientHeight >= scrollHeight - 20 &&\n\t\t\t!hasAllCollectionsLoaded.current &&\n\t\t\t!isFetchingRef.current\n\t\t) {\n\t\t\tsetSaveDisabled(true);\n\t\t\tsetIsLoading(true);\n\n\t\t\tisFetchingRef.current = true;\n\n\t\t\tsetSaveDisabled(true);\n\t\t\tsetIsLoading(true);\n\t\t\tcollectionFetcher(nextPageRef.current, storeId, appType)\n\t\t\t\t.then((collectionsParsed) => {\n\t\t\t\t\tcollectionsDispatch({\n\t\t\t\t\t\ttype: 'paged',\n\t\t\t\t\t\tdata: collectionsParsed?.collections || {},\n\t\t\t\t\t});\n\t\t\t\t\tpagingControls.setCurPage(nextPageRef.current + 1);\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\tsetSaveDisabled(false);\n\n\t\t\t\t\tisFetchingRef.current = false;\n\n\t\t\t\t\t// We decide that all collections are loaded if the API response has 0 collections. This stops the scroll effect.\n\t\t\t\t\tif (!Object.keys(collectionsParsed?.collections).length) {\n\t\t\t\t\t\thasAllCollectionsLoaded.current = true;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch();\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tscrollContainerRef?.current?.addEventListener('scroll', handleScroll);\n\t\treturn () => {\n\t\t\tscrollContainerRef?.current?.removeEventListener('scroll', handleScroll);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tnextPageRef.current = pagingControls.curPage;\n\t}, [pagingControls.curPage]);\n\n\t// Calculate current count of selected collections for limit enforcement\n\tconst selectedCollectionCount = Object.keys(selectedCollections || {}).filter(\n\t\t(k) => k !== 'isCustom',\n\t).length;\n\n\treturn (\n\t\t<div>\n\t\t\t{Object.keys(collections ?? {})?.length ? (\n\t\t\t\tObject.keys(collections).map((key: string) => {\n\t\t\t\t\tconst isChecked = selectedCollections?.[key]\n\t\t\t\t\t\t? pickerType === 'PRODUCT'\n\t\t\t\t\t\t\t? !!Object.keys(selectedCollections?.[key]?.products ?? {}).length\n\t\t\t\t\t\t\t: true\n\t\t\t\t\t\t: false;\n\n\t\t\t\t\t// For COLLECTION picker, check if limit is reached\n\t\t\t\t\tconst isLimitReached =\n\t\t\t\t\t\tpickerType === 'COLLECTION' &&\n\t\t\t\t\t\t!isChecked &&\n\t\t\t\t\t\t((!!exactLimit && selectedCollectionCount >= exactLimit) ||\n\t\t\t\t\t\t\t(!!limit && selectedCollectionCount >= limit));\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CollectionCard\n\t\t\t\t\t\t\tcustomCollectionRestriction={customCollectionRestriction}\n\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\tdata={collections[key]}\n\t\t\t\t\t\t\tisDisabled={\n\t\t\t\t\t\t\t\t(isCustomSelected && !selectedCollections?.[key]) ||\n\t\t\t\t\t\t\t\tisLimitReached\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisChecked={isChecked}\n\t\t\t\t\t\t\tisPartiallyChecked={isCollectionPartiallyChecked(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tcollections?.[key],\n\t\t\t\t\t\t\t\tselectedCollections,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tselectedCollectionsDispatch={selectedCollectionsDispatch}\n\t\t\t\t\t\t\tsetCollectionId={setCollectionId}\n\t\t\t\t\t\t\tsetSelectedCollectionId={setSelectedCollectionId}\n\t\t\t\t\t\t\tsetScreen={setScreen}\n\t\t\t\t\t\t\tid={key}\n\t\t\t\t\t\t\thideCollectionCheckbox={hideCollectionCheckbox || key === '-1'}\n\t\t\t\t\t\t\tselectedCollections={selectedCollections}\n\t\t\t\t\t\t\trenderWithoutModal={renderWithoutModal}\n\t\t\t\t\t\t\tpickerType={pickerType}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t) : dataLoading ? (\n\t\t\t\t<ProductPickerShimmer />\n\t\t\t) : (\n\t\t\t\t<EmptyState\n\t\t\t\t\ttitle=\"No collections to show\"\n\t\t\t\t\tsubtitle=\"We couldn’t find any collection.\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{isLoading && <ProductPickerShimmer />}\n\t\t</div>\n\t);\n};\n\nexport interface CollectionCardInterface {\n\tcustomCollectionRestriction?: boolean;\n\tdata?: Collection;\n\tselectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;\n\tsetCollectionId: React.Dispatch<React.SetStateAction<string>>;\n\tsetSelectedCollectionId: React.Dispatch<React.SetStateAction<string>>;\n\tsetScreen: React.Dispatch<React.SetStateAction<string>>;\n\tid: string;\n\tisChecked: boolean;\n\tisDisabled: boolean;\n\tisPartiallyChecked: boolean;\n\thideCollectionCheckbox?: boolean;\n\trenderWithoutModal?: boolean;\n\tpickerType?: 'COLLECTION' | 'PRODUCT';\n\tselectedCollections: SelectedItems;\n\tusedInSearch?: boolean;\n}\n\nexport const CollectionCard = (props: CollectionCardInterface) => {\n\tconst {\n\t\tcustomCollectionRestriction,\n\t\tdata,\n\t\tselectedCollectionsDispatch,\n\t\tsetCollectionId,\n\t\tsetSelectedCollectionId,\n\t\tisPartiallyChecked,\n\t\tsetScreen,\n\t\tid,\n\t\tisChecked,\n\t\tisDisabled,\n\t\thideCollectionCheckbox,\n\t\tpickerType,\n\t\tusedInSearch,\n\t} = props;\n\n\tconst onClickChevron = (event) => {\n\t\tif (isDisabled) {\n\t\t\treturn;\n\t\t}\n\t\tif (pickerType === 'COLLECTION') {\n\t\t\tevent.stopPropagation();\n\t\t\tselectedCollectionsDispatch({\n\t\t\t\ttype: 'reset',\n\t\t\t\tdata: {},\n\t\t\t});\n\n\t\t\tselectedCollectionsDispatch({\n\t\t\t\ttype: 'selected',\n\t\t\t\tdata: {\n\t\t\t\t\tid,\n\t\t\t\t\tval: data,\n\t\t\t\t\tisRestricted: customCollectionRestriction,\n\t\t\t\t},\n\t\t\t});\n\t\t\tsetCollectionId(id);\n\t\t\tsetSelectedCollectionId(id);\n\t\t\treturn;\n\t\t}\n\t\tsetCollectionId(id);\n\t\tsetSelectedCollectionId(id);\n\t\tsetScreen('products');\n\t};\n\n\tif (!data) {\n\t\treturn <></>;\n\t}\n\n\treturn (\n\t\t<CollectionCardStyle\n\t\t\tisDisabled={isDisabled}\n\t\t\tonClick={onClickChevron}\n\t\t\tisActive={isChecked}\n\t\t\tusedInSearch={usedInSearch ?? false}\n\t\t>\n\t\t\t<CollectionCardInfoStyle>\n\t\t\t\t{!hideCollectionCheckbox && (\n\t\t\t\t\t<CheckBox\n\t\t\t\t\t\tisDisabled={isDisabled}\n\t\t\t\t\t\tisChecked={isChecked}\n\t\t\t\t\t\tisPartiallyChecked={isPartiallyChecked}\n\t\t\t\t\t\tariaLabel={data.name}\n\t\t\t\t\t\tonValueChange={function (\n\t\t\t\t\t\t\tchecked: boolean,\n\t\t\t\t\t\t\t_value?: string,\n\t\t\t\t\t\t\tevent?: React.MouseEvent,\n\t\t\t\t\t\t): void {\n\t\t\t\t\t\t\tevent?.stopPropagation();\n\t\t\t\t\t\t\tchecked\n\t\t\t\t\t\t\t\t? selectedCollectionsDispatch({\n\t\t\t\t\t\t\t\t\t\ttype: 'selected',\n\t\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\tval: data,\n\t\t\t\t\t\t\t\t\t\t\tisRestricted: customCollectionRestriction,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t: selectedCollectionsDispatch({\n\t\t\t\t\t\t\t\t\t\ttype: 'unselected',\n\t\t\t\t\t\t\t\t\t\tdata: { id },\n\t\t\t\t\t\t\t\t });\n\n\t\t\t\t\t\t\tif (!checked) {\n\t\t\t\t\t\t\t\tsetSelectedCollectionId('');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetSelectedCollectionId(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<CollectionCardDetailStyle>\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tbody={data.name}\n\t\t\t\t\t\tplacement={'bottom'}\n\t\t\t\t\t\tdelay={400}\n\t\t\t\t\t\tvariant=\"light\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CollectionNameHolder>\n\t\t\t\t\t\t\t{!usedInSearch ? (\n\t\t\t\t\t\t\t\t<TitleRegular numberOfLines={1}>{data.name}</TitleRegular>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<BodyPrimary numberOfLines={1}>{data.name}</BodyPrimary>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t{data.isSmartCollection ? (\n\t\t\t\t\t\t\t\t<div style={{ display: 'flex' }}>\n\t\t\t\t\t\t\t\t\t<Tag tagText={'Smart Collection'} type=\"warning\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<></>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</CollectionNameHolder>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t</CollectionCardDetailStyle>\n\t\t\t</CollectionCardInfoStyle>\n\t\t\t{pickerType !== 'COLLECTION' && (\n\t\t\t\t<IconButton\n\t\t\t\t\theight={12}\n\t\t\t\t\twidth={12}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\tIcon={ChevronRight}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</CollectionCardStyle>\n\t);\n};\n"],"names":["truncate","str","useWordBoundary","subString","CollectionsScreen","props","customCollectionRestriction","dataLoading","collections","selectedCollectionsDispatch","setCollectionId","setSelectedCollectionId","selectedCollections","setScreen","collectionFetcher","collectionsDispatch","pagingControls","storeId","setSaveDisabled","hideCollectionCheckbox","renderWithoutModal","pickerType","scrollContainerRef","appType","limit","exactLimit","nextPageRef","useRef","isCustomSelected","isLoading","setIsLoading","useState","hasAllCollectionsLoaded","isFetchingRef","handleScroll","scrollTop","clientHeight","scrollHeight","collectionsParsed","useEffect","selectedCollectionCount","k","key","isChecked","isLimitReached","jsx","CollectionCard","isCollectionPartiallyChecked","ProductPickerShimmer","EmptyState","data","isPartiallyChecked","id","isDisabled","usedInSearch","onClickChevron","event","jsxs","CollectionCardStyle","CollectionCardInfoStyle","CheckBox","checked","_value","CollectionCardDetailStyle","Tooltip","CollectionNameHolder","BodyPrimary","TitleRegular","Tag","Fragment","IconButton","Ch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AoB,MAAK,UAAA,CAAU,GAClD,IAEA,gBAAAvB,EAAAwB,GAAA,CAAA,CAAE;AAAA,cAAA,EAAA,CAEJ;AAAA,YAAA;AAAA,UAAA,EACD,CACD;AAAA,QAAA,GACD;AAAA,QACChD,MAAe,gBACf,gBAAAwB;AAAA,UAACyB;AAAA,UAAA;AAAA,YACA,QAAQ;AAAA,YACR,OAAO;AAAA,YACP,UAAUjB;AAAA,YACV,MAAMkB;AAAAA,UAAA;AAAA,QAAA;AAAA,MACP;AAAA,IAAA;AAAA,EAAA,IA5EK,gBAAA1B,EAAAwB,GAAA,EAAE;AAgFX;"}
@@ -3,19 +3,19 @@ import { COLORS as D } from "../../constants/Theme.js";
3
3
  import B from "../../assets/icons/info.svg.js";
4
4
  import { TitleSmall as $, BodyCaption as R } from "../TypographyStyle.js";
5
5
  import { CurrencySymbols as O } from "./constants.js";
6
- import { ProductHelper as K } from "./helpers/ProductHelper.js";
7
- import { ProductPickerTag as L } from "./ProductPickerTag.js";
6
+ import { ProductHelper as L } from "./helpers/ProductHelper.js";
7
+ import { ProductPickerTag as K } from "./ProductPickerTag.js";
8
8
  import { ProductCardStyle as E, ProductInfo as G, ProductSubTitle as H, SKUIDBadge as _, EllipsedBodyTiny as q } from "./style.js";
9
9
  import { shouldShowVariant as V, getSkuId as z } from "./utility.js";
10
10
  import { CheckBox as J } from "../checkBox/CheckBox.js";
11
11
  import { ShimmerImage as M } from "../shimmer-image/ShimmerImage.js";
12
12
  import { Tooltip as A } from "../tooltips/Tooltip.js";
13
13
  import { IconButton as N } from "../icon-button/IconButton.js";
14
- const lt = (v) => {
14
+ const le = (v) => {
15
15
  const {
16
16
  collectionId: c,
17
- productId: e,
18
- data: t,
17
+ productId: t,
18
+ data: e,
19
19
  selectedData: o,
20
20
  selectedCollectionsDispatch: a,
21
21
  viewOnly: n,
@@ -24,18 +24,18 @@ const lt = (v) => {
24
24
  hideProductCheckbox: l,
25
25
  outOfStockAction: y,
26
26
  hideVariantCheckbox: p,
27
- hideProductVariants: h,
27
+ hideProductVariants: m,
28
28
  pickerType: P,
29
29
  onProductDetailClick: s,
30
30
  showProductDetailInfoIcon: C
31
- } = v, g = () => !!o?.[c]?.products?.[e], S = (i) => o?.[c]?.products?.[e] ? !!o?.[c]?.products?.[e]?.variants?.[i] : !1, b = !h && V(t) ? "" : `${t.currency ? O[t.currency] ?? "" : ""}${Object.values(t.variants ?? {})?.[0]?.price ?? Object.values(t.variants ?? {})?.[0]?.actualPrice ?? ""}`;
31
+ } = v, g = () => !!o?.[c]?.products?.[t], S = (i) => o?.[c]?.products?.[t] ? !!o?.[c]?.products?.[t]?.variants?.[i] : !1, b = !m && V(e) ? "" : `${e.currency ? O[e.currency] ?? "" : ""}${Object.values(e.variants ?? {})?.[0]?.price ?? Object.values(e.variants ?? {})?.[0]?.actualPrice ?? ""}`;
32
32
  return /* @__PURE__ */ u("div", { children: [
33
33
  /* @__PURE__ */ r(
34
34
  U,
35
35
  {
36
36
  isVariant: !1,
37
- data: t,
38
- productId: e,
37
+ data: e,
38
+ productId: t,
39
39
  collectionId: c,
40
40
  isSelected: g(),
41
41
  isPartiallyChecked: f,
@@ -44,28 +44,28 @@ const lt = (v) => {
44
44
  viewOnly: n,
45
45
  hideProductCheckbox: l,
46
46
  hideVariantCheckbox: p,
47
- hideProductVariants: h,
47
+ hideProductVariants: m,
48
48
  pickerType: P,
49
49
  outOfStockAction: y,
50
50
  onProductDetailClick: s,
51
51
  showProductDetailInfoIcon: C,
52
52
  currencyAndPrice: b
53
53
  },
54
- e
54
+ t
55
55
  ),
56
- h ? null : V(t) && Object.keys(t.variants || []).map((i) => {
57
- const m = `${t.currency ? O[t.currency] ?? "" : ""}${t.variants?.[i]?.price ?? t.variants?.[i]?.actualPrice ?? ""}`;
56
+ m ? null : V(e) && Object.keys(e.variants || []).map((i) => {
57
+ const h = `${e.currency ? O[e.currency] ?? "" : ""}${e.variants?.[i]?.price ?? e.variants?.[i]?.actualPrice ?? ""}`;
58
58
  return /* @__PURE__ */ r(
59
59
  U,
60
60
  {
61
61
  isVariant: !0,
62
62
  hideVariantCheckbox: p,
63
63
  data: {
64
- ...t.variants[i],
65
- currency: t.currency
64
+ ...e.variants[i],
65
+ currency: e.currency
66
66
  },
67
67
  variantId: i,
68
- productId: e,
68
+ productId: t,
69
69
  viewOnly: n,
70
70
  upliftAdditions: d,
71
71
  collectionId: c,
@@ -74,7 +74,7 @@ const lt = (v) => {
74
74
  outOfStockAction: y,
75
75
  onProductDetailClick: s,
76
76
  showProductDetailInfoIcon: C,
77
- currencyAndPrice: m
77
+ currencyAndPrice: h
78
78
  },
79
79
  i
80
80
  );
@@ -83,8 +83,8 @@ const lt = (v) => {
83
83
  }, U = (v) => {
84
84
  const {
85
85
  isVariant: c,
86
- data: e,
87
- productId: t,
86
+ data: t,
87
+ productId: e,
88
88
  collectionId: o,
89
89
  variantId: a,
90
90
  isSelected: n,
@@ -93,7 +93,7 @@ const lt = (v) => {
93
93
  upliftAdditions: l,
94
94
  isPartiallyChecked: y,
95
95
  hideProductCheckbox: p,
96
- outOfStockAction: h,
96
+ outOfStockAction: m,
97
97
  hideVariantCheckbox: P,
98
98
  hideProductVariants: s,
99
99
  pickerType: C = "PRODUCT",
@@ -102,44 +102,44 @@ const lt = (v) => {
102
102
  currencyAndPrice: b
103
103
  } = v, {
104
104
  isVariantForProductPickerTag: i,
105
- dataForProductPickerTag: m,
105
+ dataForProductPickerTag: h,
106
106
  tagText: I,
107
107
  tagType: w
108
- } = K.getDataForProductPickerTag(
109
- e,
108
+ } = L.getDataForProductPickerTag(
109
+ t,
110
110
  c,
111
- h
112
- ), x = z(e, c);
111
+ m
112
+ ), x = z(t, c);
113
113
  return /* @__PURE__ */ u(
114
114
  E,
115
115
  {
116
116
  isVariant: c,
117
117
  onClick: (k) => {
118
118
  if (k.stopPropagation(), C === "PRODUCT" && (p || P)) {
119
- const T = Object.keys(e.variants);
119
+ const T = Object.keys(t.variants);
120
120
  s ? n ? d({
121
121
  type: "productUnselected",
122
122
  data: {
123
- productId: t,
123
+ productId: e,
124
124
  collectionId: o
125
125
  }
126
126
  }) : l("productSelected", {
127
- productId: t,
127
+ productId: e,
128
128
  variantId: a,
129
129
  collectionId: o,
130
- product: e
130
+ product: t
131
131
  }) : n ? d({
132
132
  type: "variantUnselected",
133
133
  data: {
134
- productId: t,
134
+ productId: e,
135
135
  variantId: a,
136
136
  collectionId: o
137
137
  }
138
138
  }) : l("variantSelected", {
139
- productId: t,
139
+ productId: e,
140
140
  variantId: a || T[0],
141
141
  collectionId: o,
142
- variant: e
142
+ variant: t
143
143
  });
144
144
  }
145
145
  },
@@ -150,30 +150,31 @@ const lt = (v) => {
150
150
  {
151
151
  isChecked: n,
152
152
  isPartiallyChecked: y || !1,
153
+ ariaLabel: t.name,
153
154
  onValueChange: function(k, T, j) {
154
155
  j?.stopPropagation(), c ? k ? l(
155
156
  s ? "productSelected" : "variantSelected",
156
157
  {
157
- productId: t,
158
+ productId: e,
158
159
  variantId: a,
159
160
  collectionId: o,
160
- variant: e
161
+ variant: t
161
162
  }
162
163
  ) : d({
163
164
  type: s ? "productUnselected" : "variantUnselected",
164
165
  data: {
165
- productId: t,
166
+ productId: e,
166
167
  variantId: a,
167
168
  collectionId: o
168
169
  }
169
170
  }) : k ? l("productSelected", {
170
- productId: t,
171
+ productId: e,
171
172
  collectionId: o,
172
- product: e
173
+ product: t
173
174
  }) : d({
174
175
  type: "productUnselected",
175
176
  data: {
176
- productId: t,
177
+ productId: e,
177
178
  collectionId: o
178
179
  }
179
180
  });
@@ -185,7 +186,7 @@ const lt = (v) => {
185
186
  {
186
187
  width: 40,
187
188
  height: 40,
188
- imageUrl: e.image,
189
+ imageUrl: t.image,
189
190
  alt: "Item",
190
191
  borderRadius: 4
191
192
  }
@@ -213,7 +214,7 @@ const lt = (v) => {
213
214
  A,
214
215
  {
215
216
  variant: "light",
216
- body: e.name,
217
+ body: t.name,
217
218
  placement: "bottom",
218
219
  delay: 400,
219
220
  children: /* @__PURE__ */ r(
@@ -223,17 +224,17 @@ const lt = (v) => {
223
224
  flex: 1
224
225
  },
225
226
  numberOfLines: 1,
226
- children: e.name
227
+ children: t.name
227
228
  }
228
229
  )
229
230
  }
230
231
  ),
231
232
  /* @__PURE__ */ u(G, { children: [
232
233
  /* @__PURE__ */ r(
233
- L,
234
+ K,
234
235
  {
235
236
  isVariant: i,
236
- data: m,
237
+ data: h,
237
238
  tagText: I,
238
239
  tagType: w
239
240
  }
@@ -242,7 +243,7 @@ const lt = (v) => {
242
243
  N,
243
244
  {
244
245
  onClick: () => {
245
- g?.(e);
246
+ g?.(t);
246
247
  },
247
248
  Icon: () => /* @__PURE__ */ r(
248
249
  B,
@@ -259,7 +260,7 @@ const lt = (v) => {
259
260
  }
260
261
  ),
261
262
  /* @__PURE__ */ u(H, { children: [
262
- !m?.fbStatus && i || I ? null : /* @__PURE__ */ r(R, { color: D.content.secondary, children: b }),
263
+ !h?.fbStatus && i || I ? null : /* @__PURE__ */ r(R, { color: D.content.secondary, children: b }),
263
264
  x && /* @__PURE__ */ r(A, { body: x, placement: "top", children: /* @__PURE__ */ r(_, { children: /* @__PURE__ */ r(q, { children: `SKU ID: ${x}` }) }) })
264
265
  ] })
265
266
  ]
@@ -271,6 +272,6 @@ const lt = (v) => {
271
272
  };
272
273
  export {
273
274
  U as ProductCard,
274
- lt as ProductGroup
275
+ le as ProductGroup
275
276
  };
276
277
  //# sourceMappingURL=product.js.map