@estiva-app/ui 0.114.0 → 0.115.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/FollowSwitch.d.ts +10 -5
- package/dist/FollowSwitch.d.ts.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/registry.json +4 -4
- package/src/FollowSwitch.mdx +5 -0
- package/src/FollowSwitch.stories.tsx +2 -2
- package/src/FollowSwitch.test.tsx +20 -0
- package/src/FollowSwitch.tsx +37 -12
package/dist/FollowSwitch.d.ts
CHANGED
|
@@ -25,8 +25,12 @@ export interface FollowSwitchProps {
|
|
|
25
25
|
readOnlyReason?: string;
|
|
26
26
|
/** People rather than circles, as `LevelIcon`'s `people`. */
|
|
27
27
|
people?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Whether the place lists files (a topic, a space): each level then says what of
|
|
30
|
+
* them it shows. `false` for a place with none (a team's chat): the levels say only
|
|
31
|
+
* what lights.
|
|
32
|
+
*/
|
|
33
|
+
files?: boolean;
|
|
30
34
|
/**
|
|
31
35
|
* The name of the group whose default reaches the viewer, when they chose
|
|
32
36
|
* against it: offers "Back to <name>’s default". Leave it out otherwise.
|
|
@@ -35,8 +39,9 @@ export interface FollowSwitchProps {
|
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* The one switch on a place: Not following, Important or All, each with what
|
|
38
|
-
* it lights, and "Back to <name>’s default" when
|
|
39
|
-
* group's default. It sits before the place's
|
|
42
|
+
* the place shows at it and what lights, and "Back to <name>’s default" when
|
|
43
|
+
* the viewer chose against a group's default. It sits before the place's
|
|
44
|
+
* title, drawn as `LevelIcon`.
|
|
40
45
|
*/
|
|
41
|
-
export declare function FollowSwitch({ level, label, onChoose, readOnlyReason, people,
|
|
46
|
+
export declare function FollowSwitch({ level, label, onChoose, readOnlyReason, people, files, backTo }: FollowSwitchProps): import("react").JSX.Element;
|
|
42
47
|
//# sourceMappingURL=FollowSwitch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FollowSwitch.d.ts","sourceRoot":"","sources":["../src/FollowSwitch.tsx"],"names":[],"mappings":"AAKA,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,WAAW,CAAA;AAE7C,4FAA4F;AAC5F,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,KAAK,GAAG,SAAS,CAAA;AAgB1D,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,KAAK,EAAE,WAAW,GAAG,SAAS,CAAA;IAC9B,mFAAmF;IACnF,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,MAAc,EAAE,EAAE,cAAc,+BASlE;
|
|
1
|
+
{"version":3,"file":"FollowSwitch.d.ts","sourceRoot":"","sources":["../src/FollowSwitch.tsx"],"names":[],"mappings":"AAKA,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,WAAW,CAAA;AAE7C,4FAA4F;AAC5F,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,KAAK,GAAG,SAAS,CAAA;AAgB1D,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,KAAK,EAAE,WAAW,GAAG,SAAS,CAAA;IAC9B,mFAAmF;IACnF,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,MAAc,EAAE,EAAE,cAAc,+BASlE;AA0BD,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,KAAK,EAAE,WAAW,GAAG,SAAS,CAAA;IAC9B,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAA;IACb,8JAA8J;IAC9J,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC5D,sGAAsG;IACtG,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAc,EAAE,KAAY,EAAE,MAAM,EAAE,EAAE,iBAAiB,+BAiD/H"}
|
package/dist/index.js
CHANGED
|
@@ -2130,13 +2130,23 @@ function LevelIcon({ level, people = false }) {
|
|
|
2130
2130
|
if (level === "important") return /* @__PURE__ */ jsx29(IconCircleDashed, { ...ICON, "aria-hidden": true });
|
|
2131
2131
|
return /* @__PURE__ */ jsx29(IconCircleDashedPlus, { ...ICON, "aria-hidden": true, className: "text-text-muted" });
|
|
2132
2132
|
}
|
|
2133
|
+
var LABEL = { important: "Important", all: "All" };
|
|
2133
2134
|
var WORDS = {
|
|
2134
|
-
|
|
2135
|
-
|
|
2135
|
+
files: {
|
|
2136
|
+
off: "Shows its own conversation. Nothing lights.",
|
|
2137
|
+
important: "Shows its own conversation. Lights for new conversations, replies in yours, and what names you on its files.",
|
|
2138
|
+
all: "Shows its files\u2019 threads too. Lights for all of it."
|
|
2139
|
+
},
|
|
2140
|
+
noFiles: {
|
|
2141
|
+
off: "Nothing lights.",
|
|
2142
|
+
important: "Lights for new conversations and replies in yours.",
|
|
2143
|
+
all: "Lights for every message."
|
|
2144
|
+
}
|
|
2136
2145
|
};
|
|
2137
|
-
function FollowSwitch({ level, label, onChoose, readOnlyReason, people = false,
|
|
2146
|
+
function FollowSwitch({ level, label, onChoose, readOnlyReason, people = false, files = true, backTo }) {
|
|
2138
2147
|
const [busy, setBusy] = useState6(false);
|
|
2139
|
-
const
|
|
2148
|
+
const words = WORDS[files ? "files" : "noFiles"];
|
|
2149
|
+
const now = level ? `You follow it at ${LABEL[level]}` : "Not following";
|
|
2140
2150
|
const button = /* @__PURE__ */ jsx29(IconButton, { "aria-label": `${now}: change how you follow ${label}`, tooltip: now, disabled: !onChoose || busy, disabledReason: onChoose ? void 0 : readOnlyReason, children: /* @__PURE__ */ jsx29(LevelIcon, { level, people }) });
|
|
2141
2151
|
if (!onChoose) return button;
|
|
2142
2152
|
const choose = async (choice) => {
|
|
@@ -2165,9 +2175,9 @@ function FollowSwitch({ level, label, onChoose, readOnlyReason, people = false,
|
|
|
2165
2175
|
};
|
|
2166
2176
|
return /* @__PURE__ */ jsxs21(Menu, { trigger: button, children: [
|
|
2167
2177
|
/* @__PURE__ */ jsxs21(MenuSection, { label: "How you follow it", children: [
|
|
2168
|
-
item("off", "Not following",
|
|
2169
|
-
item("important",
|
|
2170
|
-
item("all",
|
|
2178
|
+
item("off", "Not following", words.off, void 0),
|
|
2179
|
+
item("important", LABEL.important, words.important, "important"),
|
|
2180
|
+
item("all", LABEL.all, words.all, "all")
|
|
2171
2181
|
] }),
|
|
2172
2182
|
backTo && /* @__PURE__ */ jsx29(MenuSection, { label: `${backTo} gives you Important`, children: /* @__PURE__ */ jsx29(MenuItem, { label: `Back to ${backTo}\u2019s default`, description: level ? "Your choice no longer applies" : "Your choice no longer applies; only you see that you changed it", onClick: () => void choose("default") }) })
|
|
2173
2183
|
] });
|