@solibo/solibo-ui 2.0.0 → 2.0.2

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,12 +1,12 @@
1
1
  import { jsx as a, jsxs as F, Fragment as V } from "react/jsx-runtime";
2
- import { t as d } from "../../classix-DG18itHa.js";
2
+ import { t as g } from "../../classix-DG18itHa.js";
3
3
  import e from "react";
4
- import '../../assets/index50.css';function g(t) {
4
+ import '../../assets/index50.css';function k(t) {
5
5
  return e.isValidElement(t) && t.type === e.Fragment;
6
6
  }
7
7
  function x(t, n = []) {
8
8
  return e.Children.forEach(t, (s) => {
9
- g(s) ? x(s.props.children, n) : n.push(s);
9
+ k(s) ? x(s.props.children, n) : n.push(s);
10
10
  }), n;
11
11
  }
12
12
  function E(t, {
@@ -21,9 +21,9 @@ function E(t, {
21
21
  }, l);
22
22
  });
23
23
  }
24
- const k = "_controls_1i7ll_1", C = "_horizontal_1i7ll_6", j = "_list_1i7ll_17", v = "_columns_1i7ll_57", L = "_compact_1i7ll_74", o = {
25
- controls: k,
26
- horizontal: C,
24
+ const C = "_controls_1i7ll_1", d = "_horizontal_1i7ll_6", j = "_list_1i7ll_17", v = "_columns_1i7ll_57", L = "_compact_1i7ll_74", o = {
25
+ controls: C,
26
+ horizontal: d,
27
27
  list: j,
28
28
  columns: v,
29
29
  compact: L
@@ -42,7 +42,7 @@ function w({
42
42
  style: z,
43
43
  ...f
44
44
  }) {
45
- const _ = Number.isFinite(s) ? Math.max(1, Math.floor(s)) : 1, p = d(n, o.list, _ > 1 && o.columns, i && o.horizontal, m && o.compact), y = {
45
+ const _ = Number.isFinite(s) ? Math.max(1, Math.floor(s)) : 1, p = g(n, o.list, _ > 1 && o.columns, i && o.horizontal, m && o.compact), y = {
46
46
  ...z,
47
47
  "--list-columns": _
48
48
  }, h = r ? /* @__PURE__ */ a("ol", { className: p, ref: (c) => N(u, c), style: y, ...f, children: E(t) }) : /* @__PURE__ */ a("ul", { className: p, ref: (c) => N(u, c), style: y, ...f, children: E(t) });
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index16.css');const e=require("react/jsx-runtime"),x=require("../../classix-5H4IWnMA.cjs"),j=require("../avatar/index.cjs"),h=require("../icon/index.cjs"),k="_attachments_1tffk_1",w="_message_1tffk_11",S="_timestamp_1tffk_144",b="_preview_1tffk_149",t={attachments:k,"message-group":"_message-group_1tffk_11",message:w,timestamp:S,preview:b},q=({appearance:o="default",attachments:m,author:a,authorColor:r,authorImageUrl:l,authorLink:d,authorRole:g,content:_,iconName:p="Info",id:f,preview:u,timestamp:i,timestampText:v,type:s="default"})=>{const n=i?new Date(i):void 0,c=n?e.jsx("time",{className:t.timestamp,dateTime:n.toISOString(),children:v??n.toLocaleString()}):null;return e.jsxs("div",{className:t["message-group"],"data-message-type":s,"data-component":"message",children:[a&&e.jsx(j.Avatar,{accessibleLabel:a,color:r,imageUrl:l,link:d,name:a,role:g}),s==="system"&&c,e.jsxs("div",{className:x.t(t.message,u&&t.preview),"data-appearance":o,"data-id":f,"data-type":s,children:[s=="system"&&e.jsx(h.Icon,{gap:"right",name:p}),_]}),m&&e.jsx("div",{className:t.attachments,children:m}),s!=="system"&&c]})};exports.Message=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index16.css');const e=require("react/jsx-runtime"),f=require("../../classix-5H4IWnMA.cjs"),h=require("../avatar/index.cjs"),k=require("../icon/index.cjs"),N="_attachments_77ukg_1",w="_footer_77ukg_27",S="_message_77ukg_11",b="_timestamp_77ukg_152",q="_actions_77ukg_157",y="_preview_77ukg_169",s={attachments:N,"message-group":"_message-group_77ukg_11",footer:w,message:S,timestamp:b,actions:q,preview:y},I=({actions:c,appearance:r="default",attachments:i,author:a,authorColor:g,authorImageUrl:l,authorLink:d,authorRole:_,content:u,iconName:p="Info",id:v,preview:x,timestamp:m,timestampText:j,type:t="default"})=>{const n=m?new Date(m):void 0,o=n?e.jsx("time",{className:s.timestamp,dateTime:n.toISOString(),children:j??n.toLocaleString()}):null;return e.jsxs("div",{className:s["message-group"],"data-message-type":t,"data-component":"message",children:[a&&e.jsx(h.Avatar,{accessibleLabel:a,color:g,imageUrl:l,link:d,name:a,role:_}),t==="system"&&o,e.jsxs("div",{className:f.t(s.message,x&&s.preview),"data-appearance":r,"data-id":v,"data-type":t,children:[t=="system"&&e.jsx(k.Icon,{gap:"right",name:p}),u]}),i&&e.jsx("div",{className:s.attachments,children:i}),t!=="system"&&(c?e.jsxs("div",{className:s.footer,children:[o,e.jsx("div",{className:s.actions,"data-message-actions":!0,children:c})]}):o)]})};exports.Message=I;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/message/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport type { IconName } from '@/components/icon';\n\nimport { Avatar, type AvatarColor } from '../avatar';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type MessageOptions = {\n appearance?: 'default' | 'document' | 'file';\n attachments?: React.ReactNode;\n author?: string;\n authorColor?: AvatarColor;\n authorImageUrl?: string;\n authorLink?: string;\n authorRole?: string;\n content: React.ReactNode;\n iconName?: IconName;\n id: string;\n preview?: boolean;\n timestamp?: Date | string;\n timestampText?: React.ReactNode;\n type?: 'default' | 'minimal' | 'system' | 'user';\n};\n\nexport const Message = ({\n appearance = 'default',\n attachments,\n author,\n authorColor,\n authorImageUrl,\n authorLink,\n authorRole,\n content,\n iconName = 'Info',\n id,\n preview,\n timestamp,\n timestampText,\n type = 'default',\n}: MessageOptions) => {\n const date = timestamp ? new Date(timestamp) : undefined;\n const timestampElement = date ? (\n <time\n className={styles.timestamp}\n dateTime={date.toISOString()}\n >\n {timestampText ?? date.toLocaleString()}\n </time>\n ) : null;\n\n return (\n <div\n className={styles['message-group']}\n data-message-type={type}\n >\n {author && (\n <Avatar\n accessibleLabel={author}\n color={authorColor}\n imageUrl={authorImageUrl}\n link={authorLink}\n name={author}\n role={authorRole}\n />\n )}\n {type === 'system' && timestampElement}\n <div\n className={cx(styles.message, preview && styles.preview)}\n data-appearance={appearance}\n data-id={id}\n data-type={type}\n >\n {type == 'system' && (\n <Icon\n gap='right'\n name={iconName}\n />\n )}\n {content}\n </div>\n {attachments && <div className={styles.attachments}>{attachments}</div>}\n {type !== 'system' && timestampElement}\n </div>\n );\n};\n"],"names":["Message","appearance","attachments","author","authorColor","authorImageUrl","authorLink","authorRole","content","iconName","id","preview","timestamp","timestampText","type","date","Date","undefined","timestampElement","jsx","styles","toISOString","toLocaleString","jsxs","Avatar","cx","message","Icon"],"mappings":"wZAyBaA,EAAUA,CAAC,CACtBC,WAAAA,EAAa,UACbC,YAAAA,EACAC,OAAAA,EACAC,YAAAA,EACAC,eAAAA,EACAC,WAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,SAAAA,EAAW,OACXC,GAAAA,EACAC,QAAAA,EACAC,UAAAA,EACAC,cAAAA,EACAC,KAAAA,EAAO,SACO,IAAM,CACpB,MAAMC,EAAOH,EAAY,IAAII,KAAKJ,CAAS,EAAIK,OACzCC,EAAmBH,EACvBI,EAAAA,IAAC,OAAA,CACC,UAAWC,EAAOR,UAClB,SAAUG,EAAKM,cAEdR,SAAAA,GAAiBE,EAAKO,eAAAA,EACzB,EACE,KAEJ,OACEC,OAAC,OACC,UAAWH,EAAO,eAAe,EACjC,oBAAmBN,EAAK,iBAAA,UAEvBX,SAAAA,CAAAA,GACCgB,EAAAA,IAACK,EAAAA,OAAA,CACC,gBAAiBrB,EACjB,MAAOC,EACP,SAAUC,EACV,KAAMC,EACN,KAAMH,EACN,KAAMI,EAAW,EAGpBO,IAAS,UAAYI,EACtBK,EAAAA,KAAC,MAAA,CACC,UAAWE,EAAAA,EAAGL,EAAOM,QAASf,GAAWS,EAAOT,OAAO,EACvD,kBAAiBV,EACjB,UAASS,EACT,YAAWI,EAEVA,SAAAA,CAAAA,GAAQ,UACPK,EAAAA,IAACQ,EAAAA,KAAA,CACC,IAAI,QACJ,KAAMlB,EAAS,EAGlBD,CAAAA,EACH,EACCN,GAAeiB,EAAAA,IAAC,MAAA,CAAI,UAAWC,EAAOlB,YAAcA,SAAAA,EAAY,EAChEY,IAAS,UAAYI,CAAAA,EACxB,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/message/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport type { IconName } from '@/components/icon';\n\nimport { Avatar, type AvatarColor } from '../avatar';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type MessageOptions = {\n /** Controls shown under the message, e.g. a delete button for the author's own message. */\n actions?: React.ReactNode;\n appearance?: 'default' | 'document' | 'file';\n attachments?: React.ReactNode;\n author?: string;\n authorColor?: AvatarColor;\n authorImageUrl?: string;\n authorLink?: string;\n authorRole?: string;\n content: React.ReactNode;\n iconName?: IconName;\n id: string;\n preview?: boolean;\n timestamp?: Date | string;\n timestampText?: React.ReactNode;\n type?: 'default' | 'minimal' | 'system' | 'user';\n};\n\nexport const Message = ({\n actions,\n appearance = 'default',\n attachments,\n author,\n authorColor,\n authorImageUrl,\n authorLink,\n authorRole,\n content,\n iconName = 'Info',\n id,\n preview,\n timestamp,\n timestampText,\n type = 'default',\n}: MessageOptions) => {\n const date = timestamp ? new Date(timestamp) : undefined;\n const timestampElement = date ? (\n <time\n className={styles.timestamp}\n dateTime={date.toISOString()}\n >\n {timestampText ?? date.toLocaleString()}\n </time>\n ) : null;\n\n return (\n <div\n className={styles['message-group']}\n data-message-type={type}\n >\n {author && (\n <Avatar\n accessibleLabel={author}\n color={authorColor}\n imageUrl={authorImageUrl}\n link={authorLink}\n name={author}\n role={authorRole}\n />\n )}\n {type === 'system' && timestampElement}\n <div\n className={cx(styles.message, preview && styles.preview)}\n data-appearance={appearance}\n data-id={id}\n data-type={type}\n >\n {type == 'system' && (\n <Icon\n gap='right'\n name={iconName}\n />\n )}\n {content}\n </div>\n {attachments && <div className={styles.attachments}>{attachments}</div>}\n {type !== 'system' &&\n (actions ? (\n <div className={styles.footer}>\n {timestampElement}\n <div\n className={styles.actions}\n data-message-actions\n >\n {actions}\n </div>\n </div>\n ) : (\n timestampElement\n ))}\n </div>\n );\n};\n"],"names":["Message","actions","appearance","attachments","author","authorColor","authorImageUrl","authorLink","authorRole","content","iconName","id","preview","timestamp","timestampText","type","date","Date","undefined","timestampElement","jsx","styles","toISOString","toLocaleString","jsxs","Avatar","cx","message","Icon","footer"],"mappings":"udA2BaA,EAAUA,CAAC,CACtBC,QAAAA,EACAC,WAAAA,EAAa,UACbC,YAAAA,EACAC,OAAAA,EACAC,YAAAA,EACAC,eAAAA,EACAC,WAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,SAAAA,EAAW,OACXC,GAAAA,EACAC,QAAAA,EACAC,UAAAA,EACAC,cAAAA,EACAC,KAAAA,EAAO,SACO,IAAM,CACpB,MAAMC,EAAOH,EAAY,IAAII,KAAKJ,CAAS,EAAIK,OACzCC,EAAmBH,EACvBI,EAAAA,IAAC,OAAA,CACC,UAAWC,EAAOR,UAClB,SAAUG,EAAKM,cAEdR,SAAAA,GAAiBE,EAAKO,eAAAA,EACzB,EACE,KAEJ,OACEC,OAAC,OACC,UAAWH,EAAO,eAAe,EACjC,oBAAmBN,EAAK,iBAAA,UAEvBX,SAAAA,CAAAA,GACCgB,EAAAA,IAACK,EAAAA,OAAA,CACC,gBAAiBrB,EACjB,MAAOC,EACP,SAAUC,EACV,KAAMC,EACN,KAAMH,EACN,KAAMI,EAAW,EAGpBO,IAAS,UAAYI,EACtBK,EAAAA,KAAC,MAAA,CACC,UAAWE,EAAAA,EAAGL,EAAOM,QAASf,GAAWS,EAAOT,OAAO,EACvD,kBAAiBV,EACjB,UAASS,EACT,YAAWI,EAEVA,SAAAA,CAAAA,GAAQ,UACPK,EAAAA,IAACQ,EAAAA,KAAA,CACC,IAAI,QACJ,KAAMlB,EAAS,EAGlBD,CAAAA,EACH,EACCN,GAAeiB,EAAAA,IAAC,MAAA,CAAI,UAAWC,EAAOlB,YAAcA,SAAAA,EAAY,EAChEY,IAAS,WACPd,SACE,MAAA,CAAI,UAAWoB,EAAOQ,OACpBV,SAAAA,CAAAA,QACA,MAAA,CACC,UAAWE,EAAOpB,QAClB,uBAAoB,GAEnBA,SAAAA,CAAAA,CACH,CAAA,CAAA,CACF,EAEAkB,EAAAA,EAEN,CAEJ"}
@@ -1,42 +1,48 @@
1
- import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
- import { t as u } from "../../classix-DG18itHa.js";
1
+ import { jsx as a, jsxs as i } from "react/jsx-runtime";
2
+ import { t as N } from "../../classix-DG18itHa.js";
3
3
  import { Avatar as w } from "../avatar/index.js";
4
- import { Icon as N } from "../icon/index.js";
5
- import '../../assets/index16.css';const x = "_attachments_1tffk_1", I = "_message_1tffk_11", S = "_timestamp_1tffk_144", b = "_preview_1tffk_149", s = {
6
- attachments: x,
7
- "message-group": "_message-group_1tffk_11",
8
- message: I,
9
- timestamp: S,
10
- preview: b
11
- }, D = ({
12
- appearance: c = "default",
13
- attachments: i,
14
- author: a,
4
+ import { Icon as x } from "../icon/index.js";
5
+ import '../../assets/index16.css';const I = "_attachments_77ukg_1", S = "_footer_77ukg_27", b = "_message_77ukg_11", j = "_timestamp_77ukg_152", y = "_actions_77ukg_157", L = "_preview_77ukg_169", e = {
6
+ attachments: I,
7
+ "message-group": "_message-group_77ukg_11",
8
+ footer: S,
9
+ message: b,
10
+ timestamp: j,
11
+ actions: y,
12
+ preview: L
13
+ }, O = ({
14
+ actions: n,
15
+ appearance: g = "default",
16
+ attachments: c,
17
+ author: t,
15
18
  authorColor: l,
16
19
  authorImageUrl: d,
17
- authorLink: g,
20
+ authorLink: _,
18
21
  authorRole: p,
19
- content: f,
20
- iconName: _ = "Info",
22
+ content: u,
23
+ iconName: f = "Info",
21
24
  id: v,
22
25
  preview: h,
23
- timestamp: n,
26
+ timestamp: r,
24
27
  timestampText: k,
25
- type: e = "default"
28
+ type: s = "default"
26
29
  }) => {
27
- const m = n ? new Date(n) : void 0, o = m ? /* @__PURE__ */ t("time", { className: s.timestamp, dateTime: m.toISOString(), children: k ?? m.toLocaleString() }) : null;
28
- return /* @__PURE__ */ r("div", { className: s["message-group"], "data-message-type": e, "data-component": "message", children: [
29
- a && /* @__PURE__ */ t(w, { accessibleLabel: a, color: l, imageUrl: d, link: g, name: a, role: p }),
30
- e === "system" && o,
31
- /* @__PURE__ */ r("div", { className: u(s.message, h && s.preview), "data-appearance": c, "data-id": v, "data-type": e, children: [
32
- e == "system" && /* @__PURE__ */ t(N, { gap: "right", name: _ }),
33
- f
30
+ const m = r ? new Date(r) : void 0, o = m ? /* @__PURE__ */ a("time", { className: e.timestamp, dateTime: m.toISOString(), children: k ?? m.toLocaleString() }) : null;
31
+ return /* @__PURE__ */ i("div", { className: e["message-group"], "data-message-type": s, "data-component": "message", children: [
32
+ t && /* @__PURE__ */ a(w, { accessibleLabel: t, color: l, imageUrl: d, link: _, name: t, role: p }),
33
+ s === "system" && o,
34
+ /* @__PURE__ */ i("div", { className: N(e.message, h && e.preview), "data-appearance": g, "data-id": v, "data-type": s, children: [
35
+ s == "system" && /* @__PURE__ */ a(x, { gap: "right", name: f }),
36
+ u
34
37
  ] }),
35
- i && /* @__PURE__ */ t("div", { className: s.attachments, children: i }),
36
- e !== "system" && o
38
+ c && /* @__PURE__ */ a("div", { className: e.attachments, children: c }),
39
+ s !== "system" && (n ? /* @__PURE__ */ i("div", { className: e.footer, children: [
40
+ o,
41
+ /* @__PURE__ */ a("div", { className: e.actions, "data-message-actions": !0, children: n })
42
+ ] }) : o)
37
43
  ] });
38
44
  };
39
45
  export {
40
- D as Message
46
+ O as Message
41
47
  };
42
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/message/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport type { IconName } from '@/components/icon';\n\nimport { Avatar, type AvatarColor } from '../avatar';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type MessageOptions = {\n appearance?: 'default' | 'document' | 'file';\n attachments?: React.ReactNode;\n author?: string;\n authorColor?: AvatarColor;\n authorImageUrl?: string;\n authorLink?: string;\n authorRole?: string;\n content: React.ReactNode;\n iconName?: IconName;\n id: string;\n preview?: boolean;\n timestamp?: Date | string;\n timestampText?: React.ReactNode;\n type?: 'default' | 'minimal' | 'system' | 'user';\n};\n\nexport const Message = ({\n appearance = 'default',\n attachments,\n author,\n authorColor,\n authorImageUrl,\n authorLink,\n authorRole,\n content,\n iconName = 'Info',\n id,\n preview,\n timestamp,\n timestampText,\n type = 'default',\n}: MessageOptions) => {\n const date = timestamp ? new Date(timestamp) : undefined;\n const timestampElement = date ? (\n <time\n className={styles.timestamp}\n dateTime={date.toISOString()}\n >\n {timestampText ?? date.toLocaleString()}\n </time>\n ) : null;\n\n return (\n <div\n className={styles['message-group']}\n data-message-type={type}\n >\n {author && (\n <Avatar\n accessibleLabel={author}\n color={authorColor}\n imageUrl={authorImageUrl}\n link={authorLink}\n name={author}\n role={authorRole}\n />\n )}\n {type === 'system' && timestampElement}\n <div\n className={cx(styles.message, preview && styles.preview)}\n data-appearance={appearance}\n data-id={id}\n data-type={type}\n >\n {type == 'system' && (\n <Icon\n gap='right'\n name={iconName}\n />\n )}\n {content}\n </div>\n {attachments && <div className={styles.attachments}>{attachments}</div>}\n {type !== 'system' && timestampElement}\n </div>\n );\n};\n"],"names":["Message","appearance","attachments","author","authorColor","authorImageUrl","authorLink","authorRole","content","iconName","id","preview","timestamp","timestampText","type","date","Date","undefined","timestampElement","jsx","styles","toISOString","toLocaleString","jsxs","Avatar","cx","message","Icon"],"mappings":";;;;;;;;;;GAyBaA,IAAUA,CAAC;AAAA,EACtBC,YAAAA,IAAa;AAAA,EACbC,aAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,IAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAC,MAAAA,IAAO;AACO,MAAM;AACpB,QAAMC,IAAOH,IAAY,IAAII,KAAKJ,CAAS,IAAIK,QACzCC,IAAmBH,IACvB,gBAAAI,EAAC,QAAA,EACC,WAAWC,EAAOR,WAClB,UAAUG,EAAKM,eAEdR,UAAAA,KAAiBE,EAAKO,eAAAA,GACzB,IACE;AAEJ,SACE,gBAAAC,EAAC,SACC,WAAWH,EAAO,eAAe,GACjC,qBAAmBN,GAAK,kBAAA,WAEvBX,UAAAA;AAAAA,IAAAA,KACC,gBAAAgB,EAACK,GAAA,EACC,iBAAiBrB,GACjB,OAAOC,GACP,UAAUC,GACV,MAAMC,GACN,MAAMH,GACN,MAAMI,GAAW;AAAA,IAGpBO,MAAS,YAAYI;AAAAA,IACtB,gBAAAK,EAAC,OAAA,EACC,WAAWE,EAAGL,EAAOM,SAASf,KAAWS,EAAOT,OAAO,GACvD,mBAAiBV,GACjB,WAASS,GACT,aAAWI,GAEVA,UAAAA;AAAAA,MAAAA,KAAQ,YACP,gBAAAK,EAACQ,GAAA,EACC,KAAI,SACJ,MAAMlB,GAAS;AAAA,MAGlBD;AAAAA,IAAAA,GACH;AAAA,IACCN,KAAe,gBAAAiB,EAAC,OAAA,EAAI,WAAWC,EAAOlB,aAAcA,UAAAA,GAAY;AAAA,IAChEY,MAAS,YAAYI;AAAAA,EAAAA,GACxB;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/message/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport type { IconName } from '@/components/icon';\n\nimport { Avatar, type AvatarColor } from '../avatar';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type MessageOptions = {\n /** Controls shown under the message, e.g. a delete button for the author's own message. */\n actions?: React.ReactNode;\n appearance?: 'default' | 'document' | 'file';\n attachments?: React.ReactNode;\n author?: string;\n authorColor?: AvatarColor;\n authorImageUrl?: string;\n authorLink?: string;\n authorRole?: string;\n content: React.ReactNode;\n iconName?: IconName;\n id: string;\n preview?: boolean;\n timestamp?: Date | string;\n timestampText?: React.ReactNode;\n type?: 'default' | 'minimal' | 'system' | 'user';\n};\n\nexport const Message = ({\n actions,\n appearance = 'default',\n attachments,\n author,\n authorColor,\n authorImageUrl,\n authorLink,\n authorRole,\n content,\n iconName = 'Info',\n id,\n preview,\n timestamp,\n timestampText,\n type = 'default',\n}: MessageOptions) => {\n const date = timestamp ? new Date(timestamp) : undefined;\n const timestampElement = date ? (\n <time\n className={styles.timestamp}\n dateTime={date.toISOString()}\n >\n {timestampText ?? date.toLocaleString()}\n </time>\n ) : null;\n\n return (\n <div\n className={styles['message-group']}\n data-message-type={type}\n >\n {author && (\n <Avatar\n accessibleLabel={author}\n color={authorColor}\n imageUrl={authorImageUrl}\n link={authorLink}\n name={author}\n role={authorRole}\n />\n )}\n {type === 'system' && timestampElement}\n <div\n className={cx(styles.message, preview && styles.preview)}\n data-appearance={appearance}\n data-id={id}\n data-type={type}\n >\n {type == 'system' && (\n <Icon\n gap='right'\n name={iconName}\n />\n )}\n {content}\n </div>\n {attachments && <div className={styles.attachments}>{attachments}</div>}\n {type !== 'system' &&\n (actions ? (\n <div className={styles.footer}>\n {timestampElement}\n <div\n className={styles.actions}\n data-message-actions\n >\n {actions}\n </div>\n </div>\n ) : (\n timestampElement\n ))}\n </div>\n );\n};\n"],"names":["Message","actions","appearance","attachments","author","authorColor","authorImageUrl","authorLink","authorRole","content","iconName","id","preview","timestamp","timestampText","type","date","Date","undefined","timestampElement","jsx","styles","toISOString","toLocaleString","jsxs","Avatar","cx","message","Icon","footer"],"mappings":";;;;;;;;;;;;GA2BaA,IAAUA,CAAC;AAAA,EACtBC,SAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,aAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,IAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAC,MAAAA,IAAO;AACO,MAAM;AACpB,QAAMC,IAAOH,IAAY,IAAII,KAAKJ,CAAS,IAAIK,QACzCC,IAAmBH,IACvB,gBAAAI,EAAC,QAAA,EACC,WAAWC,EAAOR,WAClB,UAAUG,EAAKM,eAEdR,UAAAA,KAAiBE,EAAKO,eAAAA,GACzB,IACE;AAEJ,SACE,gBAAAC,EAAC,SACC,WAAWH,EAAO,eAAe,GACjC,qBAAmBN,GAAK,kBAAA,WAEvBX,UAAAA;AAAAA,IAAAA,KACC,gBAAAgB,EAACK,GAAA,EACC,iBAAiBrB,GACjB,OAAOC,GACP,UAAUC,GACV,MAAMC,GACN,MAAMH,GACN,MAAMI,GAAW;AAAA,IAGpBO,MAAS,YAAYI;AAAAA,IACtB,gBAAAK,EAAC,OAAA,EACC,WAAWE,EAAGL,EAAOM,SAASf,KAAWS,EAAOT,OAAO,GACvD,mBAAiBV,GACjB,WAASS,GACT,aAAWI,GAEVA,UAAAA;AAAAA,MAAAA,KAAQ,YACP,gBAAAK,EAACQ,GAAA,EACC,KAAI,SACJ,MAAMlB,GAAS;AAAA,MAGlBD;AAAAA,IAAAA,GACH;AAAA,IACCN,KAAe,gBAAAiB,EAAC,OAAA,EAAI,WAAWC,EAAOlB,aAAcA,UAAAA,GAAY;AAAA,IAChEY,MAAS,aACPd,sBACE,OAAA,EAAI,WAAWoB,EAAOQ,QACpBV,UAAAA;AAAAA,MAAAA;AAAAA,wBACA,OAAA,EACC,WAAWE,EAAOpB,SAClB,wBAAoB,IAEnBA,UAAAA,EAAAA,CACH;AAAA,IAAA,EAAA,CACF,IAEAkB;AAAAA,EAAAA,GAEN;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index13.css');const l=require("react/jsx-runtime"),r=require("../../classix-5H4IWnMA.cjs"),u=require("react"),b=require("../../icons-Dv_p0bUF.cjs"),m="_nav_xrgjg_3",v="_label_xrgjg_9",p="_item_xrgjg_17",x="_actions_xrgjg_36",j="_highlighted_xrgjg_60",f="_horizontal_xrgjg_64",N="_sidebar_xrgjg_74",w="_tabs_xrgjg_117",q="_pills_xrgjg_137",t={nav:m,label:v,item:p,actions:x,highlighted:j,horizontal:f,sidebar:N,tabs:w,pills:q},y={default:t.default,pills:t.pills,sidebar:t.sidebar,tabs:t.tabs},z=({className:a,...e})=>l.jsx("span",{className:r.t(a,t.label),...e,"data-component":"navlabel"}),S=({actions:a,children:e,className:o,highlighted:n=!1,...s})=>l.jsxs("div",{className:r.t(t.item,n&&t.highlighted,o),"data-nav-item":!0,...s,"data-component":"navitem",children:[e,a&&l.jsx("span",{className:t.actions,children:a})]}),C=({animation:a,children:e,className:o,horizontal:n=!1,variant:s="default",...g})=>{const[d,c]=u.useState(!1),_={"--icon-svg":b.iconSVG("CaretDown")};return l.jsx("nav",{className:r.t(o,n&&t.horizontal,t.nav,y[s]),"data-animation":a,"data-open":d?"true":"false","data-orientation":n?"horizontal":"vertical",onBlurCapture:i=>{if(s!=="pills"||window.innerWidth>960)return;const h=i.relatedTarget;i.currentTarget.contains(h)||c(!1)},onClick:()=>{s!=="pills"||window.innerWidth>960||c(i=>!i)},style:_,...g,"data-component":"nav",children:e})};exports.Nav=C;exports.NavItem=S;exports.NavLabel=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index13.css');const i=require("react/jsx-runtime"),r=require("../../classix-5H4IWnMA.cjs"),b=require("react"),m=require("../../icons-Dv_p0bUF.cjs"),v="_nav_rztyo_3",p="_label_rztyo_9",g="_item_rztyo_17",y="_actions_rztyo_36",z="_highlighted_rztyo_60",f="_horizontal_rztyo_64",N="_sidebar_rztyo_74",x="_tabs_rztyo_131",j="_pills_rztyo_151",t={nav:v,label:p,item:g,actions:y,highlighted:z,horizontal:f,sidebar:N,tabs:x,pills:j},w={default:t.default,pills:t.pills,sidebar:t.sidebar,tabs:t.tabs},q=({className:a,...e})=>i.jsx("span",{className:r.t(a,t.label),...e,"data-component":"navlabel"}),S=({actions:a,children:e,className:l,highlighted:n=!1,...s})=>i.jsxs("div",{className:r.t(t.item,n&&t.highlighted,l),"data-nav-item":!0,...s,"data-component":"navitem",children:[e,a&&i.jsx("span",{className:t.actions,children:a})]}),C=({animation:a,children:e,className:l,horizontal:n=!1,variant:s="default",...d})=>{const[_,c]=b.useState(!1),h={"--icon-svg":m.iconSVG("CaretDown")};return i.jsx("nav",{className:r.t(l,n&&t.horizontal,t.nav,w[s]),"data-animation":a,"data-open":_?"true":"false","data-orientation":n?"horizontal":"vertical",onBlurCapture:o=>{if(s!=="pills"||window.innerWidth>960)return;const u=o.relatedTarget;o.currentTarget.contains(u)||c(!1)},onClick:()=>{s!=="pills"||window.innerWidth>960||c(o=>!o)},style:h,...d,"data-component":"nav",children:e})};exports.Nav=C;exports.NavItem=S;exports.NavLabel=q;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,18 +1,18 @@
1
- import { jsx as l, jsxs as h } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as p } from "react/jsx-runtime";
2
2
  import { t as r } from "../../classix-DG18itHa.js";
3
- import { useState as p } from "react";
4
- import { i as b } from "../../icons-dUP7sKyt.js";
5
- import '../../assets/index13.css';const f = "_nav_xrgjg_3", v = "_label_xrgjg_9", x = "_item_xrgjg_17", u = "_actions_xrgjg_36", j = "_highlighted_xrgjg_60", N = "_horizontal_xrgjg_64", w = "_sidebar_xrgjg_74", z = "_tabs_xrgjg_117", C = "_pills_xrgjg_137", t = {
6
- nav: f,
7
- label: v,
8
- item: x,
9
- actions: u,
10
- highlighted: j,
3
+ import { useState as b } from "react";
4
+ import { i as f } from "../../icons-dUP7sKyt.js";
5
+ import '../../assets/index13.css';const v = "_nav_rztyo_3", z = "_label_rztyo_9", u = "_item_rztyo_17", g = "_actions_rztyo_36", y = "_highlighted_rztyo_60", N = "_horizontal_rztyo_64", w = "_sidebar_rztyo_74", x = "_tabs_rztyo_131", C = "_pills_rztyo_151", t = {
6
+ nav: v,
7
+ label: z,
8
+ item: u,
9
+ actions: g,
10
+ highlighted: y,
11
11
  horizontal: N,
12
12
  sidebar: w,
13
- tabs: z,
13
+ tabs: x,
14
14
  pills: C
15
- }, y = {
15
+ }, j = {
16
16
  default: t.default,
17
17
  pills: t.pills,
18
18
  sidebar: t.sidebar,
@@ -23,30 +23,30 @@ import '../../assets/index13.css';const f = "_nav_xrgjg_3", v = "_label_xrgjg_9"
23
23
  }) => /* @__PURE__ */ l("span", { className: r(a, t.label), ...n, "data-component": "navlabel" }), B = ({
24
24
  actions: a,
25
25
  children: n,
26
- className: o,
27
- highlighted: e = !1,
28
- ...s
29
- }) => /* @__PURE__ */ h("div", { className: r(t.item, e && t.highlighted, o), "data-nav-item": !0, ...s, "data-component": "navitem", children: [
26
+ className: i,
27
+ highlighted: s = !1,
28
+ ...o
29
+ }) => /* @__PURE__ */ p("div", { className: r(t.item, s && t.highlighted, i), "data-nav-item": !0, ...o, "data-component": "navitem", children: [
30
30
  n,
31
31
  a && /* @__PURE__ */ l("span", { className: t.actions, children: a })
32
32
  ] }), D = ({
33
33
  animation: a,
34
34
  children: n,
35
- className: o,
36
- horizontal: e = !1,
37
- variant: s = "default",
38
- ...g
35
+ className: i,
36
+ horizontal: s = !1,
37
+ variant: o = "default",
38
+ ...d
39
39
  }) => {
40
- const [d, c] = p(!1), _ = {
41
- "--icon-svg": b("CaretDown")
40
+ const [_, c] = b(!1), m = {
41
+ "--icon-svg": f("CaretDown")
42
42
  };
43
- return /* @__PURE__ */ l("nav", { className: r(o, e && t.horizontal, t.nav, y[s]), "data-animation": a, "data-open": d ? "true" : "false", "data-orientation": e ? "horizontal" : "vertical", onBlurCapture: (i) => {
44
- if (s !== "pills" || window.innerWidth > 960) return;
45
- const m = i.relatedTarget;
46
- i.currentTarget.contains(m) || c(!1);
43
+ return /* @__PURE__ */ l("nav", { className: r(i, s && t.horizontal, t.nav, j[o]), "data-animation": a, "data-open": _ ? "true" : "false", "data-orientation": s ? "horizontal" : "vertical", onBlurCapture: (e) => {
44
+ if (o !== "pills" || window.innerWidth > 960) return;
45
+ const h = e.relatedTarget;
46
+ e.currentTarget.contains(h) || c(!1);
47
47
  }, onClick: () => {
48
- s !== "pills" || window.innerWidth > 960 || c((i) => !i);
49
- }, style: _, ...g, "data-component": "nav", children: n });
48
+ o !== "pills" || window.innerWidth > 960 || c((e) => !e);
49
+ }, style: m, ...d, "data-component": "nav", children: n });
50
50
  };
51
51
  export {
52
52
  D as Nav,
@@ -40,7 +40,7 @@ function ht({
40
40
  onChangeOrder: A,
41
41
  ...S
42
42
  }) {
43
- const y = Number.isFinite(i) ? Math.max(1, Math.floor(i)) : 1, _ = $(() => L.Children.toArray(s), [s]), a = u(-1), N = $(() => typeof window < "u" && (navigator.maxTouchPoints > 0 || window.matchMedia("(pointer: coarse)").matches), []), p = u(!1), C = u(null), w = u(null), x = u(null), I = u(0), E = u(null), m = u(null), M = u((o) => o.preventDefault()).current, [R, V] = q({
43
+ const y = Number.isFinite(i) ? Math.max(1, Math.floor(i)) : 1, C = $(() => L.Children.toArray(s), [s]), a = u(-1), N = $(() => typeof window < "u" && (navigator.maxTouchPoints > 0 || window.matchMedia("(pointer: coarse)").matches), []), p = u(!1), I = u(null), w = u(null), x = u(null), _ = u(0), E = u(null), m = u(null), M = u((o) => o.preventDefault()).current, [R, V] = q({
44
44
  borderRadius: "0px",
45
45
  height: 0,
46
46
  width: 0,
@@ -51,8 +51,8 @@ function ht({
51
51
  "--sortable-placeholder-radius": R.borderRadius,
52
52
  "--sortable-placeholder-width": `${R.width}px`
53
53
  }, H = (o, t) => {
54
- if (t < 0 || t >= _.length || o === t) return;
55
- const c = _.slice(), [e] = c.splice(o, 1);
54
+ if (t < 0 || t >= C.length || o === t) return;
55
+ const c = C.slice(), [e] = c.splice(o, 1);
56
56
  c.splice(t, 0, e), A(c.map((n, r) => ({
57
57
  id: String(L.isValidElement(n) ? n.props["data-id"] ?? `idx-${r}` : `idx-${r}`),
58
58
  weight: c.length - 1 - r
@@ -72,7 +72,7 @@ function ht({
72
72
  }
73
73
  return document.scrollingElement instanceof HTMLElement ? document.scrollingElement : null;
74
74
  }, P = (o = !1) => {
75
- T(), B(), window.removeEventListener("touchmove", M), E.current = null, p.current = !1, C.current = null, x.current = null, I.current = o ? Date.now() + 500 : 0, a.current = -1, D(null);
75
+ T(), B(), window.removeEventListener("touchmove", M), E.current = null, p.current = !1, I.current = null, x.current = null, _.current = o ? Date.now() + 500 : 0, a.current = -1, D(null);
76
76
  }, Y = (o, t) => {
77
77
  a.current = o, V(lt(t)), D(o);
78
78
  }, G = (o) => o instanceof Element && !!o.closest('button, a, input, textarea, select, option, [role="button"], [contenteditable="true"]'), z = (o, t, c) => {
@@ -85,7 +85,7 @@ function ht({
85
85
  const c = (n = document.elementFromPoint(o, t)) == null ? void 0 : n.closest("[data-sortable-index]");
86
86
  if (!c) return;
87
87
  const e = z(c, Number(c.dataset.sortableIndex), t);
88
- e !== null && (C.current = e, D(e));
88
+ e !== null && (I.current = e, D(e));
89
89
  }, J = (o) => {
90
90
  const t = Z(o);
91
91
  if (!t) return;
@@ -122,15 +122,15 @@ function ht({
122
122
  };
123
123
  return Q(() => () => {
124
124
  T(), B(), window.removeEventListener("touchmove", M);
125
- }, [M]), /* @__PURE__ */ j(et, { className: W(v, b.sortable, y > 1 && b.columns), columns: i, ordered: !0, style: O, ...S, "data-component": "sortable", children: _.map((o, t) => {
125
+ }, [M]), /* @__PURE__ */ j(et, { className: W(v, b.sortable, y > 1 && b.columns), columns: i, ordered: !0, style: O, ...S, "data-component": "sortable", children: C.map((o, t) => {
126
126
  const c = L.isValidElement(o) ? o.key : null;
127
127
  return /* @__PURE__ */ j("li", { "data-sortable-index": t, onClickCapture: (e) => {
128
- I.current <= Date.now() || (e.preventDefault(), e.stopPropagation(), I.current = 0);
128
+ _.current <= Date.now() || (e.preventDefault(), e.stopPropagation(), _.current = 0);
129
129
  }, className: W(g !== null && g > t - 10 && g < t + 10 && b.pseudo, g === t && a.current < t && b["target-below"], g === t && a.current > t && b["target-above"], a.current === t && b.dragging), onContextMenu: (e) => {
130
130
  (p.current || w.current !== null) && e.preventDefault();
131
131
  }, onTouchStart: (e) => {
132
132
  if (l || G(e.target)) return;
133
- I.current = 0;
133
+ _.current = 0;
134
134
  const n = e.touches[0];
135
135
  if (!n) return;
136
136
  const r = e.currentTarget;
@@ -138,7 +138,7 @@ function ht({
138
138
  x: n.clientX,
139
139
  y: n.clientY
140
140
  }, T(), w.current = setTimeout(() => {
141
- Y(t, r), p.current = !0, C.current = t, E.current = {
141
+ Y(t, r), p.current = !0, I.current = t, E.current = {
142
142
  x: n.clientX,
143
143
  y: n.clientY
144
144
  }, window.addEventListener("touchmove", M, {
@@ -165,7 +165,7 @@ function ht({
165
165
  return;
166
166
  }
167
167
  e.preventDefault();
168
- const n = a.current, r = C.current;
168
+ const n = a.current, r = I.current;
169
169
  n >= 0 && r !== null && n !== r && H(n, r), P(!0);
170
170
  }, onTouchCancel: () => P(), draggable: !l && !N, onDragEnd: () => k(), onDragOver: (e) => {
171
171
  e.preventDefault(), e.dataTransfer.dropEffect = "move";
@@ -182,7 +182,7 @@ function ht({
182
182
  const n = a.current, r = g;
183
183
  n < 0 || r === null || n === r || (H(n, r), k());
184
184
  }, "data-component": "sortable", children: /* @__PURE__ */ j(U.Provider, { value: {
185
- canMoveDown: t < _.length - 1,
185
+ canMoveDown: t < C.length - 1,
186
186
  canMoveUp: t > 0,
187
187
  index: t,
188
188
  moveDown: () => H(t, t + 1),
package/dist/index.d.ts CHANGED
@@ -649,11 +649,13 @@ declare type MenuSharedProps = {
649
649
  onItemSelect?: (item: MenuItem) => void;
650
650
  };
651
651
 
652
- export declare const Message: ({ appearance, attachments, author, authorColor, authorImageUrl, authorLink, authorRole, content, iconName, id, preview, timestamp, timestampText, type, }: MessageOptions) => JSX.Element;
652
+ export declare const Message: ({ actions, appearance, attachments, author, authorColor, authorImageUrl, authorLink, authorRole, content, iconName, id, preview, timestamp, timestampText, type, }: MessageOptions) => JSX.Element;
653
653
 
654
654
  declare type MessageItem = MessageOptions;
655
655
 
656
656
  export declare type MessageOptions = {
657
+ /** Controls shown under the message, e.g. a delete button for the author's own message. */
658
+ actions?: React.ReactNode;
657
659
  appearance?: 'default' | 'document' | 'file';
658
660
  attachments?: React.ReactNode;
659
661
  author?: string;
package/dist/tokens.json CHANGED
@@ -363,7 +363,7 @@
363
363
  },
364
364
  "com.solibo": {
365
365
  "packageName": "@solibo/solibo-ui",
366
- "packageVersion": "2.0.0"
366
+ "packageVersion": "2.0.2"
367
367
  }
368
368
  },
369
369
  "$name": "TEST Solibo UI Tokens (Copy)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solibo/solibo-ui",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "pnpm run tokens:build && vite build --watch",
@@ -42,13 +42,13 @@
42
42
  "dist"
43
43
  ],
44
44
  "dependencies": {
45
- "@lexical/html": "^0.21.0",
46
- "@lexical/link": "^0.21.0",
47
- "@lexical/list": "^0.21.0",
48
- "@lexical/react": "^0.21.0",
49
- "@lexical/utils": "^0.21.0",
45
+ "@lexical/html": "0.52.0",
46
+ "@lexical/link": "0.52.0",
47
+ "@lexical/list": "0.52.0",
48
+ "@lexical/react": "0.52.0",
49
+ "@lexical/utils": "0.52.0",
50
50
  "classix": "^2.2.8",
51
- "lexical": "^0.21.0",
51
+ "lexical": "0.52.0",
52
52
  "sanitize-html": "^2.17.1"
53
53
  },
54
54
  "devDependencies": {