@webority/ui-react 0.8.7 → 0.8.9
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.
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
* @param {import('react').ReactNode} [props.label] Chip text (or use `children`).
|
|
14
14
|
* @param {import('react').ReactNode} [props.children]
|
|
15
15
|
* @param {"neutral"|"primary"|"success"|"warning"|"danger"|"info"} [props.tone="neutral"]
|
|
16
|
+
* @param {"soft"|"outline"|"solid"} [props.variant="soft"] Colour treatment — a tinted
|
|
17
|
+
* surface (`soft`, default), a tinted surface with a coloured border (`outline`), or a
|
|
18
|
+
* filled pill with contrasting text (`solid`).
|
|
16
19
|
* @param {"sm"|"md"} [props.size="md"]
|
|
17
20
|
* @param {string} [props.leadingIcon] Semantic icon name for a leading glyph.
|
|
18
21
|
* @param {string|import('react').ReactNode} [props.avatar] Leading avatar — an image URL or a node.
|
|
@@ -22,10 +25,11 @@
|
|
|
22
25
|
* @param {string} [props.removeLabel] aria-label for the dismiss button.
|
|
23
26
|
* @param {string} [props.className]
|
|
24
27
|
*/
|
|
25
|
-
export default function AppChip({ label, children, tone, size, leadingIcon, avatar, onRemove, onClick, disabled, removeLabel, className, ...rest }: {
|
|
28
|
+
export default function AppChip({ label, children, tone, variant, size, leadingIcon, avatar, onRemove, onClick, disabled, removeLabel, className, ...rest }: {
|
|
26
29
|
label?: import('react').ReactNode;
|
|
27
30
|
children?: import('react').ReactNode;
|
|
28
31
|
tone?: "neutral" | "primary" | "success" | "warning" | "danger" | "info";
|
|
32
|
+
variant?: "soft" | "outline" | "solid";
|
|
29
33
|
size?: "sm" | "md";
|
|
30
34
|
leadingIcon?: string;
|
|
31
35
|
avatar?: string | import('react').ReactNode;
|
|
@@ -31,8 +31,9 @@
|
|
|
31
31
|
* @param {string} [props.createLabel="Create workspace"] Copy for the create row.
|
|
32
32
|
* @param {boolean} [props.compact=false] Renders the 36px monogram button instead of the full
|
|
33
33
|
* card — the shape a collapsed rail slot wants. Same menu either way.
|
|
34
|
-
* @param {"sm"|"md"|"lg"} [props.size="md"]
|
|
35
|
-
* square
|
|
34
|
+
* @param {"sm"|"md"|"lg"} [props.size="md"] Size tier — scales the trigger (the card / compact
|
|
35
|
+
* square, its mark and name) AND the dropdown menu (width, row padding, avatars, the create
|
|
36
|
+
* "+" chip and the footer), so trigger and panel read at one size.
|
|
36
37
|
* @param {string} [props.ariaLabel] Accessible name for the trigger. Defaults to
|
|
37
38
|
* "Workspace <name>".
|
|
38
39
|
*/
|
package/dist/ui-react.js
CHANGED
|
@@ -4515,6 +4515,10 @@ function Pt({ trigger: e, children: t, title: r, placement: i = "bottom", trigge
|
|
|
4515
4515
|
placement: i,
|
|
4516
4516
|
overlay: _,
|
|
4517
4517
|
rootClose: a === "click",
|
|
4518
|
+
delay: a === "hover" || Array.isArray(a) && a.includes("hover") ? {
|
|
4519
|
+
show: 80,
|
|
4520
|
+
hide: 220
|
|
4521
|
+
} : void 0,
|
|
4518
4522
|
onToggle: g,
|
|
4519
4523
|
children: E
|
|
4520
4524
|
});
|
|
@@ -5130,53 +5134,54 @@ var dn = i(function({ label: e, id: t, name: n, error: r, hint: i, className: a
|
|
|
5130
5134
|
});
|
|
5131
5135
|
//#endregion
|
|
5132
5136
|
//#region src/components/AppChip.jsx
|
|
5133
|
-
function pn({ label: e, children: t, tone: n = "neutral",
|
|
5134
|
-
N("AppChip",
|
|
5135
|
-
let
|
|
5137
|
+
function pn({ label: e, children: t, tone: n = "neutral", variant: r = "soft", size: i = "md", leadingIcon: a, avatar: o, onRemove: s, onClick: c, disabled: l = !1, removeLabel: u, className: d = "", ...h }) {
|
|
5138
|
+
N("AppChip", h);
|
|
5139
|
+
let g = e ?? t, _ = tn(n), v = [
|
|
5136
5140
|
"chip",
|
|
5137
|
-
|
|
5138
|
-
r === "
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5141
|
+
_ && _ !== "neutral" ? _ : "",
|
|
5142
|
+
r === "outline" ? "chip-outline" : r === "solid" ? "chip-solid" : "",
|
|
5143
|
+
i === "sm" ? "chip-sm" : "",
|
|
5144
|
+
c ? "chip-clickable" : "",
|
|
5145
|
+
s ? "chip-removable" : "",
|
|
5146
|
+
l ? "is-disabled" : "",
|
|
5147
|
+
d
|
|
5148
|
+
].filter(Boolean).join(" "), y = o ? /* @__PURE__ */ p("span", {
|
|
5144
5149
|
className: "chip-avatar",
|
|
5145
|
-
children: typeof
|
|
5146
|
-
src:
|
|
5150
|
+
children: typeof o == "string" ? /* @__PURE__ */ p("img", {
|
|
5151
|
+
src: o,
|
|
5147
5152
|
alt: ""
|
|
5148
|
-
}) :
|
|
5149
|
-
}) :
|
|
5153
|
+
}) : o
|
|
5154
|
+
}) : a ? /* @__PURE__ */ p("span", {
|
|
5150
5155
|
className: "chip-ic",
|
|
5151
5156
|
children: /* @__PURE__ */ p(H, {
|
|
5152
|
-
name:
|
|
5153
|
-
size:
|
|
5157
|
+
name: a,
|
|
5158
|
+
size: i === "sm" ? 12 : 14
|
|
5154
5159
|
})
|
|
5155
|
-
}) : null,
|
|
5160
|
+
}) : null, b = c ? /* @__PURE__ */ m("button", {
|
|
5156
5161
|
type: "button",
|
|
5157
5162
|
className: "chip-body",
|
|
5158
|
-
onClick:
|
|
5159
|
-
disabled:
|
|
5160
|
-
children: [
|
|
5163
|
+
onClick: c,
|
|
5164
|
+
disabled: l,
|
|
5165
|
+
children: [y, /* @__PURE__ */ p("span", {
|
|
5161
5166
|
className: "chip-label",
|
|
5162
|
-
children:
|
|
5167
|
+
children: g
|
|
5163
5168
|
})]
|
|
5164
|
-
}) : /* @__PURE__ */ m(f, { children: [
|
|
5169
|
+
}) : /* @__PURE__ */ m(f, { children: [y, /* @__PURE__ */ p("span", {
|
|
5165
5170
|
className: "chip-label",
|
|
5166
|
-
children:
|
|
5171
|
+
children: g
|
|
5167
5172
|
})] });
|
|
5168
5173
|
return /* @__PURE__ */ m("span", {
|
|
5169
|
-
className:
|
|
5170
|
-
...
|
|
5171
|
-
children: [
|
|
5174
|
+
className: v,
|
|
5175
|
+
...h,
|
|
5176
|
+
children: [b, s && /* @__PURE__ */ p("button", {
|
|
5172
5177
|
type: "button",
|
|
5173
5178
|
className: "chip-remove",
|
|
5174
|
-
onClick:
|
|
5175
|
-
disabled:
|
|
5176
|
-
"aria-label":
|
|
5179
|
+
onClick: s,
|
|
5180
|
+
disabled: l,
|
|
5181
|
+
"aria-label": u || (typeof g == "string" ? `Remove ${g}` : "Remove"),
|
|
5177
5182
|
children: /* @__PURE__ */ p(H, {
|
|
5178
5183
|
name: "x",
|
|
5179
|
-
size:
|
|
5184
|
+
size: i === "sm" ? 12 : 14
|
|
5180
5185
|
})
|
|
5181
5186
|
})]
|
|
5182
5187
|
});
|
|
@@ -7374,6 +7379,7 @@ var Sr = i(function({ value: e, onChange: t, country: n, disabled: r = !1, name:
|
|
|
7374
7379
|
/* @__PURE__ */ p("wui-phone", {
|
|
7375
7380
|
"aria-label": typeof a == "string" ? a : void 0,
|
|
7376
7381
|
"aria-describedby": b,
|
|
7382
|
+
"aria-invalid": l ? "true" : void 0,
|
|
7377
7383
|
ref: x,
|
|
7378
7384
|
name: i,
|
|
7379
7385
|
country: n,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@webority/
|
|
32
|
-
"@webority/
|
|
31
|
+
"@webority/theme": "0.8.9",
|
|
32
|
+
"@webority/ui-elements": "0.8.9"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"bootstrap": "5.3.3",
|