@soul-refiner/design-system 2.14.117 → 2.14.118
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.
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),o=require("next/image"),
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),o=require("next/image"),n=require("styled-components"),i=require("../../actions/button/button.js"),s=require("../../atoms/typography/paragraph.js"),t=require("../../atoms/box/box.js"),l=require("../../atoms/typography/heading.js"),a=require("../../../icons/basic/graduation_cap.js"),c=require("../../../icons/basic/search.js"),d=require("../../../icons/basic/plus.js"),u=require("../../../icons/basic/close.js");require("../../iconography/icon/icon.js");var p=require("../../../icons/arrow/chevron_down.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../icons/basic/subtask.js"),require("../../../common/colors.js");var g=x(r),h=x(o);const b=n.styled.div`
|
|
3
3
|
position: relative;
|
|
4
4
|
display: block;
|
|
5
5
|
outline: none;
|
|
6
6
|
${({$sx:e})=>e||""}
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
${({$disabled:e})=>e?"\n opacity: 0.6;\n filter: grayscale(0.4) blur(1px);\n pointer-events: none;\n user-select: none;\n cursor: not-allowed;\n ":""}
|
|
9
|
+
`,$=n.styled.div`
|
|
8
10
|
min-width: 280px;
|
|
9
11
|
max-height: 600px;
|
|
10
12
|
display: flex;
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
${({$sx:e})=>e||""}
|
|
23
25
|
|
|
24
26
|
${({$offset:e})=>e?`transform: translate(${e[0]}px, ${e[1]}px);`:""}
|
|
25
|
-
`,
|
|
27
|
+
`,f=n.styled.div`
|
|
26
28
|
position: relative;
|
|
27
29
|
padding: 12px 16px;
|
|
28
30
|
user-select: none;
|
|
@@ -33,9 +35,9 @@
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
${({$disabled:e})=>e?"cursor: initial;\n color: var(--color-grey-7);\n background-color: var(--color-grey-10);":"\n &:hover {\n background-color: var(--color-grey-10);\n }\n\n &:active {\n background-color: var(--color-grey-8);\n }\n "}
|
|
36
|
-
|
|
38
|
+
`,j=n.styled.div`
|
|
37
39
|
padding: 12px;
|
|
38
40
|
border-radius: 8px;
|
|
39
41
|
background-color: ${({$color:e})=>e};
|
|
40
42
|
width: fit-content;
|
|
41
|
-
`;exports.CoursesSelection=({closeOnChange:r=!0,closeOnBlur:o=!0,disabled:
|
|
43
|
+
`;exports.CoursesSelection=({closeOnChange:r=!0,closeOnBlur:o=!0,disabled:n=!1,offset:x=[0,0],sx:y,containerSx:m,courses:v,label:q,courseIsSelected:w,setCourseIsSelected:C,subtitle:S,onlyOneCanBeSelected:k=!1,searchable:B=!0,...I})=>{const z=g.default.useRef(null),[O,P]=g.default.useState(!1);g.default.useEffect(()=>{n&&P(!1)},[n]);const D=v.filter(e=>w[e.id]),R=B?c.Search:p.ChevronDown;return e.jsxs(b,{$sx:y,$disabled:n,tabIndex:0,ref:z,onBlurCapture:e=>{o&&z?.current&&!z?.current?.contains(e.relatedTarget)&&P(!1)},...I,children:[e.jsxs(t.Box,{$gap:16,$align:"center",children:[e.jsx(j,{$color:"var(--color-hue-purple-2)",children:e.jsx(a.GraduationCap,{color:"hue-purple-1",size:24})}),e.jsx(l.H.Six,{$bold:!0,$color:"hue-purple-1",children:"Course"})]}),e.jsx(s.P,{$color:"grey-4",$fontSize:14,sx:"margin-top: 32px;",children:S}),e.jsx(i.Button,{type:"dropdown",isDropdownOpen:O,onClick:()=>{n||P(e=>!e)},customDropdownIcon:R,disabled:n,sx:"margin-top: 32px;",children:q}),O&&e.jsx($,{$offset:x,$sx:m,children:v.map(o=>e.jsx(f,{$disabled:n,onClick:()=>{n||(C(k?{[o.id]:!0}:{...w,[o.id]:!0}),r&&P(!1))},children:e.jsxs(t.Box,{$display:"flex",$align:"center",children:[e.jsx(s.P,{$color:"grey-4",$fontSize:14,$lineHeight:20,$mediumBold:!0,$textClampLines:1,children:o.name}),e.jsx(d.Plus,{sx:"margin-left: auto;"})]})},o.id))}),!!D.length&&e.jsx("ul",{style:{padding:0},children:D.map(r=>e.jsxs("li",{style:{listStyleType:"none",display:"flex",alignItems:"center",marginTop:"16px"},children:[e.jsx(h.default,{alt:"",height:64,width:114,src:r.imageSrc,quality:100,style:{borderRadius:"8px",marginRight:"16px"}}),e.jsx(s.P,{sx:"margin-left: 16px;",children:r.name}),!n&&e.jsx(u.Close,{sx:"cursor: pointer; margin-left: auto;",onClick:()=>C({...w,[r.id]:!1})})]},r.id))})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"courses_selection.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/courses_selection/courses_selection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,KAAK,WAAW,GAAG,IAAI,CACrB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAClC,UAAU,GACV,QAAQ,GACR,eAAe,GACf,SAAS,GACT,UAAU,GACV,aAAa,GACb,oBAAoB,GACpB,cAAc,GACd,cAAc,GACd,YAAY,GACZ,aAAa,CAChB,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,qBACf,SAAQ,WAAW,EACjB,KAAK,CAAC,iBAAiB;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CACjC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAC9C,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,gBAAgB,kLAe1B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"courses_selection.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/courses_selection/courses_selection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,KAAK,WAAW,GAAG,IAAI,CACrB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAClC,UAAU,GACV,QAAQ,GACR,eAAe,GACf,SAAS,GACT,UAAU,GACV,aAAa,GACb,oBAAoB,GACpB,cAAc,GACd,cAAc,GACd,YAAY,GACZ,aAAa,CAChB,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,qBACf,SAAQ,WAAW,EACjB,KAAK,CAAC,iBAAiB;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CACjC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAC9C,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,gBAAgB,kLAe1B,qBAAqB,4CAoJvB,CAAC"}
|