@aviala-design/spiral 2.6.2 → 2.7.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.
- package/dist/index.cjs +103 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -4
- package/dist/index.d.ts +32 -4
- package/dist/index.js +103 -37
- package/dist/index.js.map +1 -1
- package/dist/props.json +46 -2
- package/dist/styles.css +14 -7
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -3061,9 +3061,9 @@ var Progress = (0, import_react21.forwardRef)(
|
|
|
3061
3061
|
const resolvedShape = shape ?? "bar";
|
|
3062
3062
|
const displayLabel = label ?? `${Math.round(percent)}%`;
|
|
3063
3063
|
const diameter = resolvedSize === "big" ? 24 : 16;
|
|
3064
|
-
const
|
|
3064
|
+
const center = diameter / 2;
|
|
3065
3065
|
const stroke = 2;
|
|
3066
|
-
const normalizedRadius =
|
|
3066
|
+
const normalizedRadius = center - stroke / 2;
|
|
3067
3067
|
const circumference = normalizedRadius * 2 * Math.PI;
|
|
3068
3068
|
const strokeDashoffset = circumference - percent / 100 * circumference;
|
|
3069
3069
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -3109,17 +3109,17 @@ var Progress = (0, import_react21.forwardRef)(
|
|
|
3109
3109
|
"svg",
|
|
3110
3110
|
{
|
|
3111
3111
|
className: "aviala-progress__ring",
|
|
3112
|
-
width:
|
|
3113
|
-
height:
|
|
3114
|
-
viewBox: `0 0 ${
|
|
3112
|
+
width: diameter,
|
|
3113
|
+
height: diameter,
|
|
3114
|
+
viewBox: `0 0 ${diameter} ${diameter}`,
|
|
3115
3115
|
"aria-hidden": true,
|
|
3116
3116
|
children: [
|
|
3117
3117
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3118
3118
|
"circle",
|
|
3119
3119
|
{
|
|
3120
3120
|
className: "aviala-progress__ring-track",
|
|
3121
|
-
cx:
|
|
3122
|
-
cy:
|
|
3121
|
+
cx: center,
|
|
3122
|
+
cy: center,
|
|
3123
3123
|
r: normalizedRadius,
|
|
3124
3124
|
fill: "none",
|
|
3125
3125
|
strokeWidth: stroke
|
|
@@ -3129,15 +3129,15 @@ var Progress = (0, import_react21.forwardRef)(
|
|
|
3129
3129
|
"circle",
|
|
3130
3130
|
{
|
|
3131
3131
|
className: "aviala-progress__ring-fill",
|
|
3132
|
-
cx:
|
|
3133
|
-
cy:
|
|
3132
|
+
cx: center,
|
|
3133
|
+
cy: center,
|
|
3134
3134
|
r: normalizedRadius,
|
|
3135
3135
|
fill: "none",
|
|
3136
3136
|
strokeWidth: stroke,
|
|
3137
3137
|
strokeDasharray: `${circumference} ${circumference}`,
|
|
3138
3138
|
strokeDashoffset,
|
|
3139
3139
|
strokeLinecap: "round",
|
|
3140
|
-
transform: `rotate(-90 ${
|
|
3140
|
+
transform: `rotate(-90 ${center} ${center})`
|
|
3141
3141
|
}
|
|
3142
3142
|
)
|
|
3143
3143
|
]
|
|
@@ -11721,12 +11721,13 @@ CardBottom.displayName = "CardBottom";
|
|
|
11721
11721
|
var import_react66 = require("react");
|
|
11722
11722
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
11723
11723
|
var Table = (0, import_react66.forwardRef)(
|
|
11724
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
11724
|
+
({ className, stickyHeader = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
11725
11725
|
"div",
|
|
11726
11726
|
{
|
|
11727
11727
|
ref,
|
|
11728
11728
|
role: "table",
|
|
11729
11729
|
className: cn("aviala-table", className),
|
|
11730
|
+
"data-sticky-header": stickyHeader ? "true" : void 0,
|
|
11730
11731
|
...props,
|
|
11731
11732
|
children
|
|
11732
11733
|
}
|
|
@@ -11747,23 +11748,9 @@ var TableRow = (0, import_react66.forwardRef)(
|
|
|
11747
11748
|
)
|
|
11748
11749
|
);
|
|
11749
11750
|
TableRow.displayName = "TableRow";
|
|
11750
|
-
|
|
11751
|
-
({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
11752
|
-
"div",
|
|
11753
|
-
{
|
|
11754
|
-
ref,
|
|
11755
|
-
role: "columnheader",
|
|
11756
|
-
className: cn("aviala-table-head", className),
|
|
11757
|
-
"data-content": content,
|
|
11758
|
-
...props,
|
|
11759
|
-
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "caption", as: "span", children }) : children
|
|
11760
|
-
}
|
|
11761
|
-
)
|
|
11762
|
-
);
|
|
11763
|
-
TableHead.displayName = "TableHead";
|
|
11764
|
-
function renderCellIcon(node) {
|
|
11751
|
+
function renderCellIcon(node, sized = true) {
|
|
11765
11752
|
if (!node) return null;
|
|
11766
|
-
const content = (0, import_react66.isValidElement)(node) && typeof node.type !== "string" ? (0, import_react66.cloneElement)(node, {
|
|
11753
|
+
const content = sized && (0, import_react66.isValidElement)(node) && typeof node.type !== "string" ? (0, import_react66.cloneElement)(node, {
|
|
11767
11754
|
width: 16,
|
|
11768
11755
|
height: 16,
|
|
11769
11756
|
className: cn(
|
|
@@ -11773,17 +11760,64 @@ function renderCellIcon(node) {
|
|
|
11773
11760
|
}) : node;
|
|
11774
11761
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__icon", children: content });
|
|
11775
11762
|
}
|
|
11763
|
+
function renderTextBlock(text, caption) {
|
|
11764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "aviala-table-cell__text", children: [
|
|
11765
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "text", as: "span", children: text }),
|
|
11766
|
+
caption != null && caption !== false ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "caption", as: "span", className: "aviala-table-cell__caption", children: caption }) : null
|
|
11767
|
+
] });
|
|
11768
|
+
}
|
|
11769
|
+
function renderActions(actions) {
|
|
11770
|
+
if (actions == null) return null;
|
|
11771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "aviala-table-cell__actions", children: actions });
|
|
11772
|
+
}
|
|
11773
|
+
function renderCellBody(main, actions) {
|
|
11774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "aviala-table-cell__body", children: [
|
|
11775
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__main", children: main }),
|
|
11776
|
+
renderActions(actions)
|
|
11777
|
+
] });
|
|
11778
|
+
}
|
|
11779
|
+
var TableHead = (0, import_react66.forwardRef)(
|
|
11780
|
+
({ className, content = "text", actions, checkboxProps, children, ...props }, ref) => {
|
|
11781
|
+
const renderBody = () => {
|
|
11782
|
+
if (content === "checkbox") {
|
|
11783
|
+
return children ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Checkbox, { ...checkboxProps });
|
|
11784
|
+
}
|
|
11785
|
+
if (children != null) {
|
|
11786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11787
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__main", children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { level: "text", as: "span", children }) : children }),
|
|
11788
|
+
renderActions(actions)
|
|
11789
|
+
] });
|
|
11790
|
+
}
|
|
11791
|
+
return null;
|
|
11792
|
+
};
|
|
11793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
11794
|
+
"div",
|
|
11795
|
+
{
|
|
11796
|
+
ref,
|
|
11797
|
+
role: "columnheader",
|
|
11798
|
+
className: cn("aviala-table-head", className),
|
|
11799
|
+
"data-content": content,
|
|
11800
|
+
...props,
|
|
11801
|
+
children: renderBody()
|
|
11802
|
+
}
|
|
11803
|
+
);
|
|
11804
|
+
}
|
|
11805
|
+
);
|
|
11806
|
+
TableHead.displayName = "TableHead";
|
|
11776
11807
|
var TableCell = (0, import_react66.forwardRef)(
|
|
11777
11808
|
({
|
|
11778
11809
|
className,
|
|
11779
11810
|
content = "text",
|
|
11780
11811
|
icon,
|
|
11812
|
+
iconPlace,
|
|
11781
11813
|
text,
|
|
11814
|
+
caption,
|
|
11782
11815
|
people,
|
|
11783
11816
|
badge,
|
|
11784
11817
|
badgeLabel,
|
|
11785
11818
|
switchProps,
|
|
11786
11819
|
actions,
|
|
11820
|
+
grabber,
|
|
11787
11821
|
checkboxProps,
|
|
11788
11822
|
children,
|
|
11789
11823
|
...props
|
|
@@ -11793,25 +11827,57 @@ var TableCell = (0, import_react66.forwardRef)(
|
|
|
11793
11827
|
switch (content) {
|
|
11794
11828
|
case "checkbox":
|
|
11795
11829
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Checkbox, { ...checkboxProps });
|
|
11830
|
+
case "switch":
|
|
11831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Switch, { ...switchProps });
|
|
11832
|
+
case "action":
|
|
11833
|
+
return renderActions(actions);
|
|
11796
11834
|
case "icon+text":
|
|
11797
11835
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11798
|
-
|
|
11799
|
-
|
|
11836
|
+
grabber,
|
|
11837
|
+
renderCellBody(
|
|
11838
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11839
|
+
renderCellIcon(icon),
|
|
11840
|
+
renderTextBlock(text, caption)
|
|
11841
|
+
] }),
|
|
11842
|
+
actions
|
|
11843
|
+
)
|
|
11844
|
+
] });
|
|
11845
|
+
case "icon-place+text":
|
|
11846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11847
|
+
grabber,
|
|
11848
|
+
renderCellBody(
|
|
11849
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11850
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "aviala-table-cell__icon-place", children: iconPlace ?? renderCellIcon(icon, false) ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Avatar, { content: "text", level: "text", lineHeightFix: false, children: "A" }) }),
|
|
11851
|
+
renderTextBlock(text, caption)
|
|
11852
|
+
] }),
|
|
11853
|
+
actions
|
|
11854
|
+
)
|
|
11800
11855
|
] });
|
|
11801
11856
|
case "people":
|
|
11802
11857
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11803
|
-
|
|
11804
|
-
|
|
11858
|
+
grabber,
|
|
11859
|
+
renderCellBody(
|
|
11860
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11861
|
+
people ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Avatar, { content: "text", level: "text", lineHeightFix: false, children: "A" }),
|
|
11862
|
+
renderTextBlock(text, caption)
|
|
11863
|
+
] }),
|
|
11864
|
+
actions
|
|
11865
|
+
)
|
|
11805
11866
|
] });
|
|
11806
11867
|
case "badge":
|
|
11807
|
-
return
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11869
|
+
grabber,
|
|
11870
|
+
renderCellBody(
|
|
11871
|
+
badge ?? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Badge, { style: "theme", level: "caption", children: badgeLabel ?? "Text" }),
|
|
11872
|
+
actions
|
|
11873
|
+
)
|
|
11874
|
+
] });
|
|
11812
11875
|
case "text":
|
|
11813
11876
|
default:
|
|
11814
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.
|
|
11877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
11878
|
+
grabber,
|
|
11879
|
+
renderCellBody(renderTextBlock(text, caption), actions)
|
|
11880
|
+
] });
|
|
11815
11881
|
}
|
|
11816
11882
|
};
|
|
11817
11883
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|