@plasmicapp/react-web 0.2.94 → 0.2.97
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 +253 -252
- package/dist/plume/menu/context.d.ts +2 -2
- package/dist/plume/menu-button/menu-trigger.d.ts +1 -1
- package/dist/plume/select/context.d.ts +1 -1
- package/dist/plume/triggered-overlay/context.d.ts +3 -3
- package/dist/react-web.cjs.development.js +60 -44
- 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 +22 -6
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/ssr.d.ts +1 -1
- package/package.json +23 -7
- package/skinny/dist/{collection-utils-96cde83c.js → collection-utils-2745acd4.js} +3 -3
- package/skinny/dist/collection-utils-2745acd4.js.map +1 -0
- package/skinny/dist/context-034b8d25.js.map +1 -1
- 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/text-input/index.js +1 -1
- package/skinny/dist/plume/text-input/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/render/ssr.d.ts +1 -1
- package/skinny/dist/{ssr-a8081074.js → ssr-fbf922f6.js} +5 -5
- package/skinny/dist/ssr-fbf922f6.js.map +1 -0
- package/skinny/dist/collection-utils-47e89cbe.js +0 -238
- package/skinny/dist/collection-utils-47e89cbe.js.map +0 -1
- package/skinny/dist/collection-utils-4dae6efa.js +0 -292
- package/skinny/dist/collection-utils-4dae6efa.js.map +0 -1
- package/skinny/dist/collection-utils-57ec40f9.js +0 -292
- package/skinny/dist/collection-utils-57ec40f9.js.map +0 -1
- package/skinny/dist/collection-utils-96cde83c.js.map +0 -1
- package/skinny/dist/collection-utils-b0b8f30e.js +0 -291
- package/skinny/dist/collection-utils-b0b8f30e.js.map +0 -1
- package/skinny/dist/plume-utils-5c413fd1.js +0 -35
- package/skinny/dist/plume-utils-5c413fd1.js.map +0 -1
- package/skinny/dist/props-utils-4633caf6.js +0 -8
- package/skinny/dist/props-utils-4633caf6.js.map +0 -1
- package/skinny/dist/props-utils-5c0ad25a.js +0 -59
- package/skinny/dist/props-utils-5c0ad25a.js.map +0 -1
- package/skinny/dist/props-utils-754f655a.js +0 -39
- package/skinny/dist/props-utils-754f655a.js.map +0 -1
- package/skinny/dist/props-utils-c632595f.js +0 -59
- package/skinny/dist/props-utils-c632595f.js.map +0 -1
- package/skinny/dist/props-utils-fd5f444e.js +0 -59
- package/skinny/dist/props-utils-fd5f444e.js.map +0 -1
- package/skinny/dist/react-utils-118d8539.js +0 -190
- package/skinny/dist/react-utils-118d8539.js.map +0 -1
- package/skinny/dist/react-utils-2a2fd6c9.js +0 -339
- package/skinny/dist/react-utils-2a2fd6c9.js.map +0 -1
- package/skinny/dist/react-utils-2d70bbbe.js +0 -172
- package/skinny/dist/react-utils-2d70bbbe.js.map +0 -1
- package/skinny/dist/react-utils-675565b4.js +0 -334
- package/skinny/dist/react-utils-675565b4.js.map +0 -1
- package/skinny/dist/render/PlasmicImg.d.ts +0 -62
- package/skinny/dist/ssr-902d1292.js +0 -105
- package/skinny/dist/ssr-902d1292.js.map +0 -1
- package/skinny/dist/ssr-a8081074.js.map +0 -1
- package/skinny/dist/tslib.es6-00014098.js +0 -148
- package/skinny/dist/tslib.es6-00014098.js.map +0 -1
- package/skinny/dist/tslib.es6-73236e8e.js +0 -141
- package/skinny/dist/tslib.es6-73236e8e.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,258 +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
|
-
declare type PlasmicTranslator = (str: string, opts?: {
|
|
451
|
-
components?: {
|
|
452
|
-
[key: string]: React__default.ReactElement;
|
|
453
|
-
};
|
|
454
|
-
}) => React__default.ReactNode;
|
|
455
|
-
interface TransProps {
|
|
456
|
-
children?: React__default.ReactNode;
|
|
457
|
-
}
|
|
458
|
-
declare function genTranslatableString(elt: React__default.ReactNode): {
|
|
459
|
-
str: string;
|
|
460
|
-
components: {
|
|
461
|
-
[key: string]: React__default.ReactElement<any, string | ((props: any) => React__default.ReactElement<any, any> | null) | (new (props: any) => React__default.Component<any, any, any>)>;
|
|
462
|
-
};
|
|
463
|
-
componentsCount: number;
|
|
464
|
-
};
|
|
465
|
-
declare function Trans({ children }: TransProps): React__default.ReactNode;
|
|
466
|
-
|
|
467
|
-
interface PlasmicRootProviderProps {
|
|
468
|
-
platform?: "nextjs" | "gatsby";
|
|
469
|
-
children?: React.ReactNode;
|
|
470
|
-
translator?: PlasmicTranslator;
|
|
471
|
-
}
|
|
472
|
-
declare function PlasmicRootProvider(props: PlasmicRootProviderProps): JSX.Element;
|
|
473
|
-
declare const useIsSSR: typeof useIsSSR$1;
|
|
474
|
-
|
|
475
|
-
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: {
|
|
476
|
-
as?: T | undefined;
|
|
477
|
-
hasGap?: boolean | undefined;
|
|
478
|
-
} & React.ComponentProps<T>) => React.ReactElement) & {
|
|
479
|
-
div: React.FC<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
480
|
-
hasGap?: boolean | undefined;
|
|
481
|
-
}>;
|
|
482
|
-
a: React.FC<React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
483
|
-
hasGap?: boolean | undefined;
|
|
484
|
-
}>;
|
|
485
|
-
button: React.FC<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
486
|
-
hasGap?: boolean | undefined;
|
|
487
|
-
}>;
|
|
488
|
-
h1: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
489
|
-
hasGap?: boolean | undefined;
|
|
490
|
-
}>;
|
|
491
|
-
h2: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
492
|
-
hasGap?: boolean | undefined;
|
|
493
|
-
}>;
|
|
494
|
-
h3: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
495
|
-
hasGap?: boolean | undefined;
|
|
496
|
-
}>;
|
|
497
|
-
h4: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
498
|
-
hasGap?: boolean | undefined;
|
|
499
|
-
}>;
|
|
500
|
-
h5: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
501
|
-
hasGap?: boolean | undefined;
|
|
502
|
-
}>;
|
|
503
|
-
h6: React.FC<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement> & {
|
|
504
|
-
hasGap?: boolean | undefined;
|
|
505
|
-
}>;
|
|
506
|
-
label: React.FC<React.ClassAttributes<HTMLLabelElement> & React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
507
|
-
hasGap?: boolean | undefined;
|
|
508
|
-
}>;
|
|
509
|
-
form: React.FC<React.ClassAttributes<HTMLFormElement> & React.FormHTMLAttributes<HTMLFormElement> & {
|
|
510
|
-
hasGap?: boolean | undefined;
|
|
511
|
-
}>;
|
|
512
|
-
section: React.FC<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & {
|
|
513
|
-
hasGap?: boolean | undefined;
|
|
514
|
-
}>;
|
|
515
|
-
head: React.FC<React.ClassAttributes<HTMLHeadElement> & React.HTMLAttributes<HTMLHeadElement> & {
|
|
516
|
-
hasGap?: boolean | undefined;
|
|
517
|
-
}>;
|
|
518
|
-
main: React.FC<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & {
|
|
519
|
-
hasGap?: boolean | undefined;
|
|
520
|
-
}>;
|
|
521
|
-
nav: React.FC<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & {
|
|
522
|
-
hasGap?: boolean | undefined;
|
|
523
|
-
}>;
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
declare function useFocused(opts: {
|
|
527
|
-
isTextInput?: boolean;
|
|
528
|
-
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
529
|
-
declare function useFocusVisible(opts: {
|
|
530
|
-
isTextInput?: boolean;
|
|
531
|
-
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
532
|
-
declare function useFocusedWithin(opts: {
|
|
533
|
-
isTextInput?: boolean;
|
|
534
|
-
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
535
|
-
declare function useFocusVisibleWithin(opts: {
|
|
536
|
-
isTextInput?: boolean;
|
|
537
|
-
}): (boolean | React.HTMLAttributes<HTMLElement>)[];
|
|
538
|
-
declare function useHover(): (boolean | {
|
|
539
|
-
onMouseEnter: () => void;
|
|
540
|
-
onMouseLeave: () => void;
|
|
541
|
-
})[];
|
|
542
|
-
declare function usePressed(): (boolean | {
|
|
543
|
-
onMouseDown: () => void;
|
|
544
|
-
onMouseUp: () => void;
|
|
545
|
-
})[];
|
|
546
|
-
declare const TRIGGER_TO_HOOK: {
|
|
547
|
-
readonly useHover: typeof useHover;
|
|
548
|
-
readonly useFocused: typeof useFocused;
|
|
549
|
-
readonly useFocusVisible: typeof useFocusVisible;
|
|
550
|
-
readonly useFocusedWithin: typeof useFocusedWithin;
|
|
551
|
-
readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
|
|
552
|
-
readonly usePressed: typeof usePressed;
|
|
553
|
-
};
|
|
554
|
-
declare type TriggerType = keyof typeof TRIGGER_TO_HOOK;
|
|
555
|
-
interface TriggerOpts {
|
|
556
|
-
isTextInput?: boolean;
|
|
557
|
-
}
|
|
558
|
-
/**
|
|
559
|
-
* Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
|
|
560
|
-
* as it's not valid to install variable React hooks!
|
|
561
|
-
*/
|
|
562
|
-
declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React.HTMLAttributes<HTMLElement>];
|
|
563
|
-
|
|
564
|
-
declare const classNames: ClassNamesExport;
|
|
565
|
-
|
|
566
|
-
declare function setPlumeStrictMode(mode: boolean): void;
|
|
567
|
-
declare type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
|
|
568
|
-
declare type VariantArgsChoices<V> = {
|
|
569
|
-
[k in keyof V]-?: VariantArgChoices<V[k]>;
|
|
570
|
-
};
|
|
571
|
-
declare type DictValues<V extends Record<string, any>> = V[keyof V];
|
|
572
|
-
declare type DictTuples<V extends Record<string, any>> = DictValues<{
|
|
573
|
-
[K in keyof V]: [K, V[K]];
|
|
574
|
-
}>;
|
|
575
|
-
declare type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
|
|
576
|
-
declare type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
|
|
577
|
-
group: T1;
|
|
578
|
-
variant: T2;
|
|
579
|
-
} : never;
|
|
580
|
-
declare type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
|
|
581
|
-
declare type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
|
|
582
|
-
(props: {
|
|
583
|
-
variants?: V;
|
|
584
|
-
args?: A;
|
|
585
|
-
overrides?: O;
|
|
586
|
-
}): React.ReactElement | null;
|
|
587
|
-
internalVariantProps: (keyof V)[];
|
|
588
|
-
internalArgProps: (keyof A)[];
|
|
589
|
-
};
|
|
590
|
-
declare type AnyPlasmicClass = PlasmicClass<any, any, any>;
|
|
591
|
-
declare type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
|
|
592
|
-
declare type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
593
|
-
declare type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
594
|
-
|
|
595
|
-
interface CommonProps {
|
|
596
|
-
showStartIcon?: boolean;
|
|
597
|
-
showEndIcon?: boolean;
|
|
598
|
-
startIcon?: React.ReactNode;
|
|
599
|
-
endIcon?: React.ReactNode;
|
|
600
|
-
children?: React.ReactNode;
|
|
601
|
-
isDisabled?: boolean;
|
|
602
|
-
}
|
|
603
|
-
interface HtmlButtonProps extends Omit<React.ComponentProps<"button">, "ref" | "disabled"> {
|
|
604
|
-
}
|
|
605
|
-
interface HtmlAnchorProps extends Omit<React.ComponentProps<"a">, "ref" | "href"> {
|
|
606
|
-
link?: string;
|
|
607
|
-
}
|
|
608
|
-
declare type BaseButtonProps = CommonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
609
|
-
declare type HtmlAnchorOnlyProps = Exclude<keyof HtmlAnchorProps, keyof HtmlButtonProps>;
|
|
610
|
-
declare type HtmlButtonOnlyProps = Exclude<keyof HtmlButtonProps, keyof HtmlAnchorProps>;
|
|
611
|
-
declare type ButtonRef = React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
612
|
-
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
613
|
-
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
614
|
-
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
615
|
-
isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
616
|
-
startIconSlot?: keyof PlasmicClassArgs<C>;
|
|
617
|
-
endIconSlot?: keyof PlasmicClassArgs<C>;
|
|
618
|
-
contentSlot: keyof PlasmicClassArgs<C>;
|
|
619
|
-
root: keyof PlasmicClassOverrides<C>;
|
|
620
|
-
}
|
|
621
|
-
declare function useButton<P extends BaseButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
|
|
622
|
-
plasmicProps: {
|
|
623
|
-
variants: PlasmicClassVariants<C>;
|
|
624
|
-
args: PlasmicClassArgs<C>;
|
|
625
|
-
overrides: PlasmicClassOverrides<C>;
|
|
626
|
-
};
|
|
627
|
-
};
|
|
628
|
-
|
|
629
564
|
interface StyleProps {
|
|
630
565
|
className?: string;
|
|
631
566
|
style?: React.CSSProperties;
|
|
@@ -855,6 +790,24 @@ declare function useMenuItem<P extends BaseMenuItemProps, C extends AnyPlasmicCl
|
|
|
855
790
|
};
|
|
856
791
|
};
|
|
857
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
|
+
|
|
858
811
|
interface DropdownMenuProps {
|
|
859
812
|
/**
|
|
860
813
|
* A ReactElement that takes in a `ref` as well as the usual mouse and
|
|
@@ -1086,6 +1039,54 @@ declare function useSelectOptionGroup<P extends BaseSelectOptionGroupProps, C ex
|
|
|
1086
1039
|
};
|
|
1087
1040
|
};
|
|
1088
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
|
+
|
|
1089
1090
|
declare type SwitchRef = React.Ref<SwitchRefValue>;
|
|
1090
1091
|
interface SwitchRefValue extends SwitchState {
|
|
1091
1092
|
getRoot: () => HTMLElement | null;
|
|
@@ -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
|
/**
|
|
@@ -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;
|