@solibo/solibo-ui 2.3.1 → 2.3.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.
- package/README.md +2 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/components/card/index.cjs +1 -1
- package/dist/components/card/index.js +35 -35
- package/dist/components/file/index.cjs +1 -1
- package/dist/components/file/index.js +42 -37
- package/dist/index.d.ts +4 -1
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,4 +72,5 @@ Published builds expose `@solibo/solibo-ui/tokens.css` and `@solibo/solibo-ui/to
|
|
|
72
72
|
### Contributing
|
|
73
73
|
|
|
74
74
|
- Follow the conventions in `AGENTS.md` and `.github/copilot-instructions.md`.
|
|
75
|
-
- Prefer small, focused PRs with tests
|
|
75
|
+
- Prefer small, focused PRs with regression tests. Add stories for new functionality or when requested.
|
|
76
|
+
- For agent context routing and focused verification, see [Agent workflow](docs/AGENT_WORKFLOW.md).
|
package/dist/assets/index30.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._card_1w6vn_1{background-color:var(--colors-semantic-bg-surface);border-radius:var(--shape-border-radius-radius-lg);box-shadow:var(--shape-box-shadow-xs-position-x) var(--shape-box-shadow-xs-position-y) var(--shape-box-shadow-xs-blur) var(--shape-box-shadow-xs-spread) var(--shape-box-shadow-xs-color);max-width:100%;min-width:0;overflow:hidden!important;padding:var(--shape-spacing-md);position:relative;text-overflow:ellipsis;transition:background-color var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function),box-shadow var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function),width var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function);width:100%}._card_1w6vn_1 section{display:block;flex:1 1 auto;min-width:0;width:100%}._card_1w6vn_1 ._head_1w6vn_28{align-items:center;display:flex;gap:var(--shape-spacing-xs);max-width:100%}._card_1w6vn_1 ._head_1w6vn_28 header{flex:1 1 auto;margin:0;min-width:0}._card_1w6vn_1 ._head_1w6vn_28._center_1w6vn_40{align-items:center}._card_1w6vn_1 ._head_1w6vn_28 :is(h1,h2,h3,h4,h5,h6):first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._card_1w6vn_1 ._content_1w6vn_52>:last-child{margin-bottom:0}._card_1w6vn_1 ._preview_1w6vn_58{align-items:center;color:var(--colors-semantic-content-secondary);display:grid;grid-template-columns:max-content minmax(0,1fr) max-content;max-width:100%;min-width:0;white-space:nowrap;width:100%}._card_1w6vn_1 ._preview-leading_1w6vn_69,._card_1w6vn_1 ._preview-trailing_1w6vn_70{align-items:center;display:inline-flex;flex-wrap:nowrap;max-width:-moz-max-content;max-width:max-content;white-space:nowrap}._card_1w6vn_1 ._preview-leading_1w6vn_69:not(:empty){margin-right:var(--shape-spacing-xs)}._card_1w6vn_1 ._preview-trailing_1w6vn_70:not(:empty){margin-left:var(--shape-spacing-xs)}._card_1w6vn_1 ._preview-trailing_1w6vn_70 time{font-size:var(--typography-font-sizes-caption)}._card_1w6vn_1 ._preview-content_1w6vn_90{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._card_1w6vn_1 ._margin_1w6vn_98{margin-top:var(--shape-spacing-xs)}._card_1w6vn_1:has(select),._card_1w6vn_1:has([data-component=popover]){overflow:visible!important}._card_1w6vn_1 [data-component=list]{min-width:0}._card_1w6vn_1 [data-component=list] li{max-width:100%;min-width:0}._card_1w6vn_1 [data-component=list] li>a{max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._card_1w6vn_1:has([data-component=messages]){padding-block:0}._card_1w6vn_1 [data-component=messages]{border-top:var(--shape-border-width-default) solid var(--colors-semantic-border-default);margin:0 calc(var(--shape-spacing-md) * -1) calc(var(--shape-spacing-md) * -1)}._outlined_1w6vn_134{border:var(--shape-border-width-default) solid var(--colors-semantic-border-default);border-radius:var(--shape-border-radius-radius-md);box-shadow:none}._clickable_1w6vn_140{cursor:pointer}._clickable_1w6vn_140:hover{background-color:var(--colors-semantic-interactive-hover-subtle);box-shadow:var(--shape-box-shadow-sm-position-x) var(--shape-box-shadow-sm-position-y) var(--shape-box-shadow-sm-blur) var(--shape-box-shadow-sm-spread) var(--shape-box-shadow-sm-color)}._muted_1w6vn_151 ._head_1w6vn_28 :is(header,h1,h2,h3,h4,h5,h6){font-weight:var(--font-font-weight-regular)}._muted_1w6vn_151:not(._selected_1w6vn_156){background-color:transparent}._image-top_1w6vn_161{margin-bottom:var(--shape-spacing-md);width:100%}._image-top_1w6vn_161 img{height:var(--shape-image-homepage);-o-object-fit:cover;object-fit:cover}._image-top_1w6vn_161 img,[data-component=croppable]{width:100%}._image-left_1w6vn_176{max-height:calc(8.75 * var(--utils-tokens-unit));max-width:calc(8.75 * var(--utils-tokens-unit));min-height:var(--scale-56);min-width:var(--scale-56)}._image-left_1w6vn_176 img{aspect-ratio:1 / 1}._selected_1w6vn_156,._selected_1w6vn_156:hover{background-color:var(--colors-semantic-interactive-selected);box-shadow:inset 0 0 0 var(--scale-2) var(--colors-semantic-primary-primary-subtle-border)}
|
package/dist/assets/index47.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._download_13q7n_1{color:var(--colors-semantic-content-secondary);text-decoration:none;transition:all var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function)}._download_13q7n_1:hover{background-color:var(--colors-semantic-interactive-hover-subtle)}._download_13q7n_1:active{box-shadow:inset 0 0 0 var(--shape-outline-selected) var(--colors-semantic-primary-primary-subtle-border);transition-duration:0s}._file_13q7n_18{align-items:center;background-color:var(--colors-semantic-bg-surface);border:var(--shape-border-width-default) solid var(--colors-semantic-border-default);border-radius:var(--shape-border-radius-radius-xl);box-shadow:var(--shape-box-shadow-xs-position-x) var(--shape-box-shadow-xs-position-y) var(--shape-box-shadow-xs-blur) var(--shape-box-shadow-xs-spread) var(--shape-box-shadow-xs-color);display:inline-flex;line-height:var(--utils-tokens-unit);max-width:100%;min-width:0}._file_13q7n_18 ._action_13q7n_31,._file_13q7n_18 ._delete_13q7n_32{color:var(--colors-semantic-primary-primary);padding:var(--shape-spacing-xs);transition:background-color var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function) var(--utils-tokens-transition-delay)}._file_13q7n_18 ._action_13q7n_31{align-items:center;background:transparent;border:0;border-radius:var(--utils-tokens-unit);cursor:default;display:inline-flex;flex:1 1 auto;font:inherit;margin:0;max-width:100%;min-width:0;overflow:hidden;text-align:inherit;text-decoration:none}._file_13q7n_18 ._action_13q7n_31[href]:hover,._file_13q7n_18 ._action_13q7n_31[data-actionable=true]:hover,._file_13q7n_18 ._action_13q7n_31[role=document]:hover{cursor:pointer}._file_13q7n_18 ._action_13q7n_31:has(+._download_13q7n_1,+._delete_13q7n_32){border-radius:var(--utils-tokens-unit) 0 0 var(--utils-tokens-unit)}._file_13q7n_18 ._action_13q7n_31:visited{opacity:var(--utils-tokens-opacity-minimal)}._file_13q7n_18>._action_13q7n_31>figure{background:var(--colors-semantic-primary-primary-subtle);border-radius:var(--shape-border-radius-radius-lg);flex:0 0 auto;margin:0 var(--scale-8) 0 0;padding:var(--scale-8)}._file_13q7n_18 ._details_13q7n_78{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}._file_13q7n_18 ._name-line_13q7n_85{display:flex;min-width:0}._file_13q7n_18 ._name_13q7n_85{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._file_13q7n_18 ._extension_13q7n_97{flex:0 0 auto;white-space:nowrap}._file_13q7n_18 ._name_13q7n_85,._file_13q7n_18 ._extension_13q7n_97{border-bottom:solid 1px var(--colors-semantic-primary-primary)}._file_13q7n_18 ._subtitle_13q7n_107{color:var(--colors-semantic-content-tertiary);font-size:var(--typography-font-sizes-body-sm);margin-top:var(--shape-spacing-2xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._file_13q7n_18 ._download_13q7n_1,._file_13q7n_18 ._delete_13q7n_32{border-radius:var(--shape-border-radius-radius-xl);cursor:pointer;flex:0 0 auto;margin-right:var(--shape-spacing-2xs);padding:var(--shape-spacing-md);position:relative}._file_13q7n_18 ._delete_13q7n_32{color:var(--colors-semantic-content-destructive)}._file_13q7n_18 ._delete_13q7n_32:hover{background-color:var(--colors-semantic-interactive-secondary-destructive-hover)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index30.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index30.css');const n=require("react/jsx-runtime"),d=require("classix"),b=require("../badge/index.cjs"),T=require("../checkbox/index.cjs"),g=require("../figure/index.cjs"),k=require("../icon/index.cjs"),y="_card_1w6vn_1",E="_head_1w6vn_28",F="_center_1w6vn_40",I="_content_1w6vn_52",S="_preview_1w6vn_58",$="_margin_1w6vn_98",z="_outlined_1w6vn_134",B="_clickable_1w6vn_140",C="_muted_1w6vn_151",M="_selected_1w6vn_156",e={card:y,head:E,center:F,content:I,preview:S,"preview-leading":"_preview-leading_1w6vn_69","preview-trailing":"_preview-trailing_1w6vn_70","preview-content":"_preview-content_1w6vn_90",margin:$,outlined:z,clickable:B,muted:C,selected:M,"image-top":"_image-top_1w6vn_161","image-left":"_image-left_1w6vn_176"},O=({appearance:w="default",actions:x,badge:o,checkbox:s,className:j,children:u,emphasis:p="default",fullWidth:f=!1,header:_,icon:v,image:a,imagePosition:c="top",onClick:r,onKeyDown:m,preview:l,selected:h=(s==null?void 0:s.checked)??!1,tabIndex:N,variant:i="default",...q})=>n.jsxs("article",{className:d(e.card,w==="outlined"&&e.outlined,p==="muted"&&e.muted,r&&e.clickable,h&&e.selected,j),"data-emphasis":p,"data-minimal":i==="minimal","data-span":f?"all":void 0,...q,onClick:r,onKeyDown:t=>{m==null||m(t),!(t.defaultPrevented||!r)&&t.currentTarget===document.activeElement&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.currentTarget.click())},tabIndex:N??(r?0:-1),"data-component":"card",children:[a&&i!=="minimal"&&c==="top"&&n.jsx(g.Figure,{className:e[`image-${c}`],children:a}),n.jsxs("section",{children:[n.jsxs("div",{className:d(e.head,i==="minimal"&&e.center),children:[s&&n.jsx("span",{onClick:t=>t.stopPropagation(),children:n.jsx(T.Checkbox,{...s})}),a&&i!=="minimal"&&c==="left"&&n.jsx(g.Figure,{className:e[`image-${c}`],children:a}),_,o&&n.jsx(b.Badge,{...o}),v&&n.jsx(k.Icon,{name:v,size:"medium"}),x]}),u&&i!=="minimal"&&n.jsx("div",{className:d(e.content,!!_&&e.margin),children:u}),l&&i!=="minimal"&&n.jsxs("div",{className:d(e.preview,!!_&&e.margin),children:[n.jsx("span",{className:e["preview-leading"],children:l.leading}),n.jsx("span",{className:e["preview-content"],children:l.children}),n.jsx("span",{className:e["preview-trailing"],children:l.trailing})]})]})]});exports.Card=O;
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { jsxs as m, jsx as
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import s from "classix";
|
|
3
3
|
import { Badge as $ } from "../badge/index.js";
|
|
4
4
|
import { Checkbox as k } from "../checkbox/index.js";
|
|
5
|
-
import { Figure as
|
|
5
|
+
import { Figure as f } from "../figure/index.js";
|
|
6
6
|
import { Icon as z } from "../icon/index.js";
|
|
7
|
-
import '../../assets/index30.css';const B = "
|
|
7
|
+
import '../../assets/index30.css';const B = "_card_1w6vn_1", F = "_head_1w6vn_28", q = "_center_1w6vn_40", x = "_content_1w6vn_52", y = "_preview_1w6vn_58", A = "_margin_1w6vn_98", C = "_outlined_1w6vn_134", G = "_clickable_1w6vn_140", H = "_muted_1w6vn_151", J = "_selected_1w6vn_156", e = {
|
|
8
8
|
card: B,
|
|
9
9
|
head: F,
|
|
10
10
|
center: q,
|
|
11
11
|
content: x,
|
|
12
12
|
preview: y,
|
|
13
|
-
"preview-leading": "_preview-
|
|
14
|
-
"preview-trailing": "_preview-
|
|
15
|
-
"preview-content": "_preview-
|
|
13
|
+
"preview-leading": "_preview-leading_1w6vn_69",
|
|
14
|
+
"preview-trailing": "_preview-trailing_1w6vn_70",
|
|
15
|
+
"preview-content": "_preview-content_1w6vn_90",
|
|
16
16
|
margin: A,
|
|
17
17
|
outlined: C,
|
|
18
18
|
clickable: G,
|
|
19
19
|
muted: H,
|
|
20
20
|
selected: J,
|
|
21
|
-
"image-top": "_image-
|
|
22
|
-
"image-left": "_image-
|
|
21
|
+
"image-top": "_image-top_1w6vn_161",
|
|
22
|
+
"image-left": "_image-left_1w6vn_176"
|
|
23
23
|
}, U = ({
|
|
24
|
-
appearance:
|
|
25
|
-
actions:
|
|
26
|
-
badge:
|
|
27
|
-
checkbox:
|
|
28
|
-
className:
|
|
24
|
+
appearance: g = "default",
|
|
25
|
+
actions: N,
|
|
26
|
+
badge: p,
|
|
27
|
+
checkbox: i,
|
|
28
|
+
className: h,
|
|
29
29
|
children: v,
|
|
30
30
|
emphasis: u = "default",
|
|
31
31
|
fullWidth: j = !1,
|
|
32
|
-
header:
|
|
33
|
-
icon:
|
|
34
|
-
image:
|
|
35
|
-
imagePosition:
|
|
32
|
+
header: _,
|
|
33
|
+
icon: w,
|
|
34
|
+
image: l,
|
|
35
|
+
imagePosition: r = "top",
|
|
36
36
|
onClick: c,
|
|
37
|
-
onKeyDown:
|
|
37
|
+
onKeyDown: o,
|
|
38
38
|
preview: d,
|
|
39
|
-
selected: E = (
|
|
39
|
+
selected: E = (i == null ? void 0 : i.checked) ?? !1,
|
|
40
40
|
tabIndex: I,
|
|
41
|
-
variant:
|
|
41
|
+
variant: a = "default",
|
|
42
42
|
...T
|
|
43
|
-
}) => /* @__PURE__ */ m("article", { className: s(e.card,
|
|
44
|
-
|
|
43
|
+
}) => /* @__PURE__ */ m("article", { className: s(e.card, g === "outlined" && e.outlined, u === "muted" && e.muted, c && e.clickable, E && e.selected, h), "data-emphasis": u, "data-minimal": a === "minimal", "data-span": j ? "all" : void 0, ...T, onClick: c, onKeyDown: (t) => {
|
|
44
|
+
o == null || o(t), !(t.defaultPrevented || !c) && t.currentTarget === document.activeElement && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.currentTarget.click());
|
|
45
45
|
}, tabIndex: I ?? (c ? 0 : -1), "data-component": "card", children: [
|
|
46
|
-
|
|
46
|
+
l && a !== "minimal" && r === "top" && /* @__PURE__ */ n(f, { className: e[`image-${r}`], children: l }),
|
|
47
47
|
/* @__PURE__ */ m("section", { children: [
|
|
48
|
-
/* @__PURE__ */ m("div", { className: s(e.head,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
/* @__PURE__ */ m("div", { className: s(e.head, a === "minimal" && e.center), children: [
|
|
49
|
+
i && /* @__PURE__ */ n("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ n(k, { ...i }) }),
|
|
50
|
+
l && a !== "minimal" && r === "left" && /* @__PURE__ */ n(f, { className: e[`image-${r}`], children: l }),
|
|
51
|
+
_,
|
|
52
|
+
p && /* @__PURE__ */ n($, { ...p }),
|
|
53
|
+
w && /* @__PURE__ */ n(z, { name: w, size: "medium" }),
|
|
54
|
+
N
|
|
55
55
|
] }),
|
|
56
|
-
v &&
|
|
57
|
-
d &&
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
56
|
+
v && a !== "minimal" && /* @__PURE__ */ n("div", { className: s(e.content, !!_ && e.margin), children: v }),
|
|
57
|
+
d && a !== "minimal" && /* @__PURE__ */ m("div", { className: s(e.preview, !!_ && e.margin), children: [
|
|
58
|
+
/* @__PURE__ */ n("span", { className: e["preview-leading"], children: d.leading }),
|
|
59
|
+
/* @__PURE__ */ n("span", { className: e["preview-content"], children: d.children }),
|
|
60
|
+
/* @__PURE__ */ n("span", { className: e["preview-trailing"], children: d.trailing })
|
|
61
61
|
] })
|
|
62
62
|
] })
|
|
63
63
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index47.css');const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index47.css');const e=require("react/jsx-runtime"),b=require("../figure/index.cjs"),c=require("../icon/index.cjs"),q=require("../button/index.cjs"),F="_download_13q7n_1",g="_file_13q7n_18",I="_action_13q7n_31",P="_details_13q7n_78",w="_name_13q7n_85",v="_extension_13q7n_97",y="_subtitle_13q7n_107",s={download:F,file:g,action:I,delete:"_delete_13q7n_32",details:P,"name-line":"_name-line_13q7n_85",name:w,extension:v,subtitle:y},D={".doc":"FileDoc",".docx":"FileDoc",".pdf":"FilePdf",".ppt":"FilePpt",".pptx":"FilePpt",".xls":"FileXls",".xlsx":"FileXls"},S=({deleteAccessibleLabel:u,name:n,onClick:i,onDelete:r,ref:h,subtitle:d,target:x,url:_,downloadAccessibleLabel:j,downloadUrl:p})=>{const o=n.lastIndexOf("."),m=o>0&&o<n.length-1,f=m?n.slice(0,o):n,l=m?n.slice(o):"",N=D[l.toLowerCase()]??"FileText",a=e.jsxs(e.Fragment,{children:[e.jsx(b.Figure,{children:e.jsx(c.Icon,{name:N})}),e.jsxs("span",{className:s.details,children:[e.jsxs("span",{className:s["name-line"],children:[e.jsx("span",{className:s.name,children:f}),l&&e.jsx("span",{className:s.extension,children:l})]}),d&&e.jsx("span",{className:s.subtitle,children:d})]})]});return e.jsxs("div",{className:s.file,ref:h,"data-component":"file",children:[_?e.jsx("a",{className:s.action,href:_,target:x,rel:x==="_blank"?"noopener noreferrer":void 0,onClick:t=>{t.stopPropagation(),i&&(t.preventDefault(),i())},title:n,children:a}):i?e.jsx("button",{"aria-label":n,className:s.action,"data-actionable":"true","data-print-content":!0,onClick:t=>{t.stopPropagation(),i()},title:n,type:"button",children:a}):e.jsx("div",{className:s.action,title:n,children:a}),p&&e.jsx("a",{"aria-label":j??`Download ${n}`,className:s.download,href:p,onClick:t=>t.stopPropagation(),children:e.jsx(c.Icon,{name:"DownloadSimple",size:"small"})}),r&&e.jsx(q.Button,{"aria-label":u??`Delete ${n}`,className:s.delete,onClick:()=>r(),variant:"tertiary",children:e.jsx(c.Icon,{name:"Trash",size:"small"})})]})};exports.File=S;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Figure as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Button as
|
|
5
|
-
import '../../assets/index47.css';const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
name:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { Figure as w } from "../figure/index.js";
|
|
3
|
+
import { Icon as r } from "../icon/index.js";
|
|
4
|
+
import { Button as P } from "../button/index.js";
|
|
5
|
+
import '../../assets/index47.css';const g = "_download_13q7n_1", D = "_file_13q7n_18", I = "_action_13q7n_31", v = "_details_13q7n_78", y = "_name_13q7n_85", j = "_extension_13q7n_97", k = "_subtitle_13q7n_107", t = {
|
|
6
|
+
download: g,
|
|
7
|
+
file: D,
|
|
8
|
+
action: I,
|
|
9
|
+
delete: "_delete_13q7n_32",
|
|
10
|
+
details: v,
|
|
11
|
+
"name-line": "_name-line_13q7n_85",
|
|
12
|
+
name: y,
|
|
13
|
+
extension: j,
|
|
14
|
+
subtitle: k
|
|
15
|
+
}, z = {
|
|
15
16
|
".doc": "FileDoc",
|
|
16
17
|
".docx": "FileDoc",
|
|
17
18
|
".pdf": "FilePdf",
|
|
@@ -19,34 +20,38 @@ import '../../assets/index47.css';const q = "_file_1uuq9_1", g = "_action_1uuq9_
|
|
|
19
20
|
".pptx": "FilePpt",
|
|
20
21
|
".xls": "FileXls",
|
|
21
22
|
".xlsx": "FileXls"
|
|
22
|
-
},
|
|
23
|
-
deleteAccessibleLabel:
|
|
24
|
-
name:
|
|
25
|
-
onClick:
|
|
26
|
-
onDelete:
|
|
27
|
-
ref:
|
|
28
|
-
subtitle:
|
|
29
|
-
|
|
23
|
+
}, B = ({
|
|
24
|
+
deleteAccessibleLabel: x,
|
|
25
|
+
name: n,
|
|
26
|
+
onClick: a,
|
|
27
|
+
onDelete: d,
|
|
28
|
+
ref: N,
|
|
29
|
+
subtitle: m,
|
|
30
|
+
target: p,
|
|
31
|
+
url: _,
|
|
32
|
+
downloadAccessibleLabel: u,
|
|
33
|
+
downloadUrl: f
|
|
30
34
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
35
|
+
const o = n.lastIndexOf("."), h = o > 0 && o < n.length - 1, F = h ? n.slice(0, o) : n, i = h ? n.slice(o) : "", b = z[i.toLowerCase()] ?? "FileText", c = /* @__PURE__ */ s(q, { children: [
|
|
36
|
+
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(r, { name: b }) }),
|
|
37
|
+
/* @__PURE__ */ s("span", { className: t.details, children: [
|
|
38
|
+
/* @__PURE__ */ s("span", { className: t["name-line"], children: [
|
|
39
|
+
/* @__PURE__ */ e("span", { className: t.name, children: F }),
|
|
40
|
+
i && /* @__PURE__ */ e("span", { className: t.extension, children: i })
|
|
37
41
|
] }),
|
|
38
|
-
|
|
42
|
+
m && /* @__PURE__ */ e("span", { className: t.subtitle, children: m })
|
|
39
43
|
] })
|
|
40
44
|
] });
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
l.stopPropagation(),
|
|
44
|
-
}, title:
|
|
45
|
-
l.stopPropagation(),
|
|
46
|
-
}, title:
|
|
47
|
-
|
|
45
|
+
return /* @__PURE__ */ s("div", { className: t.file, ref: N, "data-component": "file", children: [
|
|
46
|
+
_ ? /* @__PURE__ */ e("a", { className: t.action, href: _, target: p, rel: p === "_blank" ? "noopener noreferrer" : void 0, onClick: (l) => {
|
|
47
|
+
l.stopPropagation(), a && (l.preventDefault(), a());
|
|
48
|
+
}, title: n, children: c }) : a ? /* @__PURE__ */ e("button", { "aria-label": n, className: t.action, "data-actionable": "true", "data-print-content": !0, onClick: (l) => {
|
|
49
|
+
l.stopPropagation(), a();
|
|
50
|
+
}, title: n, type: "button", children: c }) : /* @__PURE__ */ e("div", { className: t.action, title: n, children: c }),
|
|
51
|
+
f && /* @__PURE__ */ e("a", { "aria-label": u ?? `Download ${n}`, className: t.download, href: f, onClick: (l) => l.stopPropagation(), children: /* @__PURE__ */ e(r, { name: "DownloadSimple", size: "small" }) }),
|
|
52
|
+
d && /* @__PURE__ */ e(P, { "aria-label": x ?? `Delete ${n}`, className: t.delete, onClick: () => d(), variant: "tertiary", children: /* @__PURE__ */ e(r, { name: "Trash", size: "small" }) })
|
|
48
53
|
] });
|
|
49
54
|
};
|
|
50
55
|
export {
|
|
51
|
-
|
|
56
|
+
B as File
|
|
52
57
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -442,7 +442,7 @@ declare type FigureProps = {
|
|
|
442
442
|
variant?: 'default' | 'preview';
|
|
443
443
|
};
|
|
444
444
|
|
|
445
|
-
declare const File_2: ({ deleteAccessibleLabel, name, onClick, onDelete, ref, subtitle, url, }: FileProps) => JSX.Element;
|
|
445
|
+
declare const File_2: ({ deleteAccessibleLabel, name, onClick, onDelete, ref, subtitle, target, url, downloadAccessibleLabel, downloadUrl, }: FileProps) => JSX.Element;
|
|
446
446
|
export { File_2 as File }
|
|
447
447
|
|
|
448
448
|
declare type FileProps = React.ComponentPropsWithRef<'div'> & {
|
|
@@ -451,7 +451,10 @@ declare type FileProps = React.ComponentPropsWithRef<'div'> & {
|
|
|
451
451
|
onClick?: () => void;
|
|
452
452
|
onDelete?: () => void;
|
|
453
453
|
subtitle?: string;
|
|
454
|
+
target?: React.HTMLAttributeAnchorTarget;
|
|
454
455
|
url?: string;
|
|
456
|
+
downloadAccessibleLabel?: string;
|
|
457
|
+
downloadUrl?: string;
|
|
455
458
|
};
|
|
456
459
|
|
|
457
460
|
export declare const Footer: ({ animation, children, className, variant, ...props }: FooterProps) => JSX.Element;
|
package/dist/tokens.json
CHANGED