@estiva-app/ui 0.42.0 → 0.44.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/CommandPalette.d.ts +16 -0
- package/dist/CommandPalette.d.ts.map +1 -1
- package/dist/eslint/index.js +21 -0
- package/dist/eslint/index.js.map +2 -2
- package/dist/eslint/no-handmade-empty-state.d.ts +7 -0
- package/dist/eslint/no-handmade-empty-state.d.ts.map +1 -1
- package/dist/gates/app-checks.d.ts.map +1 -1
- package/dist/gates/{chunk-SYVKGOWM.js → chunk-P5W6O5TF.js} +114 -63
- package/dist/gates/chunk-P5W6O5TF.js.map +7 -0
- package/dist/gates/cli.js +1 -1
- package/dist/gates/gate-config.d.ts.map +1 -1
- package/dist/gates/index.js +13 -3
- package/dist/gates/index.js.map +2 -2
- package/dist/gates/token-joined.d.ts +28 -0
- package/dist/gates/token-joined.d.ts.map +1 -0
- package/dist/gates/token-lint.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/registry.json +41 -3
- package/src/CommandPalette.mdx +6 -0
- package/src/CommandPalette.stories.tsx +26 -1
- package/src/CommandPalette.test.tsx +14 -0
- package/src/CommandPalette.tsx +29 -0
- package/src/EmptyState.mdx +1 -1
- package/src/eslint/no-handmade-empty-state.test.ts +23 -1
- package/src/eslint/no-handmade-empty-state.ts +37 -1
- package/src/gates/app-checks.ts +7 -0
- package/src/gates/gate-config.ts +2 -0
- package/src/gates/gates.test.ts +26 -0
- package/src/gates/token-joined.ts +94 -0
- package/src/gates/token-lint.ts +68 -66
- package/src/index.ts +2 -0
- package/src/registry/registry.test.ts +3 -3
- package/dist/gates/chunk-SYVKGOWM.js.map +0 -7
package/dist/CommandPalette.d.ts
CHANGED
|
@@ -124,4 +124,20 @@ export interface CommandPaletteQuoteProps {
|
|
|
124
124
|
}
|
|
125
125
|
/** Text written to be used elsewhere, set off by a rule at its left edge. */
|
|
126
126
|
export declare function CommandPaletteQuote({ children }: CommandPaletteQuoteProps): import("react").JSX.Element;
|
|
127
|
+
export interface CommandPaletteProposalProps {
|
|
128
|
+
/** Where it would be made: the app and the action — "App › New item". */
|
|
129
|
+
source: string;
|
|
130
|
+
/** The app's mark before the source, as small as the line (about 10px). */
|
|
131
|
+
mark?: ReactNode;
|
|
132
|
+
/** What would be made, in a sentence. */
|
|
133
|
+
children: string;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Something the palette offers to make, before anything is made: a card with
|
|
137
|
+
* where it would be made on top, then what it would be. A card because it is a
|
|
138
|
+
* thing about to exist, not text to read or use; the source first because two
|
|
139
|
+
* apps may offer something alike (UIG-40, Katerina 28 September: the look Peek's
|
|
140
|
+
* launcher already had, now drawn by the palette, ruling P4).
|
|
141
|
+
*/
|
|
142
|
+
export declare function CommandPaletteProposal({ source, mark, children }: CommandPaletteProposalProps): import("react").JSX.Element;
|
|
127
143
|
//# sourceMappingURL=CommandPalette.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPalette.d.ts","sourceRoot":"","sources":["../src/CommandPalette.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"CommandPalette.d.ts","sourceRoot":"","sources":["../src/CommandPalette.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAA;AAyDd,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,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,QAAQ,EAAE,MAAM,CAAA;IAChB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,yBAAyB,+BAsBjF;AAED,MAAM,WAAW,wBAAwB;IACvC,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE,wBAAwB,+BAEzE;AAED,MAAM,WAAW,2BAA2B;IAC1C,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,2BAA2B,+BAU7F"}
|
package/dist/eslint/index.js
CHANGED
|
@@ -817,6 +817,12 @@ function standsInForAList(element) {
|
|
|
817
817
|
return false;
|
|
818
818
|
}
|
|
819
819
|
var FILLS = /^(?:min-h-full|h-full)$/;
|
|
820
|
+
var CENTRES = /^(?:justify-center|items-center|content-center|place-(?:items|content)-center)$/;
|
|
821
|
+
var PADS = /^p[xytrblse]?-/;
|
|
822
|
+
function onlyElement(box) {
|
|
823
|
+
const kids = children2(box, "children").filter((kid) => !(kid.type === "JSXText" && !String(kid.value).trim()));
|
|
824
|
+
return kids.length === 1 && kids[0].type === "JSXElement" ? kids[0] : void 0;
|
|
825
|
+
}
|
|
820
826
|
function isPageScope(opening) {
|
|
821
827
|
const scope = attributeOf(opening, "scope");
|
|
822
828
|
if (!scope) return true;
|
|
@@ -882,6 +888,7 @@ var noHandmadeEmptyState = {
|
|
|
882
888
|
messages: {
|
|
883
889
|
handmade: 'A line saying there is nothing is an EmptyState. Use `EmptyState` from @estiva-app/ui: `scope="section"` inside a section, `scope="page"` for a whole page.',
|
|
884
890
|
wrongScope: 'A page-scope EmptyState inside a ScrollArea sits at the top of its pane, not the middle: the ScrollArea\'s content is only as tall as what is in it. Use `scope="section"` when the pane has anything else on it; when the whole pane is empty, draw the page EmptyState in place of the ScrollArea, not inside it.',
|
|
891
|
+
boxedPage: 'This box {{what}} a page-scope EmptyState, which centres itself in the room a flex column gives it and takes no padding. A box that places it can push it out of the middle, as the starter\'s home page did (UIG-10). Draw the EmptyState straight into the column, with `className="h-full"` outside a flex column.',
|
|
885
892
|
wrongScopeVia: '`{{component}}` draws a page-scope EmptyState ({{where}}) inside this ScrollArea, where it sits at the top of its pane, not the middle: the ScrollArea\'s content is only as tall as what is in it. Use `scope="section"` there when the pane has anything else on it; when the whole pane is empty, draw the page EmptyState in place of the ScrollArea, not inside it.',
|
|
886
893
|
...ESCAPE_MESSAGES
|
|
887
894
|
}
|
|
@@ -901,6 +908,20 @@ var noHandmadeEmptyState = {
|
|
|
901
908
|
const opening = child2(element, "openingElement");
|
|
902
909
|
const tag = tagName(element);
|
|
903
910
|
if (tag && /^[a-z]/.test(tag)) {
|
|
911
|
+
const only = facts && onlyElement(element);
|
|
912
|
+
const inner = only && child2(only, "openingElement");
|
|
913
|
+
const spread = inner && children2(inner, "attributes").some((a) => a.type === "JSXSpreadAttribute");
|
|
914
|
+
if (inner && !spread && isPart(bindingOfTag(child2(inner, "name"), facts.locals), "EmptyState") && isPageScope(inner)) {
|
|
915
|
+
const className = attributeOf(opening, "className");
|
|
916
|
+
const own = className ? classesOf(child2(className, "value"), scopeOf).map((c) => c.replace(/^(?:[^:\s[\]]+:)+/, "")) : [];
|
|
917
|
+
const centres = own.some((c) => CENTRES.test(c));
|
|
918
|
+
const pads = own.some((c) => PADS.test(c));
|
|
919
|
+
if ((centres || pads) && !isEscaped(context, opening)) {
|
|
920
|
+
const what = centres && pads ? "centres and pads" : centres ? "centres" : "pads";
|
|
921
|
+
context.report({ loc: opening.loc, messageId: "boxedPage", data: { what } });
|
|
922
|
+
}
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
904
925
|
const words2 = onlyWords(element);
|
|
905
926
|
if (!words2 || words2.length > SHORT) return;
|
|
906
927
|
if (!standsInForAList(element)) return;
|