create-plasmic-app 0.0.96 → 0.0.98

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.
Files changed (78) hide show
  1. package/cpa-out/react-codegen-js/eslint.config.js +38 -0
  2. package/cpa-out/react-codegen-js/package.json +22 -32
  3. package/cpa-out/react-codegen-js/plasmic.json +16 -10
  4. package/cpa-out/react-codegen-js/src/App.jsx +1 -1
  5. package/cpa-out/react-codegen-js/src/components/Button.jsx +1 -3
  6. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +47 -96
  7. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +35 -29
  8. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +2 -14
  9. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +24 -24
  10. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +44 -58
  11. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +2 -2
  12. package/cpa-out/react-codegen-js/src/main.jsx +10 -0
  13. package/cpa-out/react-codegen-js/vite.config.js +7 -0
  14. package/cpa-out/react-codegen-ts/eslint.config.js +28 -0
  15. package/cpa-out/react-codegen-ts/package.json +23 -37
  16. package/cpa-out/react-codegen-ts/plasmic.json +16 -10
  17. package/cpa-out/react-codegen-ts/src/App.tsx +1 -1
  18. package/cpa-out/react-codegen-ts/src/components/Button.tsx +4 -5
  19. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +84 -62
  20. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +73 -44
  21. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +2 -14
  22. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +62 -38
  23. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +83 -70
  24. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +3 -3
  25. package/cpa-out/react-codegen-ts/src/main.tsx +10 -0
  26. package/cpa-out/react-codegen-ts/src/vite-env.d.ts +1 -0
  27. package/cpa-out/react-codegen-ts/tsconfig.json +4 -23
  28. package/cpa-out/react-codegen-ts/vite.config.ts +7 -0
  29. package/dist/index.js +3 -3
  30. package/dist/lib.js +1 -1
  31. package/dist/react/react.js +36 -11
  32. package/package.json +2 -2
  33. package/src/index.ts +3 -3
  34. package/src/lib.ts +1 -1
  35. package/src/react/react.ts +47 -16
  36. package/cpa-out/react-codegen-js/src/index.js +0 -17
  37. package/cpa-out/react-codegen-js/src/reportWebVitals.js +0 -13
  38. package/cpa-out/react-codegen-js/src/setupTests.js +0 -5
  39. package/cpa-out/react-codegen-ts/src/index.tsx +0 -19
  40. package/cpa-out/react-codegen-ts/src/react-app-env.d.ts +0 -1
  41. package/cpa-out/react-codegen-ts/src/reportWebVitals.ts +0 -15
  42. package/cpa-out/react-codegen-ts/src/setupTests.ts +0 -5
  43. package/cpa-out/react-loader-js/package.json +0 -40
  44. package/cpa-out/react-loader-js/plasmic.json +0 -127
  45. package/cpa-out/react-loader-js/src/App.jsx +0 -9
  46. package/cpa-out/react-loader-js/src/components/Button.jsx +0 -13
  47. package/cpa-out/react-loader-js/src/components/DynamicPage.jsx +0 -26
  48. package/cpa-out/react-loader-js/src/components/Homepage.jsx +0 -26
  49. package/cpa-out/react-loader-js/src/components/RandomDynamicPageButton.jsx +0 -24
  50. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +0 -625
  51. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +0 -166
  52. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +0 -29
  53. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +0 -210
  54. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +0 -161
  55. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +0 -39
  56. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.jsx +0 -37
  57. package/cpa-out/react-loader-js/src/index.js +0 -17
  58. package/cpa-out/react-loader-js/src/reportWebVitals.js +0 -13
  59. package/cpa-out/react-loader-js/src/setupTests.js +0 -5
  60. package/cpa-out/react-loader-ts/package.json +0 -45
  61. package/cpa-out/react-loader-ts/plasmic.json +0 -127
  62. package/cpa-out/react-loader-ts/src/App.tsx +0 -9
  63. package/cpa-out/react-loader-ts/src/components/Button.tsx +0 -36
  64. package/cpa-out/react-loader-ts/src/components/DynamicPage.tsx +0 -45
  65. package/cpa-out/react-loader-ts/src/components/Homepage.tsx +0 -45
  66. package/cpa-out/react-loader-ts/src/components/RandomDynamicPageButton.tsx +0 -44
  67. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +0 -725
  68. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +0 -248
  69. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +0 -31
  70. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +0 -294
  71. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +0 -240
  72. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +0 -44
  73. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.tsx +0 -41
  74. package/cpa-out/react-loader-ts/src/index.tsx +0 -19
  75. package/cpa-out/react-loader-ts/src/react-app-env.d.ts +0 -1
  76. package/cpa-out/react-loader-ts/src/reportWebVitals.ts +0 -15
  77. package/cpa-out/react-loader-ts/src/setupTests.ts +0 -5
  78. package/cpa-out/react-loader-ts/tsconfig.json +0 -26
@@ -1,725 +0,0 @@
1
- // @ts-nocheck
2
- /* eslint-disable */
3
- /* tslint:disable */
4
- /* prettier-ignore-start */
5
-
6
- /** @jsxRuntime classic */
7
- /** @jsx createPlasmicElementProxy */
8
- /** @jsxFrag React.Fragment */
9
-
10
- // This class is auto-generated by Plasmic; please do not edit!
11
- // Plasmic Project: 47tFXWjN2C4NyHFGGpaYQ3
12
- // Component: TQcvW_pSKi3
13
-
14
- import * as React from "react";
15
-
16
- import * as p from "@plasmicapp/react-web";
17
- import * as ph from "@plasmicapp/react-web/lib/host";
18
-
19
- import * as pp from "@plasmicapp/react-web";
20
- import {
21
- hasVariant,
22
- classNames,
23
- wrapWithClassName,
24
- createPlasmicElementProxy,
25
- makeFragment,
26
- MultiChoiceArg,
27
- SingleBooleanChoiceArg,
28
- SingleChoiceArg,
29
- pick,
30
- omit,
31
- useTrigger,
32
- StrictProps,
33
- deriveRenderOpts,
34
- ensureGlobalVariants
35
- } from "@plasmicapp/react-web";
36
-
37
- import "@plasmicapp/react-web/lib/plasmic.css";
38
-
39
- import projectcss from "./plasmic_create_plasmic_app.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
40
- import sty from "./PlasmicButton.module.css"; // plasmic-import: TQcvW_pSKi3/css
41
-
42
- import ChecksvgIcon from "./icons/PlasmicIcon__Checksvg"; // plasmic-import: gj-_D7n31Ho/icon
43
- import IconIcon from "./icons/PlasmicIcon__Icon"; // plasmic-import: 6PNxx3YMyDQ/icon
44
-
45
- export type PlasmicButton__VariantMembers = {
46
- showStartIcon: "showStartIcon";
47
- showEndIcon: "showEndIcon";
48
- isDisabled: "isDisabled";
49
- shape: "rounded" | "round" | "sharp";
50
- size: "compact" | "minimal";
51
- color:
52
- | "blue"
53
- | "green"
54
- | "yellow"
55
- | "red"
56
- | "sand"
57
- | "white"
58
- | "softBlue"
59
- | "softGreen"
60
- | "softYellow"
61
- | "softRed"
62
- | "softSand"
63
- | "clear"
64
- | "link";
65
- };
66
- export type PlasmicButton__VariantsArgs = {
67
- showStartIcon?: SingleBooleanChoiceArg<"showStartIcon">;
68
- showEndIcon?: SingleBooleanChoiceArg<"showEndIcon">;
69
- isDisabled?: SingleBooleanChoiceArg<"isDisabled">;
70
- shape?: SingleChoiceArg<"rounded" | "round" | "sharp">;
71
- size?: SingleChoiceArg<"compact" | "minimal">;
72
- color?: SingleChoiceArg<
73
- | "blue"
74
- | "green"
75
- | "yellow"
76
- | "red"
77
- | "sand"
78
- | "white"
79
- | "softBlue"
80
- | "softGreen"
81
- | "softYellow"
82
- | "softRed"
83
- | "softSand"
84
- | "clear"
85
- | "link"
86
- >;
87
- };
88
- type VariantPropType = keyof PlasmicButton__VariantsArgs;
89
- export const PlasmicButton__VariantProps = new Array<VariantPropType>(
90
- "showStartIcon",
91
- "showEndIcon",
92
- "isDisabled",
93
- "shape",
94
- "size",
95
- "color"
96
- );
97
-
98
- export type PlasmicButton__ArgsType = {
99
- children?: React.ReactNode;
100
- startIcon?: React.ReactNode;
101
- endIcon?: React.ReactNode;
102
- link?: string;
103
- };
104
- type ArgPropType = keyof PlasmicButton__ArgsType;
105
- export const PlasmicButton__ArgProps = new Array<ArgPropType>(
106
- "children",
107
- "startIcon",
108
- "endIcon",
109
- "link"
110
- );
111
-
112
- export type PlasmicButton__OverridesType = {
113
- root?: p.Flex<"button">;
114
- startIconContainer?: p.Flex<"div">;
115
- contentContainer?: p.Flex<"div">;
116
- endIconContainer?: p.Flex<"div">;
117
- };
118
-
119
- export interface DefaultButtonProps extends pp.BaseButtonProps {
120
- shape?: SingleChoiceArg<"rounded" | "round" | "sharp">;
121
- size?: SingleChoiceArg<"compact" | "minimal">;
122
- color?: SingleChoiceArg<
123
- | "blue"
124
- | "green"
125
- | "yellow"
126
- | "red"
127
- | "sand"
128
- | "white"
129
- | "softBlue"
130
- | "softGreen"
131
- | "softYellow"
132
- | "softRed"
133
- | "softSand"
134
- | "clear"
135
- | "link"
136
- >;
137
- }
138
-
139
- const __wrapUserFunction =
140
- globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
141
- const __wrapUserPromise =
142
- globalThis.__PlasmicWrapUserPromise ??
143
- (async (loc, promise) => {
144
- return await promise;
145
- });
146
-
147
- function PlasmicButton__RenderFunc(props: {
148
- variants: PlasmicButton__VariantsArgs;
149
- args: PlasmicButton__ArgsType;
150
- overrides: PlasmicButton__OverridesType;
151
- forNode?: string;
152
- }) {
153
- const { variants, overrides, forNode } = props;
154
-
155
- const $ctx = ph.useDataEnv?.() || {};
156
- const args = React.useMemo(() => Object.assign({}, props.args), [props.args]);
157
-
158
- const $props = {
159
- ...args,
160
- ...variants
161
- };
162
- const refsRef = React.useRef({});
163
- const $refs = refsRef.current;
164
-
165
- const currentUser = p.useCurrentUser?.() || {};
166
- const [$queries, setDollarQueries] = React.useState({});
167
- const stateSpecs = React.useMemo(
168
- () => [
169
- {
170
- path: "showStartIcon",
171
- type: "private",
172
- variableType: "variant",
173
- initFunc: true
174
- ? ({ $props, $state, $queries, $ctx }) => $props.showStartIcon
175
- : undefined
176
- },
177
- {
178
- path: "showEndIcon",
179
- type: "private",
180
- variableType: "variant",
181
- initFunc: true
182
- ? ({ $props, $state, $queries, $ctx }) => $props.showEndIcon
183
- : undefined
184
- },
185
- {
186
- path: "isDisabled",
187
- type: "private",
188
- variableType: "variant",
189
- initFunc: true
190
- ? ({ $props, $state, $queries, $ctx }) => $props.isDisabled
191
- : undefined
192
- },
193
- {
194
- path: "shape",
195
- type: "private",
196
- variableType: "variant",
197
- initFunc: true
198
- ? ({ $props, $state, $queries, $ctx }) => $props.shape
199
- : undefined
200
- },
201
- {
202
- path: "size",
203
- type: "private",
204
- variableType: "variant",
205
- initFunc: true
206
- ? ({ $props, $state, $queries, $ctx }) => $props.size
207
- : undefined
208
- },
209
- {
210
- path: "color",
211
- type: "private",
212
- variableType: "variant",
213
- initFunc: true
214
- ? ({ $props, $state, $queries, $ctx }) => $props.color
215
- : undefined
216
- }
217
- ],
218
- [$props, $ctx]
219
- );
220
- const $state = p.useDollarState(stateSpecs, { $props, $ctx, $queries });
221
-
222
- const [isRootFocusVisibleWithin, triggerRootFocusVisibleWithinProps] =
223
- useTrigger("useFocusVisibleWithin", {
224
- isTextInput: false
225
- });
226
- const triggers = {
227
- focusVisibleWithin_root: isRootFocusVisibleWithin
228
- };
229
-
230
- return (
231
- <p.Stack
232
- as={"button"}
233
- data-plasmic-name={"root"}
234
- data-plasmic-override={overrides.root}
235
- data-plasmic-root={true}
236
- data-plasmic-for-node={forNode}
237
- hasGap={true}
238
- className={classNames(
239
- projectcss.all,
240
- projectcss.button,
241
- projectcss.root_reset,
242
- projectcss.plasmic_default_styles,
243
- projectcss.plasmic_mixins,
244
- sty.root,
245
- {
246
- [sty.root___focusVisibleWithin]: triggers.focusVisibleWithin_root,
247
- [sty.rootcolor_blue]: hasVariant($state, "color", "blue"),
248
- [sty.rootcolor_clear]: hasVariant($state, "color", "clear"),
249
- [sty.rootcolor_green]: hasVariant($state, "color", "green"),
250
- [sty.rootcolor_link]: hasVariant($state, "color", "link"),
251
- [sty.rootcolor_link_size_minimal]:
252
- hasVariant($state, "color", "link") &&
253
- hasVariant($state, "size", "minimal"),
254
- [sty.rootcolor_red]: hasVariant($state, "color", "red"),
255
- [sty.rootcolor_sand]: hasVariant($state, "color", "sand"),
256
- [sty.rootcolor_softBlue]: hasVariant($state, "color", "softBlue"),
257
- [sty.rootcolor_softGreen]: hasVariant($state, "color", "softGreen"),
258
- [sty.rootcolor_softRed]: hasVariant($state, "color", "softRed"),
259
- [sty.rootcolor_softSand]: hasVariant($state, "color", "softSand"),
260
- [sty.rootcolor_softYellow]: hasVariant($state, "color", "softYellow"),
261
- [sty.rootcolor_white]: hasVariant($state, "color", "white"),
262
- [sty.rootcolor_yellow]: hasVariant($state, "color", "yellow"),
263
- [sty.rootisDisabled]: hasVariant($state, "isDisabled", "isDisabled"),
264
- [sty.rootshape_round]: hasVariant($state, "shape", "round"),
265
- [sty.rootshape_round_size_compact]:
266
- hasVariant($state, "shape", "round") &&
267
- hasVariant($state, "size", "compact"),
268
- [sty.rootshape_rounded]: hasVariant($state, "shape", "rounded"),
269
- [sty.rootshape_rounded_showStartIcon]:
270
- hasVariant($state, "shape", "rounded") &&
271
- hasVariant($state, "showStartIcon", "showStartIcon"),
272
- [sty.rootshape_rounded_size_compact]:
273
- hasVariant($state, "size", "compact") &&
274
- hasVariant($state, "shape", "rounded"),
275
- [sty.rootshape_sharp]: hasVariant($state, "shape", "sharp"),
276
- [sty.rootshowEndIcon]: hasVariant(
277
- $state,
278
- "showEndIcon",
279
- "showEndIcon"
280
- ),
281
- [sty.rootshowEndIcon_shape_rounded]:
282
- hasVariant($state, "showEndIcon", "showEndIcon") &&
283
- hasVariant($state, "shape", "rounded"),
284
- [sty.rootshowEndIcon_size_compact]:
285
- hasVariant($state, "size", "compact") &&
286
- hasVariant($state, "showEndIcon", "showEndIcon"),
287
- [sty.rootshowEndIcon_size_compact_showStartIcon]:
288
- hasVariant($state, "size", "compact") &&
289
- hasVariant($state, "showStartIcon", "showStartIcon") &&
290
- hasVariant($state, "showEndIcon", "showEndIcon"),
291
- [sty.rootshowStartIcon]: hasVariant(
292
- $state,
293
- "showStartIcon",
294
- "showStartIcon"
295
- ),
296
- [sty.rootsize_compact]: hasVariant($state, "size", "compact"),
297
- [sty.rootsize_compact_showStartIcon]:
298
- hasVariant($state, "size", "compact") &&
299
- hasVariant($state, "showStartIcon", "showStartIcon"),
300
- [sty.rootsize_minimal]: hasVariant($state, "size", "minimal")
301
- }
302
- )}
303
- data-plasmic-trigger-props={[triggerRootFocusVisibleWithinProps]}
304
- >
305
- {(hasVariant($state, "showStartIcon", "showStartIcon") ? true : false) ? (
306
- <div
307
- data-plasmic-name={"startIconContainer"}
308
- data-plasmic-override={overrides.startIconContainer}
309
- className={classNames(projectcss.all, sty.startIconContainer, {
310
- [sty.startIconContainercolor_blue]: hasVariant(
311
- $state,
312
- "color",
313
- "blue"
314
- ),
315
- [sty.startIconContainershape_rounded_showStartIcon]:
316
- hasVariant($state, "shape", "rounded") &&
317
- hasVariant($state, "showStartIcon", "showStartIcon"),
318
- [sty.startIconContainershowStartIcon]: hasVariant(
319
- $state,
320
- "showStartIcon",
321
- "showStartIcon"
322
- )
323
- })}
324
- >
325
- {p.renderPlasmicSlot({
326
- defaultContents: (
327
- <ChecksvgIcon
328
- className={classNames(projectcss.all, sty.svg__s6Xxe)}
329
- role={"img"}
330
- />
331
- ),
332
-
333
- value: args.startIcon,
334
- className: classNames(sty.slotTargetStartIcon, {
335
- [sty.slotTargetStartIconcolor_blue]: hasVariant(
336
- $state,
337
- "color",
338
- "blue"
339
- ),
340
- [sty.slotTargetStartIconcolor_clear]: hasVariant(
341
- $state,
342
- "color",
343
- "clear"
344
- ),
345
- [sty.slotTargetStartIconcolor_link]: hasVariant(
346
- $state,
347
- "color",
348
- "link"
349
- ),
350
- [sty.slotTargetStartIconcolor_softBlue]: hasVariant(
351
- $state,
352
- "color",
353
- "softBlue"
354
- ),
355
- [sty.slotTargetStartIconcolor_softGreen]: hasVariant(
356
- $state,
357
- "color",
358
- "softGreen"
359
- ),
360
- [sty.slotTargetStartIconcolor_softRed]: hasVariant(
361
- $state,
362
- "color",
363
- "softRed"
364
- ),
365
- [sty.slotTargetStartIconcolor_softSand]: hasVariant(
366
- $state,
367
- "color",
368
- "softSand"
369
- ),
370
- [sty.slotTargetStartIconcolor_softYellow]: hasVariant(
371
- $state,
372
- "color",
373
- "softYellow"
374
- ),
375
- [sty.slotTargetStartIconcolor_white]: hasVariant(
376
- $state,
377
- "color",
378
- "white"
379
- ),
380
- [sty.slotTargetStartIconcolor_yellow]: hasVariant(
381
- $state,
382
- "color",
383
- "yellow"
384
- ),
385
- [sty.slotTargetStartIconshowStartIcon]: hasVariant(
386
- $state,
387
- "showStartIcon",
388
- "showStartIcon"
389
- )
390
- })
391
- })}
392
- </div>
393
- ) : null}
394
-
395
- <div
396
- data-plasmic-name={"contentContainer"}
397
- data-plasmic-override={overrides.contentContainer}
398
- className={classNames(projectcss.all, sty.contentContainer, {
399
- [sty.contentContainer___focusVisibleWithin]:
400
- triggers.focusVisibleWithin_root,
401
- [sty.contentContainerisDisabled]: hasVariant(
402
- $state,
403
- "isDisabled",
404
- "isDisabled"
405
- ),
406
- [sty.contentContainershape_rounded]: hasVariant(
407
- $state,
408
- "shape",
409
- "rounded"
410
- ),
411
- [sty.contentContainershowEndIcon]: hasVariant(
412
- $state,
413
- "showEndIcon",
414
- "showEndIcon"
415
- )
416
- })}
417
- >
418
- {p.renderPlasmicSlot({
419
- defaultContents: "Button",
420
- value: args.children,
421
- className: classNames(sty.slotTargetChildren, {
422
- [sty.slotTargetChildren___focusVisibleWithin]:
423
- triggers.focusVisibleWithin_root,
424
- [sty.slotTargetChildrencolor_blue]: hasVariant(
425
- $state,
426
- "color",
427
- "blue"
428
- ),
429
- [sty.slotTargetChildrencolor_clear]: hasVariant(
430
- $state,
431
- "color",
432
- "clear"
433
- ),
434
- [sty.slotTargetChildrencolor_green]: hasVariant(
435
- $state,
436
- "color",
437
- "green"
438
- ),
439
- [sty.slotTargetChildrencolor_link]: hasVariant(
440
- $state,
441
- "color",
442
- "link"
443
- ),
444
- [sty.slotTargetChildrencolor_link_size_minimal]:
445
- hasVariant($state, "color", "link") &&
446
- hasVariant($state, "size", "minimal"),
447
- [sty.slotTargetChildrencolor_red]: hasVariant(
448
- $state,
449
- "color",
450
- "red"
451
- ),
452
- [sty.slotTargetChildrencolor_sand]: hasVariant(
453
- $state,
454
- "color",
455
- "sand"
456
- ),
457
- [sty.slotTargetChildrencolor_softBlue]: hasVariant(
458
- $state,
459
- "color",
460
- "softBlue"
461
- ),
462
- [sty.slotTargetChildrencolor_softGreen]: hasVariant(
463
- $state,
464
- "color",
465
- "softGreen"
466
- ),
467
- [sty.slotTargetChildrencolor_softRed]: hasVariant(
468
- $state,
469
- "color",
470
- "softRed"
471
- ),
472
- [sty.slotTargetChildrencolor_softSand]: hasVariant(
473
- $state,
474
- "color",
475
- "softSand"
476
- ),
477
- [sty.slotTargetChildrencolor_softYellow]: hasVariant(
478
- $state,
479
- "color",
480
- "softYellow"
481
- ),
482
- [sty.slotTargetChildrencolor_white]: hasVariant(
483
- $state,
484
- "color",
485
- "white"
486
- ),
487
- [sty.slotTargetChildrencolor_yellow]: hasVariant(
488
- $state,
489
- "color",
490
- "yellow"
491
- ),
492
- [sty.slotTargetChildrenisDisabled]: hasVariant(
493
- $state,
494
- "isDisabled",
495
- "isDisabled"
496
- ),
497
- [sty.slotTargetChildrenshape_rounded]: hasVariant(
498
- $state,
499
- "shape",
500
- "rounded"
501
- ),
502
- [sty.slotTargetChildrenshowEndIcon]: hasVariant(
503
- $state,
504
- "showEndIcon",
505
- "showEndIcon"
506
- ),
507
- [sty.slotTargetChildrenshowStartIcon]: hasVariant(
508
- $state,
509
- "showStartIcon",
510
- "showStartIcon"
511
- ),
512
- [sty.slotTargetChildrensize_minimal]: hasVariant(
513
- $state,
514
- "size",
515
- "minimal"
516
- )
517
- })
518
- })}
519
- </div>
520
-
521
- {(hasVariant($state, "showEndIcon", "showEndIcon") ? true : false) ? (
522
- <div
523
- data-plasmic-name={"endIconContainer"}
524
- data-plasmic-override={overrides.endIconContainer}
525
- className={classNames(projectcss.all, sty.endIconContainer, {
526
- [sty.endIconContainercolor_white]: hasVariant(
527
- $state,
528
- "color",
529
- "white"
530
- ),
531
- [sty.endIconContainercolor_yellow]: hasVariant(
532
- $state,
533
- "color",
534
- "yellow"
535
- ),
536
- [sty.endIconContainershowEndIcon]: hasVariant(
537
- $state,
538
- "showEndIcon",
539
- "showEndIcon"
540
- )
541
- })}
542
- >
543
- {p.renderPlasmicSlot({
544
- defaultContents: (
545
- <IconIcon
546
- className={classNames(projectcss.all, sty.svg__liJa)}
547
- role={"img"}
548
- />
549
- ),
550
-
551
- value: args.endIcon,
552
- className: classNames(sty.slotTargetEndIcon, {
553
- [sty.slotTargetEndIconcolor_clear]: hasVariant(
554
- $state,
555
- "color",
556
- "clear"
557
- ),
558
- [sty.slotTargetEndIconcolor_link]: hasVariant(
559
- $state,
560
- "color",
561
- "link"
562
- ),
563
- [sty.slotTargetEndIconcolor_softBlue]: hasVariant(
564
- $state,
565
- "color",
566
- "softBlue"
567
- ),
568
- [sty.slotTargetEndIconcolor_softGreen]: hasVariant(
569
- $state,
570
- "color",
571
- "softGreen"
572
- ),
573
- [sty.slotTargetEndIconcolor_softRed]: hasVariant(
574
- $state,
575
- "color",
576
- "softRed"
577
- ),
578
- [sty.slotTargetEndIconcolor_softSand]: hasVariant(
579
- $state,
580
- "color",
581
- "softSand"
582
- ),
583
- [sty.slotTargetEndIconcolor_softYellow]: hasVariant(
584
- $state,
585
- "color",
586
- "softYellow"
587
- ),
588
- [sty.slotTargetEndIconcolor_white]: hasVariant(
589
- $state,
590
- "color",
591
- "white"
592
- ),
593
- [sty.slotTargetEndIconcolor_yellow]: hasVariant(
594
- $state,
595
- "color",
596
- "yellow"
597
- ),
598
- [sty.slotTargetEndIconshowEndIcon]: hasVariant(
599
- $state,
600
- "showEndIcon",
601
- "showEndIcon"
602
- )
603
- })
604
- })}
605
- </div>
606
- ) : null}
607
- </p.Stack>
608
- ) as React.ReactElement | null;
609
- }
610
-
611
- function useBehavior<P extends pp.BaseButtonProps>(
612
- props: P,
613
- ref: pp.ButtonRef
614
- ) {
615
- const b = pp.useButton<P, typeof PlasmicButton>(
616
- PlasmicButton,
617
- props,
618
- {
619
- showStartIconVariant: {
620
- group: "showStartIcon",
621
- variant: "showStartIcon"
622
- },
623
- showEndIconVariant: { group: "showEndIcon", variant: "showEndIcon" },
624
- isDisabledVariant: { group: "isDisabled", variant: "isDisabled" },
625
- contentSlot: "children",
626
- startIconSlot: "startIcon",
627
- endIconSlot: "endIcon",
628
- root: "root"
629
- },
630
- ref
631
- );
632
-
633
- return b;
634
- }
635
-
636
- const PlasmicDescendants = {
637
- root: ["root", "startIconContainer", "contentContainer", "endIconContainer"],
638
- startIconContainer: ["startIconContainer"],
639
- contentContainer: ["contentContainer"],
640
- endIconContainer: ["endIconContainer"]
641
- } as const;
642
- type NodeNameType = keyof typeof PlasmicDescendants;
643
- type DescendantsType<T extends NodeNameType> =
644
- (typeof PlasmicDescendants)[T][number];
645
- type NodeDefaultElementType = {
646
- root: "button";
647
- startIconContainer: "div";
648
- contentContainer: "div";
649
- endIconContainer: "div";
650
- };
651
-
652
- type ReservedPropsType = "variants" | "args" | "overrides";
653
- type NodeOverridesType<T extends NodeNameType> = Pick<
654
- PlasmicButton__OverridesType,
655
- DescendantsType<T>
656
- >;
657
- type NodeComponentProps<T extends NodeNameType> =
658
- // Explicitly specify variants, args, and overrides as objects
659
- {
660
- variants?: PlasmicButton__VariantsArgs;
661
- args?: PlasmicButton__ArgsType;
662
- overrides?: NodeOverridesType<T>;
663
- } & Omit<PlasmicButton__VariantsArgs, ReservedPropsType> & // Specify variants directly as props
664
- /* Specify args directly as props*/ Omit<
665
- PlasmicButton__ArgsType,
666
- ReservedPropsType
667
- > &
668
- /* Specify overrides for each element directly as props*/ Omit<
669
- NodeOverridesType<T>,
670
- ReservedPropsType | VariantPropType | ArgPropType
671
- > &
672
- /* Specify props for the root element*/ Omit<
673
- Partial<React.ComponentProps<NodeDefaultElementType[T]>>,
674
- ReservedPropsType | VariantPropType | ArgPropType | DescendantsType<T>
675
- >;
676
-
677
- function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
678
- type PropsType = NodeComponentProps<NodeName> & { key?: React.Key };
679
- const func = function <T extends PropsType>(
680
- props: T & StrictProps<T, PropsType>
681
- ) {
682
- const { variants, args, overrides } = React.useMemo(
683
- () =>
684
- deriveRenderOpts(props, {
685
- name: nodeName,
686
- descendantNames: [...PlasmicDescendants[nodeName]],
687
- internalArgPropNames: PlasmicButton__ArgProps,
688
- internalVariantPropNames: PlasmicButton__VariantProps
689
- }),
690
- [props, nodeName]
691
- );
692
- return PlasmicButton__RenderFunc({
693
- variants,
694
- args,
695
- overrides,
696
- forNode: nodeName
697
- });
698
- };
699
- if (nodeName === "root") {
700
- func.displayName = "PlasmicButton";
701
- } else {
702
- func.displayName = `PlasmicButton.${nodeName}`;
703
- }
704
- return func;
705
- }
706
-
707
- export const PlasmicButton = Object.assign(
708
- // Top-level PlasmicButton renders the root element
709
- makeNodeComponent("root"),
710
- {
711
- // Helper components rendering sub-elements
712
- startIconContainer: makeNodeComponent("startIconContainer"),
713
- contentContainer: makeNodeComponent("contentContainer"),
714
- endIconContainer: makeNodeComponent("endIconContainer"),
715
-
716
- // Metadata about props expected for PlasmicButton
717
- internalVariantProps: PlasmicButton__VariantProps,
718
- internalArgProps: PlasmicButton__ArgProps,
719
-
720
- useBehavior
721
- }
722
- );
723
-
724
- export default PlasmicButton;
725
- /* prettier-ignore-end */