@useloops/design-system 1.4.704 → 1.4.705
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/systems/WebCore/RankItem/RankItem.js +1 -1
- package/dist/esm/systems/WebCore/SortableList/SortableList.js +1 -1
- package/dist/esm/systems/WebCore/SortableList/components/SortableItem/SortableItem.js +1 -1
- package/dist/systems/WebCore/RankItem/RankItem.js +1 -1
- package/dist/systems/WebCore/SortableList/SortableList.js +1 -1
- package/dist/systems/WebCore/SortableList/components/SortableItem/SortableItem.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{DragHandle as i}from"@mui/icons-material";import{useTheme as r,Stack as o,Box as l,typographyClasses as n,selectClasses as a}from"@mui/material";import{useSortableItemContext as s}from"../SortableList/components/SortableItem/SortableItem.js";import{useBreakpoint as m}from"../../../utils/breakpoint.hook.js";import"react";import{iconSizeMap as c}from"../../BrandCore/Icon/Icon.js";import{space as d,base as p}from"../../BrandCore/primitiveVariables.js";import"../SelectItem/SelectItem.js";import f from"../Select/Select.js";import g from"./RankItemContainer.js";import
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{DragHandle as i}from"@mui/icons-material";import{useTheme as r,Stack as o,Box as l,typographyClasses as n,selectClasses as a}from"@mui/material";import{useSortableItemContext as s}from"../SortableList/components/SortableItem/SortableItem.js";import{useBreakpoint as m}from"../../../utils/breakpoint.hook.js";import"react";import{iconSizeMap as c}from"../../BrandCore/Icon/Icon.js";import{space as d,base as p}from"../../BrandCore/primitiveVariables.js";import"../SelectItem/SelectItem.js";import f from"../Select/Select.js";import g from"./RankItemContainer.js";import h from"./RankItemLabel.js";const u=({label:u="Placeholder",disabled:b,onChange:x,options:I,fullWidth:j,sizing:v="lg"})=>{const S=r(),w=I.map(e=>e.label).indexOf(u),C=m(),{touchListeners:k,ref:y}=s();return e(g,{disabled:b,fullWidth:j,sizing:v,children:t(o,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"center",position:"relative",zIndex:1},children:[t(l,{sx:{display:"flex",alignItems:"center","& svg":{fill:S.custom.palette.icon.secondary}},children:[e(l,{ref:y,...k,sx:{display:"flex",alignItems:"center",cursor:"grab",touchAction:"none"},children:e(i,{"aria-label":"drag-handle",sx:{width:c.lg,height:c.lg,mr:S.custom.padding.sm}})}),e(h,{align:"left",disabled:b,children:u})]}),"lg"===v?e(f,{name:"rank",sizing:"sm"===C?"md":"xs",selections:I.map((e,t)=>({label:`${t+1}`,value:`${t}`})),disabled:b,value:`${w}`,onChange:function(e){const t=w,i=Number(e.target.value),r=I;let o=1;const l=r.splice(t,o)[0];o=0,r.splice(i,o,l),x(r)},MenuProps:{anchorOrigin:{vertical:d[400],horizontal:"center"}},sx:{[`&.${a.root}`]:{width:6*p,textAlign:"center"},[`& .${n.root}`]:{width:"fit-content",overflow:"visible"}}}):void 0]})})};export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useSensors as n,useSensor as r,KeyboardSensor as a,DndContext as
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useSensors as n,useSensor as r,KeyboardSensor as a,DndContext as i,MeasuringStrategy as o,MouseSensor as d,TouchSensor as s}from"@dnd-kit/core";import{sortableKeyboardCoordinates as l,SortableContext as c,horizontalListSortingStrategy as m,verticalListSortingStrategy as f,arrayMove as p}from"@dnd-kit/sortable";import{Stack as u}from"@mui/material";import{useState as v,useMemo as g,Fragment as h}from"react";import{SortableItem as x,DragHandle as b}from"./components/SortableItem/SortableItem.js";import{SortableOverlay as y}from"./components/SortableOverlay/SortableOverlay.js";const S=({nativeEvent:t})=>{let e=t.target;for(;e;){if(e.dataset.noDnd)return!1;e=e.parentElement}return!0};class D extends d{static activators=[{eventName:"onMouseDown",handler:S}]}class I extends s{static activators=[{eventName:"onTouchStart",handler:S}]}function C({items:d,onChange:s,renderItem:x,disabled:b,direction:S}){if(!d)return;const[C,j]=v(null),w=g(()=>d.find(t=>t?.id===C?.id),[C,d]),E=n(r(D,{activationConstraint:{distance:{y:2}}}),r(I,{activationConstraint:{distance:{y:2}}}),r(a,{coordinateGetter:l}));return t(i,{measuring:{droppable:{strategy:o.Always}},sensors:E,onDragStart:({active:t})=>{j(t)},onDragEnd:({active:t,over:e})=>{if(e&&t.id!==e?.id){const n=d.findIndex(({id:e})=>e===t.id),r=d.findIndex(({id:t})=>t===e.id);s(p(d,n,r))}j(null)},onDragCancel:()=>{j(null)},children:[e(c,{items:d,disabled:b,strategy:"horizontal"===S?m:f,children:e(u,{sx:{..."horizontal"===S&&{flexDirection:"row"},display:"flex",m:0,gap:1,padding:0,alignContent:"flex-start"},children:d.map(t=>e(h,{children:x(t)},t.id))})}),e(y,{children:w?x(w,!0,!!C):null})]})}C.Item=x,C.DragHandle=b;export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as r}from"react/jsx-runtime";import{useSortable as i,defaultAnimateLayoutChanges as e}from"@dnd-kit/sortable";import{CSS as o}from"@dnd-kit/utilities";import{
|
|
1
|
+
import{jsx as t,jsxs as r}from"react/jsx-runtime";import{useSortable as i,defaultAnimateLayoutChanges as e}from"@dnd-kit/sortable";import{CSS as o}from"@dnd-kit/utilities";import{Stack as n,Box as s}from"@mui/material";import{createContext as a,useMemo as c,useContext as m}from"react";const d=a({attributes:{},listeners:void 0,touchListeners:void 0,ref(){}}),u=()=>m(d),l=t=>e({...t,wasDragging:!0});function f({children:e,top:a,bottom:m,id:u}){const{attributes:f,isDragging:h,listeners:g,setNodeRef:p,setActivatorNodeRef:v,transform:b,transition:A}=i({id:u,animateLayoutChanges:l}),{onTouchStart:x,...z}=g??{},w=c(()=>({attributes:f,listeners:g,touchListeners:x?{onTouchStart:x}:void 0,ref:v}),[f,g,x,v]),L={opacity:h?.4:void 0,transform:o.Translate.toString(b),transition:A};return t(d.Provider,{value:w,children:r(n,{className:"SortableItem",...f,sx:{position:"relative",...L,width:"100%"},ref:p,children:[a&&a,t(s,{...z,sx:{display:"flex",cursor:"grab"},children:e}),m&&m]})})}function h(){const{attributes:r,touchListeners:i,ref:e}=m(d);return t(s,{...r,...i,ref:e,sx:{cursor:"grab",touchAction:"none"},children:t("svg",{viewBox:"0 0 20 20",width:"12",children:t("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})})})}export{h as DragHandle,f as SortableItem,u as useSortableItemContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),i=require("@mui/icons-material"),r=require("@mui/material"),t=require("../SortableList/components/SortableItem/SortableItem.js"),s=require("../../../utils/breakpoint.hook.js");require("react");var l=require("../../BrandCore/Icon/Icon.js"),a=require("../../BrandCore/primitiveVariables.js");require("../SelectItem/SelectItem.js");var n=require("../Select/Select.js"),o=require("./RankItemContainer.js"),c=require("./RankItemLabel.js");module.exports=({label:
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("@mui/icons-material"),r=require("@mui/material"),t=require("../SortableList/components/SortableItem/SortableItem.js"),s=require("../../../utils/breakpoint.hook.js");require("react");var l=require("../../BrandCore/Icon/Icon.js"),a=require("../../BrandCore/primitiveVariables.js");require("../SelectItem/SelectItem.js");var n=require("../Select/Select.js"),o=require("./RankItemContainer.js"),c=require("./RankItemLabel.js");module.exports=({label:u="Placeholder",disabled:d,onChange:m,options:x,fullWidth:g,sizing:h="lg"})=>{const p=r.useTheme(),b=x.map(e=>e.label).indexOf(u),j=s.useBreakpoint(),{touchListeners:f,ref:v}=t.useSortableItemContext();return e.jsx(o,{disabled:d,fullWidth:g,sizing:h,children:e.jsxs(r.Stack,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"center",position:"relative",zIndex:1},children:[e.jsxs(r.Box,{sx:{display:"flex",alignItems:"center","& svg":{fill:p.custom.palette.icon.secondary}},children:[e.jsx(r.Box,{ref:v,...f,sx:{display:"flex",alignItems:"center",cursor:"grab",touchAction:"none"},children:e.jsx(i.DragHandle,{"aria-label":"drag-handle",sx:{width:l.iconSizeMap.lg,height:l.iconSizeMap.lg,mr:p.custom.padding.sm}})}),e.jsx(c,{align:"left",disabled:d,children:u})]}),"lg"===h?e.jsx(n,{name:"rank",sizing:"sm"===j?"md":"xs",selections:x.map((e,i)=>({label:`${i+1}`,value:`${i}`})),disabled:d,value:`${b}`,onChange:function(e){const i=b,r=Number(e.target.value),t=x;let s=1;const l=t.splice(i,s)[0];s=0,t.splice(r,s,l),m(t)},MenuProps:{anchorOrigin:{vertical:a.space[400],horizontal:"center"}},sx:{[`&.${r.selectClasses.root}`]:{width:6*a.base,textAlign:"center"},[`& .${r.typographyClasses.root}`]:{width:"fit-content",overflow:"visible"}}}):void 0]})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("@dnd-kit/core"),r=require("@dnd-kit/sortable"),n=require("@mui/material"),a=require("react"),i=require("./components/SortableItem/SortableItem.js"),o=require("./components/SortableOverlay/SortableOverlay.js");const s=({nativeEvent:e})=>{let t=e.target;for(;t;){if(t.dataset.noDnd)return!1;t=t.parentElement}return!0};class d extends t.MouseSensor{static activators=[{eventName:"onMouseDown",handler:s}]}class l extends t.TouchSensor{static activators=[{eventName:"onTouchStart",handler:s}]}function c({items:i,onChange:s,renderItem:c,disabled:u,direction:
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@dnd-kit/core"),r=require("@dnd-kit/sortable"),n=require("@mui/material"),a=require("react"),i=require("./components/SortableItem/SortableItem.js"),o=require("./components/SortableOverlay/SortableOverlay.js");const s=({nativeEvent:e})=>{let t=e.target;for(;t;){if(t.dataset.noDnd)return!1;t=t.parentElement}return!0};class d extends t.MouseSensor{static activators=[{eventName:"onMouseDown",handler:s}]}class l extends t.TouchSensor{static activators=[{eventName:"onTouchStart",handler:s}]}function c({items:i,onChange:s,renderItem:c,disabled:u,direction:S}){if(!i)return;const[m,g]=a.useState(null),v=a.useMemo(()=>i.find(e=>e?.id===m?.id),[m,i]),x=t.useSensors(t.useSensor(d,{activationConstraint:{distance:{y:2}}}),t.useSensor(l,{activationConstraint:{distance:{y:2}}}),t.useSensor(t.KeyboardSensor,{coordinateGetter:r.sortableKeyboardCoordinates}));return e.jsxs(t.DndContext,{measuring:{droppable:{strategy:t.MeasuringStrategy.Always}},sensors:x,onDragStart:({active:e})=>{g(e)},onDragEnd:({active:e,over:t})=>{if(t&&e.id!==t?.id){const n=i.findIndex(({id:t})=>t===e.id),a=i.findIndex(({id:e})=>e===t.id);s(r.arrayMove(i,n,a))}g(null)},onDragCancel:()=>{g(null)},children:[e.jsx(r.SortableContext,{items:i,disabled:u,strategy:"horizontal"===S?r.horizontalListSortingStrategy:r.verticalListSortingStrategy,children:e.jsx(n.Stack,{sx:{..."horizontal"===S&&{flexDirection:"row"},display:"flex",m:0,gap:1,padding:0,alignContent:"flex-start"},children:i.map(t=>e.jsx(a.Fragment,{children:c(t)},t.id))})}),e.jsx(o.SortableOverlay,{children:v?c(v,!0,!!m):null})]})}c.Item=i.SortableItem,c.DragHandle=i.DragHandle,module.exports=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var t=require("react/jsx-runtime"),e=require("@dnd-kit/sortable"),r=require("@dnd-kit/utilities"),s=require("@mui/material"),i=require("react");const o=i.createContext({attributes:{},listeners:void 0,touchListeners:void 0,ref(){}}),a=t=>e.defaultAnimateLayoutChanges({...t,wasDragging:!0});exports.DragHandle=function(){const{attributes:e,touchListeners:r,ref:a}=i.useContext(o);return t.jsx(s.Box,{...e,...r,ref:a,sx:{cursor:"grab",touchAction:"none"},children:t.jsx("svg",{viewBox:"0 0 20 20",width:"12",children:t.jsx("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})})})},exports.SortableItem=function({children:n,top:u,bottom:c,id:d}){const{attributes:l,isDragging:x,listeners:m,setNodeRef:h,setActivatorNodeRef:f,transform:g,transition:b}=e.useSortable({id:d,animateLayoutChanges:a}),{onTouchStart:v,...S}=m??{},A=i.useMemo(()=>({attributes:l,listeners:m,touchListeners:v?{onTouchStart:v}:void 0,ref:f}),[l,m,v,f]),p={opacity:x?.4:void 0,transform:r.CSS.Translate.toString(g),transition:b};return t.jsx(o.Provider,{value:A,children:t.jsxs(s.Stack,{className:"SortableItem",...l,sx:{position:"relative",...p,width:"100%"},ref:h,children:[u&&u,t.jsx(s.Box,{...S,sx:{display:"flex",cursor:"grab"},children:n}),c&&c]})})},exports.useSortableItemContext=()=>i.useContext(o);
|