@flamingo-stack/openframe-frontend-core 0.0.670 → 0.0.671
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/{chunk-K6WL2OWX.js → chunk-4PVY4JJN.js} +2 -2
- package/dist/{chunk-BRGO4IEB.js → chunk-6C6UUOH4.js} +5 -5
- package/dist/{chunk-57QY7D22.cjs → chunk-BP542DGQ.cjs} +17 -17
- package/dist/{chunk-57QY7D22.cjs.map → chunk-BP542DGQ.cjs.map} +1 -1
- package/dist/{chunk-S25GQVXN.cjs → chunk-DAGKBFZN.cjs} +33 -33
- package/dist/{chunk-S25GQVXN.cjs.map → chunk-DAGKBFZN.cjs.map} +1 -1
- package/dist/{chunk-NTZGJZZS.cjs → chunk-DAWYS25M.cjs} +13 -13
- package/dist/{chunk-NTZGJZZS.cjs.map → chunk-DAWYS25M.cjs.map} +1 -1
- package/dist/{chunk-R4NCUO7Y.js → chunk-DUZEFACP.js} +2 -2
- package/dist/{chunk-BUPLBCTW.cjs → chunk-EIAVE6SE.cjs} +10 -10
- package/dist/{chunk-BUPLBCTW.cjs.map → chunk-EIAVE6SE.cjs.map} +1 -1
- package/dist/{chunk-7YZZJYJN.cjs → chunk-FAJUQKWQ.cjs} +51 -51
- package/dist/{chunk-7YZZJYJN.cjs.map → chunk-FAJUQKWQ.cjs.map} +1 -1
- package/dist/{chunk-7BOZ3CRQ.js → chunk-FHTNCWIP.js} +3 -3
- package/dist/{chunk-QSUYGCBR.js → chunk-G64BNLDO.js} +2 -2
- package/dist/{chunk-NGMOFWQL.cjs → chunk-GF5TSQ6C.cjs} +3 -3
- package/dist/{chunk-NGMOFWQL.cjs.map → chunk-GF5TSQ6C.cjs.map} +1 -1
- package/dist/{chunk-DFM7NCZR.cjs → chunk-II66XWU5.cjs} +3 -3
- package/dist/{chunk-DFM7NCZR.cjs.map → chunk-II66XWU5.cjs.map} +1 -1
- package/dist/{chunk-JB44GMRU.js → chunk-IJIIL6WU.js} +4 -4
- package/dist/{chunk-BZ6RAT7K.js → chunk-K3O4D7LW.js} +2 -2
- package/dist/{chunk-X4JE3QHN.js → chunk-NIYIK32F.js} +3 -1
- package/dist/{chunk-X4JE3QHN.js.map → chunk-NIYIK32F.js.map} +1 -1
- package/dist/{chunk-BQUWZQF6.cjs → chunk-OG2BNJ2Q.cjs} +210 -208
- package/dist/chunk-OG2BNJ2Q.cjs.map +1 -0
- package/dist/{chunk-BP52HUNB.js → chunk-OYMOG544.js} +5 -5
- package/dist/{chunk-YCEVKQHL.cjs → chunk-PLG6LP7E.cjs} +36 -36
- package/dist/{chunk-YCEVKQHL.cjs.map → chunk-PLG6LP7E.cjs.map} +1 -1
- package/dist/{chunk-U7UVD2D2.js → chunk-PQ7YC5Y6.js} +2 -2
- package/dist/{chunk-7A6EJEL5.js → chunk-R22IA7MP.js} +2 -2
- package/dist/{chunk-DQVEL4YO.js → chunk-RKUCK6MN.js} +2 -2
- package/dist/{chunk-4RJ5M6EJ.cjs → chunk-SJZPKIW6.cjs} +4 -4
- package/dist/{chunk-4RJ5M6EJ.cjs.map → chunk-SJZPKIW6.cjs.map} +1 -1
- package/dist/{chunk-IO3EXNLR.js → chunk-SNNE34OP.js} +4 -4
- package/dist/{chunk-RLVSORQW.js → chunk-STLBB6PF.js} +2 -2
- package/dist/{chunk-LC4U5JGM.cjs → chunk-T3ACDOVD.cjs} +4 -4
- package/dist/{chunk-LC4U5JGM.cjs.map → chunk-T3ACDOVD.cjs.map} +1 -1
- package/dist/{chunk-QZGGA47F.js → chunk-UH3BL2OT.js} +2 -2
- package/dist/{chunk-CTVFAT6X.cjs → chunk-XGXHHSDU.cjs} +17 -17
- package/dist/{chunk-CTVFAT6X.cjs.map → chunk-XGXHHSDU.cjs.map} +1 -1
- package/dist/{chunk-P4H2NRQB.cjs → chunk-XH4MRTZM.cjs} +3 -3
- package/dist/{chunk-P4H2NRQB.cjs.map → chunk-XH4MRTZM.cjs.map} +1 -1
- package/dist/{chunk-6CEXIIVF.cjs → chunk-YIDNSRPL.cjs} +18 -18
- package/dist/{chunk-6CEXIIVF.cjs.map → chunk-YIDNSRPL.cjs.map} +1 -1
- package/dist/{chunk-K77Z3E4Y.cjs → chunk-YJWR7D6O.cjs} +3 -3
- package/dist/{chunk-K77Z3E4Y.cjs.map → chunk-YJWR7D6O.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +11 -11
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +49 -49
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +31 -31
- package/dist/components/index.js +12 -12
- package/dist/components/meeting-scheduler/index.cjs +21 -21
- package/dist/components/meeting-scheduler/index.js +1 -1
- package/dist/components/navigation/index.cjs +5 -5
- package/dist/components/navigation/index.js +4 -4
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/components/ui/search-input.d.ts +5 -1
- package/dist/components/ui/search-input.d.ts.map +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/dist/types/design-doc.d.ts +2 -0
- package/dist/types/design-doc.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/search-input-submit-on-clear.test.tsx +32 -0
- package/src/components/ui/search-input.tsx +7 -1
- package/src/types/design-doc.ts +5 -1
- package/dist/chunk-BQUWZQF6.cjs.map +0 -1
- /package/dist/{chunk-K6WL2OWX.js.map → chunk-4PVY4JJN.js.map} +0 -0
- /package/dist/{chunk-BRGO4IEB.js.map → chunk-6C6UUOH4.js.map} +0 -0
- /package/dist/{chunk-R4NCUO7Y.js.map → chunk-DUZEFACP.js.map} +0 -0
- /package/dist/{chunk-7BOZ3CRQ.js.map → chunk-FHTNCWIP.js.map} +0 -0
- /package/dist/{chunk-QSUYGCBR.js.map → chunk-G64BNLDO.js.map} +0 -0
- /package/dist/{chunk-JB44GMRU.js.map → chunk-IJIIL6WU.js.map} +0 -0
- /package/dist/{chunk-BZ6RAT7K.js.map → chunk-K3O4D7LW.js.map} +0 -0
- /package/dist/{chunk-BP52HUNB.js.map → chunk-OYMOG544.js.map} +0 -0
- /package/dist/{chunk-U7UVD2D2.js.map → chunk-PQ7YC5Y6.js.map} +0 -0
- /package/dist/{chunk-7A6EJEL5.js.map → chunk-R22IA7MP.js.map} +0 -0
- /package/dist/{chunk-DQVEL4YO.js.map → chunk-RKUCK6MN.js.map} +0 -0
- /package/dist/{chunk-IO3EXNLR.js.map → chunk-SNNE34OP.js.map} +0 -0
- /package/dist/{chunk-RLVSORQW.js.map → chunk-STLBB6PF.js.map} +0 -0
- /package/dist/{chunk-QZGGA47F.js.map → chunk-UH3BL2OT.js.map} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { SearchInput } from '../components/ui/search-input';
|
|
5
|
+
|
|
6
|
+
// An enter-to-search host: a submitted search must not stay applied once its text is gone.
|
|
7
|
+
function Host({ onSubmit }: { onSubmit: (v: string) => void }) {
|
|
8
|
+
const [value, setValue] = useState('sso');
|
|
9
|
+
return (
|
|
10
|
+
<SearchInput value={value} onChange={setValue} onSubmit={onSubmit} showDropdown={false} placeholder="Search" />
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('SearchInput submits the empty search when the box is emptied', () => {
|
|
15
|
+
it('by the clear button', () => {
|
|
16
|
+
const onSubmit = vi.fn();
|
|
17
|
+
render(<Host onSubmit={onSubmit} />);
|
|
18
|
+
fireEvent.click(screen.getByLabelText('Clear search'));
|
|
19
|
+
expect(onSubmit).toHaveBeenCalledWith('');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('by deleting the text, once (not on every keystroke, and not when it was already empty)', () => {
|
|
23
|
+
const onSubmit = vi.fn();
|
|
24
|
+
render(<Host onSubmit={onSubmit} />);
|
|
25
|
+
const input = screen.getByPlaceholderText('Search');
|
|
26
|
+
fireEvent.change(input, { target: { value: 'ss' } });
|
|
27
|
+
expect(onSubmit).not.toHaveBeenCalled();
|
|
28
|
+
fireEvent.change(input, { target: { value: '' } });
|
|
29
|
+
expect(onSubmit).toHaveBeenCalledTimes(1);
|
|
30
|
+
expect(onSubmit).toHaveBeenCalledWith('');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -51,7 +51,11 @@ export interface SearchInputProps {
|
|
|
51
51
|
defaultValue?: string;
|
|
52
52
|
/** Called when input value changes (raw, not debounced) */
|
|
53
53
|
onChange?: (value: string) => void;
|
|
54
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Called when the user presses Enter, AND with `''` when the box is emptied (the clear button, or deleting the
|
|
56
|
+
* text): a search that was submitted must not stay applied after its text is gone. Read the argument, never the
|
|
57
|
+
* host's own state, which has not re-rendered yet when this fires.
|
|
58
|
+
*/
|
|
55
59
|
onSubmit?: (value: string) => void;
|
|
56
60
|
/** Search results to display in the dropdown */
|
|
57
61
|
results?: SearchResult[];
|
|
@@ -292,6 +296,7 @@ export function SearchInput({
|
|
|
292
296
|
} else {
|
|
293
297
|
setInternalValue(newVal);
|
|
294
298
|
}
|
|
299
|
+
if (newVal === '' && currentValue !== '') onSubmit?.('');
|
|
295
300
|
if (!isOpen) setIsOpen(true);
|
|
296
301
|
setHighlightedIndex(-1);
|
|
297
302
|
};
|
|
@@ -304,6 +309,7 @@ export function SearchInput({
|
|
|
304
309
|
} else {
|
|
305
310
|
setInternalValue('');
|
|
306
311
|
}
|
|
312
|
+
if (currentValue !== '') onSubmit?.('');
|
|
307
313
|
inputRef.current?.focus();
|
|
308
314
|
};
|
|
309
315
|
|
package/src/types/design-doc.ts
CHANGED
|
@@ -376,7 +376,11 @@ export interface DesignDocListResponse {
|
|
|
376
376
|
count: number;
|
|
377
377
|
/** Server-computed spec-mode counts over the scope, MINUS the spec-mode
|
|
378
378
|
* filter itself — so a filtered row still shows what the other value holds. */
|
|
379
|
-
facets: {
|
|
379
|
+
facets: {
|
|
380
|
+
spec_mode: Record<string, number>;
|
|
381
|
+
/** The same over readiness (`ready` / `not_ready`), MINUS the ready filter itself: the filter row's options. */
|
|
382
|
+
ready: Record<'ready' | 'not_ready', number>;
|
|
383
|
+
};
|
|
380
384
|
}
|
|
381
385
|
|
|
382
386
|
export interface DesignDocStats {
|