@plasmicapp/react-web 0.2.93 → 0.2.96
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/all.d.ts +254 -235
- package/dist/index-common.d.ts +1 -0
- package/dist/plume/collection-utils.d.ts +1 -1
- package/dist/plume/menu/context.d.ts +2 -2
- package/dist/plume/menu-button/menu-trigger.d.ts +2 -2
- package/dist/plume/select/context.d.ts +1 -1
- package/dist/plume/triggered-overlay/context.d.ts +3 -3
- package/dist/react-utils.d.ts +2 -2
- package/dist/react-web.cjs.development.js +148 -40
- package/dist/react-web.cjs.development.js.map +1 -1
- package/dist/react-web.cjs.production.min.js +1 -1
- package/dist/react-web.cjs.production.min.js.map +1 -1
- package/dist/react-web.esm.js +110 -4
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/ssr.d.ts +3 -1
- package/dist/render/translation.d.ts +18 -0
- package/package.json +23 -7
- package/skinny/dist/{collection-utils-3487dd27.js → collection-utils-2745acd4.js} +2 -2
- package/skinny/dist/collection-utils-2745acd4.js.map +1 -0
- package/skinny/dist/context-034b8d25.js.map +1 -1
- package/skinny/dist/index-common.d.ts +1 -0
- package/skinny/dist/index.js +3 -2
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/plume/checkbox/index.js +5 -3
- package/skinny/dist/plume/checkbox/index.js.map +1 -1
- package/skinny/dist/plume/menu/context.d.ts +2 -2
- package/skinny/dist/plume/menu/index.js +7 -4
- package/skinny/dist/plume/menu/index.js.map +1 -1
- package/skinny/dist/plume/menu-button/index.js +6 -3
- package/skinny/dist/plume/menu-button/index.js.map +1 -1
- package/skinny/dist/plume/menu-button/menu-trigger.d.ts +1 -1
- package/skinny/dist/plume/select/context.d.ts +1 -1
- package/skinny/dist/plume/select/index.js +9 -4
- package/skinny/dist/plume/select/index.js.map +1 -1
- package/skinny/dist/plume/switch/index.js +5 -3
- package/skinny/dist/plume/switch/index.js.map +1 -1
- package/skinny/dist/plume/triggered-overlay/context.d.ts +3 -3
- package/skinny/dist/plume/triggered-overlay/index.js +2 -1
- package/skinny/dist/plume/triggered-overlay/index.js.map +1 -1
- package/skinny/dist/react-utils.d.ts +1 -1
- package/skinny/dist/render/ssr.d.ts +3 -1
- package/skinny/dist/render/translation.d.ts +18 -0
- package/skinny/dist/ssr-fbf922f6.js +108 -0
- package/skinny/dist/ssr-fbf922f6.js.map +1 -0
- package/skinny/dist/collection-utils-3487dd27.js.map +0 -1
- package/skinny/dist/ssr-d2fd94f2.js +0 -31
- package/skinny/dist/ssr-d2fd94f2.js.map +0 -1
package/dist/all.d.ts
CHANGED
|
@@ -180,6 +180,192 @@ declare type Queries = {
|
|
|
180
180
|
};
|
|
181
181
|
declare function createUseScreenVariants(isMulti: boolean, screenQueries: Queries): () => string | string[] | undefined;
|
|
182
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Returns whether the component is currently being server side rendered or
|
|
185
|
+
* hydrated on the client. Can be used to delay browser-specific rendering
|
|
186
|
+
* until after hydration.
|
|
187
|
+
*/
|
|
188
|
+
declare function useIsSSR$1(): boolean;
|
|
189
|
+
|
|
190
|
+
declare type PlasmicTranslator = (str: string, opts?: {
|
|
191
|
+
components?: {
|
|
192
|
+
[key: string]: React__default.ReactElement;
|
|
193
|
+
};
|
|
194
|
+
}) => React__default.ReactNode;
|
|
195
|
+
interface TransProps {
|
|
196
|
+
children?: React__default.ReactNode;
|
|
197
|
+
}
|
|
198
|
+
declare function genTranslatableString(elt: React__default.ReactNode): {
|
|
199
|
+
str: string;
|
|
200
|
+
components: {
|
|
201
|
+
[key: string]: React__default.ReactElement<any, string | ((props: any) => React__default.ReactElement<any, any> | null) | (new (props: any) => React__default.Component<any, any, any>)>;
|
|
202
|
+
};
|
|
203
|
+
componentsCount: number;
|
|
204
|
+
};
|
|
205
|
+
declare function Trans({ children }: TransProps): React__default.ReactNode;
|
|
206
|
+
|
|
207
|
+
interface PlasmicRootProviderProps {
|
|
208
|
+
platform?: "nextjs" | "gatsby";
|
|
209
|
+
children?: React.ReactNode;
|
|
210
|
+
translator?: PlasmicTranslator;
|
|
211
|
+
}
|
|
212
|
+
declare function PlasmicRootProvider(props: PlasmicRootProviderProps): JSX.Element;
|
|
213
|
+
declare const useIsSSR: typeof useIsSSR$1;
|
|
214
|
+
|
|
215
|
+
declare const Stack: (<T extends "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" = "div">(props: {
|
|
216
|
+
as?: T | undefined;
|
|
217
|
+
hasGap?: boolean | undefined;
|
|
218
|
+
} & React.ComponentProps<T>) => React.ReactElement) & {
|
|
219
|
+
div: React.FC<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
220
|
+
hasGap?: boolean | undefined;
|
|
221
|
+
}>;
|
|
222
|
+
a: React.FC<React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
223
|
+
hasGap?: boolean | undefined;
|
|
224
|
+
}>;
|
|
225
|
+
button: React.FC<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
226
|
+
hasGap?: boolean | undefined;
|
|
227
|
+
}>;
|
|
228
|
+
h1: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
229
|
+
hasGap?: boolean | undefined;
|
|
230
|
+
}>;
|
|
231
|
+
h2: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
232
|
+
hasGap?: boolean | undefined;
|
|
233
|
+
}>;
|
|
234
|
+
h3: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
235
|
+
hasGap?: boolean | undefined;
|
|
236
|
+
}>;
|
|
237
|
+
h4: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
238
|
+
hasGap?: boolean | undefined;
|
|
239
|
+
}>;
|
|
240
|
+
h5: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
241
|
+
hasGap?: boolean | undefined;
|
|
242
|
+
}>;
|
|
243
|
+
h6: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
244
|
+
hasGap?: boolean | undefined;
|
|
245
|
+
}>;
|
|
246
|
+
label: React.FC<React.ClassAttributes<HTMLLabelElement> & React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
247
|
+
hasGap?: boolean | undefined;
|
|
248
|
+
}>;
|
|
249
|
+
form: React.FC<React.ClassAttributes<HTMLFormElement> & React.FormHTMLAttributes<HTMLFormElement> & {
|
|
250
|
+
hasGap?: boolean | undefined;
|
|
251
|
+
}>;
|
|
252
|
+
section: React.FC<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & {
|
|
253
|
+
hasGap?: boolean | undefined;
|
|
254
|
+
}>;
|
|
255
|
+
head: React.FC<React.ClassAttributes<HTMLHeadElement> & React.HTMLAttributes<HTMLHeadElement> & {
|
|
256
|
+
hasGap?: boolean | undefined;
|
|
257
|
+
}>;
|
|
258
|
+
main: React.FC<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & {
|
|
259
|
+
hasGap?: boolean | undefined;
|
|
260
|
+
}>;
|
|
261
|
+
nav: React.FC<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & {
|
|
262
|
+
hasGap?: boolean | undefined;
|
|
263
|
+
}>;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
declare function useFocused(opts: {
|
|
267
|
+
isTextInput?: boolean;
|
|
268
|
+
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
269
|
+
declare function useFocusVisible(opts: {
|
|
270
|
+
isTextInput?: boolean;
|
|
271
|
+
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
272
|
+
declare function useFocusedWithin(opts: {
|
|
273
|
+
isTextInput?: boolean;
|
|
274
|
+
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
275
|
+
declare function useFocusVisibleWithin(opts: {
|
|
276
|
+
isTextInput?: boolean;
|
|
277
|
+
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
278
|
+
declare function useHover(): (boolean | {
|
|
279
|
+
onMouseEnter: () => void;
|
|
280
|
+
onMouseLeave: () => void;
|
|
281
|
+
})[];
|
|
282
|
+
declare function usePressed(): (boolean | {
|
|
283
|
+
onMouseDown: () => void;
|
|
284
|
+
onMouseUp: () => void;
|
|
285
|
+
})[];
|
|
286
|
+
declare const TRIGGER_TO_HOOK: {
|
|
287
|
+
readonly useHover: typeof useHover;
|
|
288
|
+
readonly useFocused: typeof useFocused;
|
|
289
|
+
readonly useFocusVisible: typeof useFocusVisible;
|
|
290
|
+
readonly useFocusedWithin: typeof useFocusedWithin;
|
|
291
|
+
readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
|
|
292
|
+
readonly usePressed: typeof usePressed;
|
|
293
|
+
};
|
|
294
|
+
declare type TriggerType = keyof typeof TRIGGER_TO_HOOK;
|
|
295
|
+
interface TriggerOpts {
|
|
296
|
+
isTextInput?: boolean;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
|
|
300
|
+
* as it's not valid to install variable React hooks!
|
|
301
|
+
*/
|
|
302
|
+
declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React.HTMLAttributes<HTMLElement>];
|
|
303
|
+
|
|
304
|
+
declare const classNames: ClassNamesExport;
|
|
305
|
+
|
|
306
|
+
declare function setPlumeStrictMode(mode: boolean): void;
|
|
307
|
+
declare type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
|
|
308
|
+
declare type VariantArgsChoices<V> = {
|
|
309
|
+
[k in keyof V]-?: VariantArgChoices<V[k]>;
|
|
310
|
+
};
|
|
311
|
+
declare type DictValues<V extends Record<string, any>> = V[keyof V];
|
|
312
|
+
declare type DictTuples<V extends Record<string, any>> = DictValues<{
|
|
313
|
+
[K in keyof V]: [K, V[K]];
|
|
314
|
+
}>;
|
|
315
|
+
declare type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
|
|
316
|
+
declare type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
|
|
317
|
+
group: T1;
|
|
318
|
+
variant: T2;
|
|
319
|
+
} : never;
|
|
320
|
+
declare type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
|
|
321
|
+
declare type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
|
|
322
|
+
(props: {
|
|
323
|
+
variants?: V;
|
|
324
|
+
args?: A;
|
|
325
|
+
overrides?: O;
|
|
326
|
+
}): React.ReactElement | null;
|
|
327
|
+
internalVariantProps: (keyof V)[];
|
|
328
|
+
internalArgProps: (keyof A)[];
|
|
329
|
+
};
|
|
330
|
+
declare type AnyPlasmicClass = PlasmicClass<any, any, any>;
|
|
331
|
+
declare type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
|
|
332
|
+
declare type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
333
|
+
declare type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
334
|
+
|
|
335
|
+
interface CommonProps {
|
|
336
|
+
showStartIcon?: boolean;
|
|
337
|
+
showEndIcon?: boolean;
|
|
338
|
+
startIcon?: React.ReactNode;
|
|
339
|
+
endIcon?: React.ReactNode;
|
|
340
|
+
children?: React.ReactNode;
|
|
341
|
+
isDisabled?: boolean;
|
|
342
|
+
}
|
|
343
|
+
interface HtmlButtonProps extends Omit<React.ComponentProps<"button">, "ref" | "disabled"> {
|
|
344
|
+
}
|
|
345
|
+
interface HtmlAnchorProps extends Omit<React.ComponentProps<"a">, "ref" | "href"> {
|
|
346
|
+
link?: string;
|
|
347
|
+
}
|
|
348
|
+
declare type BaseButtonProps = CommonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
349
|
+
declare type HtmlAnchorOnlyProps = Exclude<keyof HtmlAnchorProps, keyof HtmlButtonProps>;
|
|
350
|
+
declare type HtmlButtonOnlyProps = Exclude<keyof HtmlButtonProps, keyof HtmlAnchorProps>;
|
|
351
|
+
declare type ButtonRef = React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
352
|
+
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
353
|
+
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
354
|
+
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
355
|
+
isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
356
|
+
startIconSlot?: keyof PlasmicClassArgs<C>;
|
|
357
|
+
endIconSlot?: keyof PlasmicClassArgs<C>;
|
|
358
|
+
contentSlot: keyof PlasmicClassArgs<C>;
|
|
359
|
+
root: keyof PlasmicClassOverrides<C>;
|
|
360
|
+
}
|
|
361
|
+
declare function useButton<P extends BaseButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
|
|
362
|
+
plasmicProps: {
|
|
363
|
+
variants: PlasmicClassVariants<C>;
|
|
364
|
+
args: PlasmicClassArgs<C>;
|
|
365
|
+
overrides: PlasmicClassOverrides<C>;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
|
|
183
369
|
/*
|
|
184
370
|
* Copyright 2020 Adobe. All rights reserved.
|
|
185
371
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -254,6 +440,7 @@ interface FocusableDOMProps extends DOMProps {
|
|
|
254
440
|
* governing permissions and limitations under the License.
|
|
255
441
|
*/
|
|
256
442
|
|
|
443
|
+
|
|
257
444
|
type ValidationState = 'valid' | 'invalid';
|
|
258
445
|
|
|
259
446
|
interface Validation {
|
|
@@ -374,240 +561,6 @@ interface CheckboxProps$1 extends ToggleProps {
|
|
|
374
561
|
|
|
375
562
|
interface AriaCheckboxProps extends CheckboxProps$1, AriaToggleProps {}
|
|
376
563
|
|
|
377
|
-
/*
|
|
378
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
379
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
380
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
381
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
382
|
-
*
|
|
383
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
384
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
385
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
386
|
-
* governing permissions and limitations under the License.
|
|
387
|
-
*/
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
type Placement = 'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' |
|
|
391
|
-
'top' | 'top left' | 'top right' | 'top start' | 'top end' |
|
|
392
|
-
'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' |
|
|
393
|
-
'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom';
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Returns whether the component is currently being server side rendered or
|
|
397
|
-
* hydrated on the client. Can be used to delay browser-specific rendering
|
|
398
|
-
* until after hydration.
|
|
399
|
-
*/
|
|
400
|
-
declare function useIsSSR$1(): boolean;
|
|
401
|
-
|
|
402
|
-
/*
|
|
403
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
404
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
405
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
406
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
407
|
-
*
|
|
408
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
409
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
410
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
411
|
-
* governing permissions and limitations under the License.
|
|
412
|
-
*/
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
interface SwitchBase extends InputBase, FocusableProps {
|
|
416
|
-
/**
|
|
417
|
-
* The content to render as the Switch's label.
|
|
418
|
-
*/
|
|
419
|
-
children?: ReactNode,
|
|
420
|
-
/**
|
|
421
|
-
* Whether the Switch should be selected (uncontrolled).
|
|
422
|
-
*/
|
|
423
|
-
defaultSelected?: boolean,
|
|
424
|
-
/**
|
|
425
|
-
* Whether the Switch should be selected (controlled).
|
|
426
|
-
*/
|
|
427
|
-
isSelected?: boolean,
|
|
428
|
-
/**
|
|
429
|
-
* Handler that is called when the Switch's selection state changes.
|
|
430
|
-
*/
|
|
431
|
-
onChange?: (isSelected: boolean) => void,
|
|
432
|
-
/**
|
|
433
|
-
* The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
|
|
434
|
-
*/
|
|
435
|
-
value?: string,
|
|
436
|
-
/**
|
|
437
|
-
* The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
|
|
438
|
-
*/
|
|
439
|
-
name?: string
|
|
440
|
-
}
|
|
441
|
-
interface SwitchProps$1 extends SwitchBase {}
|
|
442
|
-
interface AriaSwitchBase extends SwitchBase, FocusableDOMProps, AriaLabelingProps {
|
|
443
|
-
/**
|
|
444
|
-
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
|
|
445
|
-
*/
|
|
446
|
-
'aria-controls'?: string
|
|
447
|
-
}
|
|
448
|
-
interface AriaSwitchProps extends SwitchProps$1, AriaSwitchBase {}
|
|
449
|
-
|
|
450
|
-
interface PlasmicRootProviderProps {
|
|
451
|
-
platform?: "nextjs" | "gatsby";
|
|
452
|
-
children?: React.ReactNode;
|
|
453
|
-
}
|
|
454
|
-
declare function PlasmicRootProvider(props: PlasmicRootProviderProps): JSX.Element;
|
|
455
|
-
declare const useIsSSR: typeof useIsSSR$1;
|
|
456
|
-
|
|
457
|
-
declare const Stack: (<T extends "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" = "div">(props: {
|
|
458
|
-
as?: T | undefined;
|
|
459
|
-
hasGap?: boolean | undefined;
|
|
460
|
-
} & React.ComponentProps<T>) => React.ReactElement) & {
|
|
461
|
-
div: React.FC<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
462
|
-
hasGap?: boolean | undefined;
|
|
463
|
-
}>;
|
|
464
|
-
a: React.FC<React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
465
|
-
hasGap?: boolean | undefined;
|
|
466
|
-
}>;
|
|
467
|
-
button: React.FC<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
468
|
-
hasGap?: boolean | undefined;
|
|
469
|
-
}>;
|
|
470
|
-
h1: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
471
|
-
hasGap?: boolean | undefined;
|
|
472
|
-
}>;
|
|
473
|
-
h2: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
474
|
-
hasGap?: boolean | undefined;
|
|
475
|
-
}>;
|
|
476
|
-
h3: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
477
|
-
hasGap?: boolean | undefined;
|
|
478
|
-
}>;
|
|
479
|
-
h4: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
480
|
-
hasGap?: boolean | undefined;
|
|
481
|
-
}>;
|
|
482
|
-
h5: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
483
|
-
hasGap?: boolean | undefined;
|
|
484
|
-
}>;
|
|
485
|
-
h6: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
486
|
-
hasGap?: boolean | undefined;
|
|
487
|
-
}>;
|
|
488
|
-
label: React.FC<React.ClassAttributes<HTMLLabelElement> & React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
489
|
-
hasGap?: boolean | undefined;
|
|
490
|
-
}>;
|
|
491
|
-
form: React.FC<React.ClassAttributes<HTMLFormElement> & React.FormHTMLAttributes<HTMLFormElement> & {
|
|
492
|
-
hasGap?: boolean | undefined;
|
|
493
|
-
}>;
|
|
494
|
-
section: React.FC<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & {
|
|
495
|
-
hasGap?: boolean | undefined;
|
|
496
|
-
}>;
|
|
497
|
-
head: React.FC<React.ClassAttributes<HTMLHeadElement> & React.HTMLAttributes<HTMLHeadElement> & {
|
|
498
|
-
hasGap?: boolean | undefined;
|
|
499
|
-
}>;
|
|
500
|
-
main: React.FC<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & {
|
|
501
|
-
hasGap?: boolean | undefined;
|
|
502
|
-
}>;
|
|
503
|
-
nav: React.FC<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & {
|
|
504
|
-
hasGap?: boolean | undefined;
|
|
505
|
-
}>;
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
declare function useFocused(opts: {
|
|
509
|
-
isTextInput?: boolean;
|
|
510
|
-
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
511
|
-
declare function useFocusVisible(opts: {
|
|
512
|
-
isTextInput?: boolean;
|
|
513
|
-
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
514
|
-
declare function useFocusedWithin(opts: {
|
|
515
|
-
isTextInput?: boolean;
|
|
516
|
-
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
517
|
-
declare function useFocusVisibleWithin(opts: {
|
|
518
|
-
isTextInput?: boolean;
|
|
519
|
-
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
520
|
-
declare function useHover(): (boolean | {
|
|
521
|
-
onMouseEnter: () => void;
|
|
522
|
-
onMouseLeave: () => void;
|
|
523
|
-
})[];
|
|
524
|
-
declare function usePressed(): (boolean | {
|
|
525
|
-
onMouseDown: () => void;
|
|
526
|
-
onMouseUp: () => void;
|
|
527
|
-
})[];
|
|
528
|
-
declare const TRIGGER_TO_HOOK: {
|
|
529
|
-
readonly useHover: typeof useHover;
|
|
530
|
-
readonly useFocused: typeof useFocused;
|
|
531
|
-
readonly useFocusVisible: typeof useFocusVisible;
|
|
532
|
-
readonly useFocusedWithin: typeof useFocusedWithin;
|
|
533
|
-
readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
|
|
534
|
-
readonly usePressed: typeof usePressed;
|
|
535
|
-
};
|
|
536
|
-
declare type TriggerType = keyof typeof TRIGGER_TO_HOOK;
|
|
537
|
-
interface TriggerOpts {
|
|
538
|
-
isTextInput?: boolean;
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
|
|
542
|
-
* as it's not valid to install variable React hooks!
|
|
543
|
-
*/
|
|
544
|
-
declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React.HTMLAttributes<HTMLElement>];
|
|
545
|
-
|
|
546
|
-
declare const classNames: ClassNamesExport;
|
|
547
|
-
|
|
548
|
-
declare function setPlumeStrictMode(mode: boolean): void;
|
|
549
|
-
declare type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
|
|
550
|
-
declare type VariantArgsChoices<V> = {
|
|
551
|
-
[k in keyof V]-?: VariantArgChoices<V[k]>;
|
|
552
|
-
};
|
|
553
|
-
declare type DictValues<V extends Record<string, any>> = V[keyof V];
|
|
554
|
-
declare type DictTuples<V extends Record<string, any>> = DictValues<{
|
|
555
|
-
[K in keyof V]: [K, V[K]];
|
|
556
|
-
}>;
|
|
557
|
-
declare type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
|
|
558
|
-
declare type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
|
|
559
|
-
group: T1;
|
|
560
|
-
variant: T2;
|
|
561
|
-
} : never;
|
|
562
|
-
declare type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
|
|
563
|
-
declare type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
|
|
564
|
-
(props: {
|
|
565
|
-
variants?: V;
|
|
566
|
-
args?: A;
|
|
567
|
-
overrides?: O;
|
|
568
|
-
}): React.ReactElement | null;
|
|
569
|
-
internalVariantProps: (keyof V)[];
|
|
570
|
-
internalArgProps: (keyof A)[];
|
|
571
|
-
};
|
|
572
|
-
declare type AnyPlasmicClass = PlasmicClass<any, any, any>;
|
|
573
|
-
declare type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
|
|
574
|
-
declare type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
575
|
-
declare type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
576
|
-
|
|
577
|
-
interface CommonProps {
|
|
578
|
-
showStartIcon?: boolean;
|
|
579
|
-
showEndIcon?: boolean;
|
|
580
|
-
startIcon?: React.ReactNode;
|
|
581
|
-
endIcon?: React.ReactNode;
|
|
582
|
-
children?: React.ReactNode;
|
|
583
|
-
isDisabled?: boolean;
|
|
584
|
-
}
|
|
585
|
-
interface HtmlButtonProps extends Omit<React.ComponentProps<"button">, "ref" | "disabled"> {
|
|
586
|
-
}
|
|
587
|
-
interface HtmlAnchorProps extends Omit<React.ComponentProps<"a">, "ref" | "href"> {
|
|
588
|
-
link?: string;
|
|
589
|
-
}
|
|
590
|
-
declare type BaseButtonProps = CommonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
591
|
-
declare type HtmlAnchorOnlyProps = Exclude<keyof HtmlAnchorProps, keyof HtmlButtonProps>;
|
|
592
|
-
declare type HtmlButtonOnlyProps = Exclude<keyof HtmlButtonProps, keyof HtmlAnchorProps>;
|
|
593
|
-
declare type ButtonRef = React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
594
|
-
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
595
|
-
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
596
|
-
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
597
|
-
isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
598
|
-
startIconSlot?: keyof PlasmicClassArgs<C>;
|
|
599
|
-
endIconSlot?: keyof PlasmicClassArgs<C>;
|
|
600
|
-
contentSlot: keyof PlasmicClassArgs<C>;
|
|
601
|
-
root: keyof PlasmicClassOverrides<C>;
|
|
602
|
-
}
|
|
603
|
-
declare function useButton<P extends BaseButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
|
|
604
|
-
plasmicProps: {
|
|
605
|
-
variants: PlasmicClassVariants<C>;
|
|
606
|
-
args: PlasmicClassArgs<C>;
|
|
607
|
-
overrides: PlasmicClassOverrides<C>;
|
|
608
|
-
};
|
|
609
|
-
};
|
|
610
|
-
|
|
611
564
|
interface StyleProps {
|
|
612
565
|
className?: string;
|
|
613
566
|
style?: React.CSSProperties;
|
|
@@ -837,6 +790,24 @@ declare function useMenuItem<P extends BaseMenuItemProps, C extends AnyPlasmicCl
|
|
|
837
790
|
};
|
|
838
791
|
};
|
|
839
792
|
|
|
793
|
+
/*
|
|
794
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
795
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
796
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
797
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
798
|
+
*
|
|
799
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
800
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
801
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
802
|
+
* governing permissions and limitations under the License.
|
|
803
|
+
*/
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
type Placement = 'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' |
|
|
807
|
+
'top' | 'top left' | 'top right' | 'top start' | 'top end' |
|
|
808
|
+
'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' |
|
|
809
|
+
'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom';
|
|
810
|
+
|
|
840
811
|
interface DropdownMenuProps {
|
|
841
812
|
/**
|
|
842
813
|
* A ReactElement that takes in a `ref` as well as the usual mouse and
|
|
@@ -1068,6 +1039,54 @@ declare function useSelectOptionGroup<P extends BaseSelectOptionGroupProps, C ex
|
|
|
1068
1039
|
};
|
|
1069
1040
|
};
|
|
1070
1041
|
|
|
1042
|
+
/*
|
|
1043
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
1044
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1045
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1046
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1047
|
+
*
|
|
1048
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1049
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1050
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1051
|
+
* governing permissions and limitations under the License.
|
|
1052
|
+
*/
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
interface SwitchBase extends InputBase, FocusableProps {
|
|
1056
|
+
/**
|
|
1057
|
+
* The content to render as the Switch's label.
|
|
1058
|
+
*/
|
|
1059
|
+
children?: ReactNode,
|
|
1060
|
+
/**
|
|
1061
|
+
* Whether the Switch should be selected (uncontrolled).
|
|
1062
|
+
*/
|
|
1063
|
+
defaultSelected?: boolean,
|
|
1064
|
+
/**
|
|
1065
|
+
* Whether the Switch should be selected (controlled).
|
|
1066
|
+
*/
|
|
1067
|
+
isSelected?: boolean,
|
|
1068
|
+
/**
|
|
1069
|
+
* Handler that is called when the Switch's selection state changes.
|
|
1070
|
+
*/
|
|
1071
|
+
onChange?: (isSelected: boolean) => void,
|
|
1072
|
+
/**
|
|
1073
|
+
* The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
|
|
1074
|
+
*/
|
|
1075
|
+
value?: string,
|
|
1076
|
+
/**
|
|
1077
|
+
* The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
|
|
1078
|
+
*/
|
|
1079
|
+
name?: string
|
|
1080
|
+
}
|
|
1081
|
+
interface SwitchProps$1 extends SwitchBase {}
|
|
1082
|
+
interface AriaSwitchBase extends SwitchBase, FocusableDOMProps, AriaLabelingProps {
|
|
1083
|
+
/**
|
|
1084
|
+
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
|
|
1085
|
+
*/
|
|
1086
|
+
'aria-controls'?: string
|
|
1087
|
+
}
|
|
1088
|
+
interface AriaSwitchProps extends SwitchProps$1, AriaSwitchBase {}
|
|
1089
|
+
|
|
1071
1090
|
declare type SwitchRef = React.Ref<SwitchRefValue>;
|
|
1072
1091
|
interface SwitchRefValue extends SwitchState {
|
|
1073
1092
|
getRoot: () => HTMLElement | null;
|
|
@@ -1158,4 +1177,4 @@ declare function useTriggeredOverlay<P extends BaseTriggeredOverlayProps, C exte
|
|
|
1158
1177
|
};
|
|
1159
1178
|
};
|
|
1160
1179
|
|
|
1161
|
-
export { BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicRootProvider, PlasmicSlot, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, TriggeredOverlayConfig, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, getDataProps, hasVariant, makeFragment, omit, pick, renderPlasmicSlot, setPlumeStrictMode, useButton, useCheckbox, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
|
|
1180
|
+
export { BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicRootProvider, PlasmicSlot, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, getDataProps, hasVariant, makeFragment, omit, pick, renderPlasmicSlot, setPlumeStrictMode, useButton, useCheckbox, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
|
package/dist/index-common.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export { createUseScreenVariants } from "./render/screen-variants";
|
|
|
11
11
|
export { PlasmicRootProvider, useIsSSR } from "./render/ssr";
|
|
12
12
|
export { Stack } from "./render/Stack";
|
|
13
13
|
export { useTrigger } from "./render/triggers";
|
|
14
|
+
export { Trans, genTranslatableString } from "./render/translation";
|
|
@@ -137,7 +137,7 @@ export declare function useDerivedItemsFromChildren<T extends React.ReactElement
|
|
|
137
137
|
* Given a Collection node, create the React element that we should use
|
|
138
138
|
* to render it.
|
|
139
139
|
*/
|
|
140
|
-
export declare function renderCollectionNode(node: Node<any>): React.ReactElement<any, string | ((props: any) => React.ReactElement<any,
|
|
140
|
+
export declare function renderCollectionNode(node: Node<any>): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
141
141
|
/**
|
|
142
142
|
* Renders a item-like or section-like Plume component element into an
|
|
143
143
|
* Item or a Section element.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { TreeState } from "react-stately";
|
|
3
|
-
import { BaseMenuProps } from "./menu";
|
|
2
|
+
import type { TreeState } from "@react-stately/tree";
|
|
3
|
+
import type { BaseMenuProps } from "./menu";
|
|
4
4
|
export interface MenuContextValue {
|
|
5
5
|
menuProps: BaseMenuProps;
|
|
6
6
|
state: TreeState<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Placement } from "@react-types/overlays";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { MenuTriggerState } from "react-stately";
|
|
3
|
+
import { MenuTriggerState } from "@react-stately/menu";
|
|
4
4
|
import { BaseMenuProps } from "../menu/menu";
|
|
5
5
|
import { TriggeredOverlayContextValue } from "../triggered-overlay/context";
|
|
6
6
|
/**
|
|
@@ -16,6 +16,6 @@ export declare function useMenuTrigger(opts: {
|
|
|
16
16
|
menu: React.ReactElement<BaseMenuProps> | (() => React.ReactElement<BaseMenuProps>);
|
|
17
17
|
}, state: MenuTriggerState): {
|
|
18
18
|
triggerProps: React.HTMLAttributes<HTMLElement>;
|
|
19
|
-
makeMenu: () => React.ReactElement<BaseMenuProps, string | ((props: any) => React.ReactElement<any,
|
|
19
|
+
makeMenu: () => React.ReactElement<BaseMenuProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | null;
|
|
20
20
|
triggerContext: TriggeredOverlayContextValue;
|
|
21
21
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Placement } from "@react-types/overlays";
|
|
2
|
-
import { FocusStrategy } from "@react-types/shared";
|
|
1
|
+
import type { Placement } from "@react-types/overlays";
|
|
2
|
+
import type { FocusStrategy } from "@react-types/shared";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { OverlayTriggerState } from "react-stately";
|
|
4
|
+
import type { OverlayTriggerState } from "@react-stately/overlays";
|
|
5
5
|
export interface TriggeredOverlayContextValue {
|
|
6
6
|
triggerRef: React.RefObject<HTMLElement>;
|
|
7
7
|
state: OverlayTriggerState;
|
package/dist/react-utils.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
export declare const isBrowser: boolean;
|
|
3
3
|
export declare const NONE: unique symbol;
|
|
4
4
|
export declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect;
|
|
5
|
-
export declare function createElementWithChildren(elementType: any, props: any, children: React.ReactNode): React.ReactElement<any, string | ((props: any) => React.ReactElement<any,
|
|
6
|
-
export declare function ensureNotArray(children: React.ReactNode):
|
|
5
|
+
export declare function createElementWithChildren(elementType: any, props: any, children: React.ReactNode): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.CElement<any, React.Component<any, any, any>>;
|
|
6
|
+
export declare function ensureNotArray(children: React.ReactNode): any;
|
|
7
7
|
/**
|
|
8
8
|
* Flattens ReactNode into an array of ReactChild, but does NOT replace
|
|
9
9
|
* missing keys with array index, as React.Children.toArray() does.
|