mainstack-design-system 1.11.0 → 1.12.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.
@@ -1016,6 +1016,14 @@ E.g: public:p-20 will apply padding 20px when data-ui-theme="public in html root
1016
1016
  --animate-content-fade-out: content-fade-out 500ms ease-in-out;
1017
1017
  --animate-content-scale-in: content-scale-in 250ms ease-out;
1018
1018
  --animate-content-scale-out: content-scale-out 350ms ease-in;
1019
+ --animate-content-slide-in-left: content-slide-in-left 500ms ease-in-out;
1020
+ --animate-content-slide-in-right: content-slide-in-right 500ms ease-in-out;
1021
+ --animate-content-slide-in-top: content-slide-in-top 500ms ease-in-out;
1022
+ --animate-content-slide-in-bottom: content-slide-in-bottom 500ms ease-in-out;
1023
+ --animate-content-slide-out-left: content-slide-out-left 500ms ease-in-out;
1024
+ --animate-content-slide-out-right: content-slide-out-right 500ms ease-in-out;
1025
+ --animate-content-slide-out-top: content-slide-out-top 500ms ease-in-out;
1026
+ --animate-content-slide-out-bottom: content-slide-out-bottom 500ms ease-in-out;
1019
1027
  --animate-caret-blink: caret-blink 1.25s ease-out infinite;
1020
1028
  @keyframes pulse-wiggle {
1021
1029
  0%,
@@ -1066,6 +1074,70 @@ E.g: public:p-20 will apply padding 20px when data-ui-theme="public in html root
1066
1074
  transform: scale(0.7);
1067
1075
  }
1068
1076
  }
1077
+ @keyframes content-slide-in-left {
1078
+ from {
1079
+ translate: -200% 0%;
1080
+ }
1081
+ to {
1082
+ translate: 0% 0%;
1083
+ }
1084
+ }
1085
+ @keyframes content-slide-in-right {
1086
+ from {
1087
+ translate: 200% 0%;
1088
+ }
1089
+ to {
1090
+ translate: 0% 0%;
1091
+ }
1092
+ }
1093
+ @keyframes content-slide-in-top {
1094
+ from {
1095
+ translate: 0% -200%;
1096
+ }
1097
+ to {
1098
+ translate: 0% 0%;
1099
+ }
1100
+ }
1101
+ @keyframes content-slide-in-bottom {
1102
+ from {
1103
+ translate: 0% 200%;
1104
+ }
1105
+ to {
1106
+ translate: 0% 0%;
1107
+ }
1108
+ }
1109
+ @keyframes content-slide-out-left {
1110
+ from {
1111
+ translate: 0% 0%;
1112
+ }
1113
+ to {
1114
+ translate: -200% 0%;
1115
+ }
1116
+ }
1117
+ @keyframes content-slide-out-right {
1118
+ from {
1119
+ translate: 0% 0%;
1120
+ }
1121
+ to {
1122
+ translate: 200% 0%;
1123
+ }
1124
+ }
1125
+ @keyframes content-slide-out-top {
1126
+ from {
1127
+ translate: 0% 0%;
1128
+ }
1129
+ to {
1130
+ translate: 0% -200%;
1131
+ }
1132
+ }
1133
+ @keyframes content-slide-out-bottom {
1134
+ from {
1135
+ translate: 0% 0%;
1136
+ }
1137
+ to {
1138
+ translate: 0% 200%;
1139
+ }
1140
+ }
1069
1141
  @keyframes caret-blink {
1070
1142
  0% {
1071
1143
  opacity: 1;
package/dist/index.d.ts CHANGED
@@ -5791,6 +5791,9 @@ export declare const MilitaryTechIcon: ({ variant, ...props }: VariableIconProps
5791
5791
  export declare const ModalBody: ForwardRefExoticComponent<Omit<ModalBodyProps, "ref"> & RefAttributes<HTMLDivElement>>;
5792
5792
 
5793
5793
  export declare interface ModalBodyProps extends ComponentPropsWithRef<typeof DialogContent> {
5794
+ layout?: "dialog" | "sidebar";
5795
+ direction?: "left" | "right" | "top" | "bottom" | "center";
5796
+ placement?: "left" | "right" | "top" | "bottom" | "center";
5794
5797
  }
5795
5798
 
5796
5799
  export declare const ModalClose: ForwardRefExoticComponent<Omit<ModalCloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),e=require("./index-HSoR75mY.cjs"),a=require("react"),l=require("./utils-sX9NhwD-.cjs"),i=require("./index-DvzX668K.cjs"),s=a.forwardRef(({children:m,className:t,...o},n)=>d.jsx("div",{className:"mds:fixed mds:w-full mds:h-full mds:flex mds:justify-center mds:top-0 mds:left-0 mds:items-end mds:z-100 mds:md:items-center ",children:d.jsxs(e.DialogContent,{ref:n,"data-slot":"modal-body",className:l.cn("mds:group/Modal-body mds:flex-1 mds:flex mds:will-change-transform mds:max-h-[90dvh] mds:max-w-980 mds:shadow-600 mds:rounded-t-20 mds:overflow-hidden mds:bg-surface-neutral-l1 mds:animate-content-scale-out mds:data-[state=open]:animate-content-scale-in mds:md:rounded-20 mds:md:mx-20 ",t),...o,children:[m,d.jsx(i.VisuallyHidden,{children:d.jsx(e.DialogDescription,{})})]})}));s.displayName="ModalBody";exports.ModalBody=s;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("./index-HSoR75mY.cjs"),r=require("react"),c=require("./utils-sX9NhwD-.cjs"),u=require("./index-DvzX668K.cjs"),a=r.forwardRef(({children:d,className:s,layout:n="dialog",direction:m="center",placement:i="center",...o},l)=>t.jsx("div",{className:"mds:fixed mds:w-full mds:h-full mds:flex mds:justify-center mds:top-0 mds:left-0 mds:items-end mds:z-100 mds:sm:items-center mds:has-data-[placement=left]:sm:justify-start mds:has-data-[placement=right]:sm:justify-end mds:has-data-[placement=top]:sm:items-start mds:has-data-[placement=bottom]:sm:items-end ",children:t.jsxs(e.DialogContent,{ref:l,"data-slot":"modal-body","data-layout":n,"data-direction":m,"data-placement":i,className:c.cn("mds:group/Modal-body mds:flex-1 mds:flex mds:will-change-transform mds:max-h-[90dvh] mds:max-w-980 mds:shadow-600 mds:rounded-t-20 mds:overflow-hidden mds:bg-surface-neutral-l1 mds:sm:rounded-20 mds:sm:m-20 mds:data-[layout=sidebar]:max-w-456 mds:data-[layout=sidebar]:sm:min-h-[95dvh] ","mds:animate-content-slide-out-bottom mds:data-[state=open]:animate-content-slide-in-bottom mds:data-[direction=center]:sm:animate-content-scale-out mds:data-[direction=left]:sm:animate-content-slide-out-left mds:data-[direction=right]:sm:animate-content-slide-out-right mds:data-[direction=top]:sm:animate-content-slide-out-top mds:data-[direction=bottom]:sm:animate-content-slide-out-bottom mds:data-[direction=center]:data-[state=open]:sm:animate-content-scale-in mds:data-[direction=left]:data-[state=open]:sm:animate-content-slide-in-left mds:data-[direction=right]:data-[state=open]:sm:animate-content-slide-in-right mds:data-[direction=top]:data-[state=open]:sm:animate-content-slide-in-top mds:data-[direction=bottom]:data-[state=open]:sm:animate-content-slide-in-bottom",s),...o,children:[d,t.jsx(u.VisuallyHidden,{children:t.jsx(e.DialogDescription,{})})]})}));a.displayName="ModalBody";exports.ModalBody=a;
@@ -1,28 +1,39 @@
1
1
  'use client';
2
- import { jsx as d, jsxs as a } from "react/jsx-runtime";
3
- import { D as t, a as l } from "./index-DDHQjaCF.js";
4
- import { forwardRef as r } from "react";
5
- import { c as n } from "./utils-BuJ7DVbu.js";
6
- import { V as i } from "./index-DJT9m8v7.js";
7
- const f = r(
8
- ({ children: m, className: s, ...e }, o) => /* @__PURE__ */ d("div", { className: "mds:fixed mds:w-full mds:h-full mds:flex mds:justify-center mds:top-0 mds:left-0 mds:items-end mds:z-100 mds:md:items-center ", children: /* @__PURE__ */ a(
9
- t,
2
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
3
+ import { D as l, a as r } from "./index-DDHQjaCF.js";
4
+ import { forwardRef as c } from "react";
5
+ import { c as p } from "./utils-BuJ7DVbu.js";
6
+ import { V as f } from "./index-DJT9m8v7.js";
7
+ const u = c(
8
+ ({
9
+ children: a,
10
+ className: d,
11
+ layout: e = "dialog",
12
+ direction: s = "center",
13
+ placement: m = "center",
14
+ ...o
15
+ }, n) => /* @__PURE__ */ t("div", { className: "mds:fixed mds:w-full mds:h-full mds:flex mds:justify-center mds:top-0 mds:left-0 mds:items-end mds:z-100 mds:sm:items-center mds:has-data-[placement=left]:sm:justify-start mds:has-data-[placement=right]:sm:justify-end mds:has-data-[placement=top]:sm:items-start mds:has-data-[placement=bottom]:sm:items-end ", children: /* @__PURE__ */ i(
16
+ l,
10
17
  {
11
- ref: o,
18
+ ref: n,
12
19
  "data-slot": "modal-body",
13
- className: n(
14
- "mds:group/Modal-body mds:flex-1 mds:flex mds:will-change-transform mds:max-h-[90dvh] mds:max-w-980 mds:shadow-600 mds:rounded-t-20 mds:overflow-hidden mds:bg-surface-neutral-l1 mds:animate-content-scale-out mds:data-[state=open]:animate-content-scale-in mds:md:rounded-20 mds:md:mx-20 ",
15
- s
20
+ "data-layout": e,
21
+ "data-direction": s,
22
+ "data-placement": m,
23
+ className: p(
24
+ "mds:group/Modal-body mds:flex-1 mds:flex mds:will-change-transform mds:max-h-[90dvh] mds:max-w-980 mds:shadow-600 mds:rounded-t-20 mds:overflow-hidden mds:bg-surface-neutral-l1 mds:sm:rounded-20 mds:sm:m-20 mds:data-[layout=sidebar]:max-w-456 mds:data-[layout=sidebar]:sm:min-h-[95dvh] ",
25
+ "mds:animate-content-slide-out-bottom mds:data-[state=open]:animate-content-slide-in-bottom mds:data-[direction=center]:sm:animate-content-scale-out mds:data-[direction=left]:sm:animate-content-slide-out-left mds:data-[direction=right]:sm:animate-content-slide-out-right mds:data-[direction=top]:sm:animate-content-slide-out-top mds:data-[direction=bottom]:sm:animate-content-slide-out-bottom mds:data-[direction=center]:data-[state=open]:sm:animate-content-scale-in mds:data-[direction=left]:data-[state=open]:sm:animate-content-slide-in-left mds:data-[direction=right]:data-[state=open]:sm:animate-content-slide-in-right mds:data-[direction=top]:data-[state=open]:sm:animate-content-slide-in-top mds:data-[direction=bottom]:data-[state=open]:sm:animate-content-slide-in-bottom",
26
+ d
16
27
  ),
17
- ...e,
28
+ ...o,
18
29
  children: [
19
- m,
20
- /* @__PURE__ */ d(i, { children: /* @__PURE__ */ d(l, {}) })
30
+ a,
31
+ /* @__PURE__ */ t(f, { children: /* @__PURE__ */ t(r, {}) })
21
32
  ]
22
33
  }
23
34
  ) })
24
35
  );
25
- f.displayName = "ModalBody";
36
+ u.displayName = "ModalBody";
26
37
  export {
27
- f as ModalBody
38
+ u as ModalBody
28
39
  };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),g=require("./index-C8aODXfJ.cjs"),E=require("./index-4R9KShCu.cjs"),o=require("react"),I=require("./mainstack-design-system588.cjs"),m=require("./mainstack-design-system602.cjs"),x=o.forwardRef(({isDisabled:y,isError:C,isMultiSelect:c=!1,isSuccess:b,children:v,value:d,defaultValue:n,inputReadOnly:h,isCreatableSelect:j,options:l=[],isOptionOpen:q,onOptionOpenChange:P,onValueChange:p,onOptionSelect:R},t)=>{const u=o.useRef(null),[r,A]=o.useState(m.parseSelectOptions(l)),[s,_]=g.useControllableState({prop:d,defaultProp:m.mapDefaultValuesToSelectedOption({isMultiSelect:c,defaultValue:n,options:l}),onChange:p}),[T,a]=o.useState(()=>typeof n=="string"&&r.map.get(n)?.label||""),[S,O]=g.useControllableState({prop:q,defaultProp:!1,onChange:P}),[D,f]=o.useState("idle");return i.jsx(I.SelectContext.Provider,{value:{defaultValue:n,options:r,selectedOption:s,isOptionOpen:S,isDisabled:y,isError:C,isMultiSelect:c,isSuccess:b,inputValue:T,inputReadOnly:h,previousAction:D,isCreatableSelect:j,rootElementRef:u,setOptions:A,setPreviousAction:f,setInputValue:a,setSelectedOption:_,onOptionOpenChange:O,onValueChange:p,onOptionSelect:R},children:i.jsx(E.Popover,{open:S,onOpenChange:e=>{O(e),s&&!Array.isArray(s)&&!e&&(a(r.map.get(s)?.label||""),f("selection"))},children:i.jsx("div",{ref:e=>{u.current=e,typeof t=="function"?t(e):typeof t=="object"&&t?.current&&(t.current=e)},"data-slot":"select-root",children:v})})})});x.displayName="SelectRoot";exports.SelectRoot=x;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),m=require("./index-C8aODXfJ.cjs"),E=require("./index-4R9KShCu.cjs"),o=require("react"),I=require("./mainstack-design-system588.cjs"),y=require("./mainstack-design-system602.cjs"),b=o.forwardRef(({isDisabled:x,isError:C,isMultiSelect:c=!1,isSuccess:d,children:h,value:i,defaultValue:n,inputReadOnly:j,isCreatableSelect:q,options:l=[],isOptionOpen:P,onOptionOpenChange:v,onValueChange:u,onOptionSelect:R},t)=>{const a=o.useRef(null),[s,A]=o.useState(y.parseSelectOptions(l)),[r,_]=m.useControllableState({prop:i,defaultProp:y.mapDefaultValuesToSelectedOption({isMultiSelect:c,defaultValue:n,options:l}),onChange:u}),[T,S]=o.useState(()=>typeof i=="string"?s.map.get(i)?.label||"":typeof n=="string"&&s.map.get(n)?.label||""),[O,f]=m.useControllableState({prop:P,defaultProp:!1,onChange:v}),[D,g]=o.useState("idle");return p.jsx(I.SelectContext.Provider,{value:{defaultValue:n,options:s,selectedOption:r,isOptionOpen:O,isDisabled:x,isError:C,isMultiSelect:c,isSuccess:d,inputValue:T,inputReadOnly:j,previousAction:D,isCreatableSelect:q,rootElementRef:a,setOptions:A,setPreviousAction:g,setInputValue:S,setSelectedOption:_,onOptionOpenChange:f,onValueChange:u,onOptionSelect:R},children:p.jsx(E.Popover,{open:O,onOpenChange:e=>{f(e),r&&!Array.isArray(r)&&!e&&(S(s.map.get(r)?.label||""),g("selection"))},children:p.jsx("div",{ref:e=>{a.current=e,typeof t=="function"?t(e):typeof t=="object"&&t?.current&&(t.current=e)},"data-slot":"select-root",children:h})})})});b.displayName="SelectRoot";exports.SelectRoot=b;
@@ -1,82 +1,82 @@
1
1
  'use client';
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { u as g } from "./index-437EL2iq.js";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { u as y } from "./index-437EL2iq.js";
4
4
  import { P as I } from "./index-RoCFhqzC.js";
5
- import { forwardRef as N, useRef as T, useState as i } from "react";
5
+ import { forwardRef as N, useRef as T, useState as s } from "react";
6
6
  import { SelectContext as k } from "./mainstack-design-system588.js";
7
7
  import { parseSelectOptions as q, mapDefaultValuesToSelectedOption as z } from "./mainstack-design-system602.js";
8
8
  const B = N(
9
9
  ({
10
10
  isDisabled: S,
11
11
  isError: h,
12
- isMultiSelect: s = !1,
13
- isSuccess: v,
14
- children: y,
15
- value: C,
12
+ isMultiSelect: l = !1,
13
+ isSuccess: C,
14
+ children: P,
15
+ value: r,
16
16
  defaultValue: e,
17
- inputReadOnly: P,
18
- isCreatableSelect: b,
19
- options: l = [],
17
+ inputReadOnly: b,
18
+ isCreatableSelect: v,
19
+ options: c = [],
20
20
  isOptionOpen: A,
21
21
  onOptionOpenChange: x,
22
- onValueChange: c,
22
+ onValueChange: a,
23
23
  onOptionSelect: d
24
- }, t) => {
25
- const a = T(null), [p, j] = i(
26
- q(l)
27
- ), [n, R] = g({
28
- prop: C,
24
+ }, o) => {
25
+ const m = T(null), [n, j] = s(
26
+ q(c)
27
+ ), [p, R] = y({
28
+ prop: r,
29
29
  defaultProp: z({
30
- isMultiSelect: s,
30
+ isMultiSelect: l,
31
31
  defaultValue: e,
32
- options: l
32
+ options: c
33
33
  }),
34
- onChange: c
35
- }), [D, m] = i(() => typeof e == "string" && p.map.get(e)?.label || ""), [u, f] = g({
34
+ onChange: a
35
+ }), [D, f] = s(() => typeof r == "string" ? n.map.get(r)?.label || "" : typeof e == "string" && n.map.get(e)?.label || ""), [u, O] = y({
36
36
  prop: A,
37
37
  defaultProp: !1,
38
38
  onChange: x
39
- }), [E, O] = i("idle");
40
- return /* @__PURE__ */ r(
39
+ }), [E, g] = s("idle");
40
+ return /* @__PURE__ */ i(
41
41
  k.Provider,
42
42
  {
43
43
  value: {
44
44
  defaultValue: e,
45
- options: p,
46
- selectedOption: n,
45
+ options: n,
46
+ selectedOption: p,
47
47
  isOptionOpen: u,
48
48
  isDisabled: S,
49
49
  isError: h,
50
- isMultiSelect: s,
51
- isSuccess: v,
50
+ isMultiSelect: l,
51
+ isSuccess: C,
52
52
  inputValue: D,
53
- inputReadOnly: P,
53
+ inputReadOnly: b,
54
54
  previousAction: E,
55
- isCreatableSelect: b,
56
- rootElementRef: a,
55
+ isCreatableSelect: v,
56
+ rootElementRef: m,
57
57
  setOptions: j,
58
- setPreviousAction: O,
59
- setInputValue: m,
58
+ setPreviousAction: g,
59
+ setInputValue: f,
60
60
  setSelectedOption: R,
61
- onOptionOpenChange: f,
62
- onValueChange: c,
61
+ onOptionOpenChange: O,
62
+ onValueChange: a,
63
63
  onOptionSelect: d
64
64
  },
65
- children: /* @__PURE__ */ r(
65
+ children: /* @__PURE__ */ i(
66
66
  I,
67
67
  {
68
68
  open: u,
69
- onOpenChange: (o) => {
70
- f(o), n && !Array.isArray(n) && !o && (m(p.map.get(n)?.label || ""), O("selection"));
69
+ onOpenChange: (t) => {
70
+ O(t), p && !Array.isArray(p) && !t && (f(n.map.get(p)?.label || ""), g("selection"));
71
71
  },
72
- children: /* @__PURE__ */ r(
72
+ children: /* @__PURE__ */ i(
73
73
  "div",
74
74
  {
75
- ref: (o) => {
76
- a.current = o, typeof t == "function" ? t(o) : typeof t == "object" && t?.current && (t.current = o);
75
+ ref: (t) => {
76
+ m.current = t, typeof o == "function" ? o(t) : typeof o == "object" && o?.current && (o.current = t);
77
77
  },
78
78
  "data-slot": "select-root",
79
- children: y
79
+ children: P
80
80
  }
81
81
  )
82
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "type": "module",
5
5
  "main": "./dist/mainstack-design-system.cjs",
6
6
  "module": "./dist/mainstack-design-system.js",