@plasmicpkgs/antd5 0.0.6 → 0.0.7

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/antd.esm.js CHANGED
@@ -1,3 +1,9 @@
1
+ import Button from 'antd/es/button';
2
+ import registerComponent from '@plasmicapp/host/registerComponent';
3
+ import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
4
+ import Checkbox from 'antd/es/checkbox';
5
+ import CheckboxGroup from 'antd/es/checkbox/Group';
6
+ import React from 'react';
1
7
  import { GlobalActionsProvider } from '@plasmicapp/host';
2
8
  import registerToken from '@plasmicapp/host/registerToken';
3
9
  import { addLoadingStateListener } from '@plasmicapp/query';
@@ -5,9 +11,12 @@ import ConfigProvider from 'antd/es/config-provider';
5
11
  import useMessage from 'antd/es/message/useMessage';
6
12
  import useNotification from 'antd/es/notification/useNotification';
7
13
  import theme from 'antd/es/theme';
8
- import React from 'react';
9
- import registerComponent from '@plasmicapp/host/registerComponent';
10
- import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
14
+ import Dropdown from 'antd/es/dropdown';
15
+ import Menu from 'antd/es/menu';
16
+ import Modal from 'antd/es/modal';
17
+ import Radio from 'antd/es/radio';
18
+ import RadioGroup from 'antd/es/radio/group';
19
+ import 'antd/es/radio/radioButton';
11
20
  import Select from 'antd/es/select';
12
21
  import Table from 'antd/es/table';
13
22
 
@@ -54,33 +63,256 @@ function asArray(x) {
54
63
  }
55
64
  }
56
65
 
57
- var __defProp$2 = Object.defineProperty;
58
- var __defProps$1 = Object.defineProperties;
59
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
60
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
61
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
62
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
63
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
64
- var __spreadValues$2 = (a, b) => {
66
+ const AntdButton = Button;
67
+ function registerButton(loader) {
68
+ registerComponentHelper(loader, AntdButton, {
69
+ name: "plasmic-antd5-button",
70
+ displayName: "Button",
71
+ props: {
72
+ type: {
73
+ type: "choice",
74
+ options: ["default", "primary", "ghost", "dashed", "link", "text"],
75
+ description: "Can be set to primary, ghost, dashed, link, text, default",
76
+ defaultValueHint: "default"
77
+ },
78
+ size: {
79
+ type: "choice",
80
+ options: ["small", "medium", "large"],
81
+ description: "Set the size of button",
82
+ defaultValueHint: "medium"
83
+ },
84
+ shape: {
85
+ type: "choice",
86
+ options: ["default", "circle", "round"],
87
+ description: "Can be set button shape",
88
+ defaultValueHint: "default"
89
+ },
90
+ disabled: {
91
+ type: "boolean",
92
+ description: "Disabled state of button",
93
+ defaultValueHint: false
94
+ },
95
+ ghost: {
96
+ type: "boolean",
97
+ description: "Make background transparent and invert text and border colors",
98
+ defaultValueHint: false
99
+ },
100
+ danger: {
101
+ type: "boolean",
102
+ description: "Set the danger status of button",
103
+ defaultValueHint: false
104
+ },
105
+ loading: {
106
+ type: "boolean",
107
+ description: "Set the loading status of button",
108
+ defaultValueHint: false
109
+ },
110
+ href: {
111
+ type: "string",
112
+ description: "Redirect url of link button"
113
+ },
114
+ target: {
115
+ type: "choice",
116
+ options: ["_blank", "_self", "_parent", "_top"],
117
+ description: "Same as target attribute of a, works when href is specified",
118
+ hidden: (props) => !props.href,
119
+ defaultValueHint: "_self"
120
+ },
121
+ children: {
122
+ type: "slot",
123
+ defaultValue: [
124
+ {
125
+ type: "text",
126
+ value: "Button"
127
+ }
128
+ ]
129
+ },
130
+ icon: {
131
+ type: "slot",
132
+ hidePlaceholder: true
133
+ }
134
+ },
135
+ importPath: "@plasmicpkgs/antd5/skinny/registerButton",
136
+ importName: "AntdButton"
137
+ });
138
+ }
139
+
140
+ var __defProp$6 = Object.defineProperty;
141
+ var __defProps$5 = Object.defineProperties;
142
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
143
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
144
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
145
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
146
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
147
+ var __spreadValues$6 = (a, b) => {
65
148
  for (var prop in b || (b = {}))
66
- if (__hasOwnProp$2.call(b, prop))
67
- __defNormalProp$2(a, prop, b[prop]);
68
- if (__getOwnPropSymbols$2)
69
- for (var prop of __getOwnPropSymbols$2(b)) {
70
- if (__propIsEnum$2.call(b, prop))
71
- __defNormalProp$2(a, prop, b[prop]);
149
+ if (__hasOwnProp$6.call(b, prop))
150
+ __defNormalProp$6(a, prop, b[prop]);
151
+ if (__getOwnPropSymbols$6)
152
+ for (var prop of __getOwnPropSymbols$6(b)) {
153
+ if (__propIsEnum$6.call(b, prop))
154
+ __defNormalProp$6(a, prop, b[prop]);
72
155
  }
73
156
  return a;
74
157
  };
75
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
76
- var __objRest$2 = (source, exclude) => {
158
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
159
+ var __objRest$6 = (source, exclude) => {
77
160
  var target = {};
78
161
  for (var prop in source)
79
- if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
162
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
80
163
  target[prop] = source[prop];
81
- if (source != null && __getOwnPropSymbols$2)
82
- for (var prop of __getOwnPropSymbols$2(source)) {
83
- if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
164
+ if (source != null && __getOwnPropSymbols$6)
165
+ for (var prop of __getOwnPropSymbols$6(source)) {
166
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
167
+ target[prop] = source[prop];
168
+ }
169
+ return target;
170
+ };
171
+ function AntdCheckbox(props) {
172
+ const _a = props, { onChange } = _a, rest = __objRest$6(_a, ["onChange"]);
173
+ const wrappedOnChange = React.useMemo(() => {
174
+ if (onChange) {
175
+ return (event) => onChange(event.target.checked);
176
+ } else {
177
+ return void 0;
178
+ }
179
+ }, [onChange]);
180
+ return /* @__PURE__ */ React.createElement(Checkbox, __spreadProps$5(__spreadValues$6({}, rest), {
181
+ onChange: wrappedOnChange
182
+ }));
183
+ }
184
+ function registerCheckbox(loader) {
185
+ registerComponentHelper(loader, AntdCheckbox, {
186
+ name: "plasmic-antd5-checkbox",
187
+ displayName: "Checkbox",
188
+ props: {
189
+ checked: {
190
+ type: "boolean",
191
+ editOnly: true,
192
+ uncontrolledProp: "defaultChecked",
193
+ description: "Specifies the initial state: whether or not the checkbox is selected",
194
+ defaultValueHint: false
195
+ },
196
+ disabled: {
197
+ type: "boolean",
198
+ description: "If disable checkbox",
199
+ defaultValueHint: false
200
+ },
201
+ indeterminate: {
202
+ type: "boolean",
203
+ description: "The indeterminate checked state of checkbox",
204
+ defaultValueHint: false
205
+ },
206
+ value: {
207
+ type: "string",
208
+ description: "The checkbox value",
209
+ advanced: true
210
+ },
211
+ autoFocus: {
212
+ type: "boolean",
213
+ description: "If get focus when component mounted",
214
+ defaultValueHint: false,
215
+ advanced: true
216
+ },
217
+ children: {
218
+ type: "slot",
219
+ defaultValue: [
220
+ {
221
+ type: "text",
222
+ value: "Checkbox"
223
+ }
224
+ ]
225
+ },
226
+ onChange: {
227
+ type: "eventHandler",
228
+ argTypes: [{ name: "checked", type: "boolean" }]
229
+ }
230
+ },
231
+ unstable__states: {
232
+ checked: {
233
+ type: "writable",
234
+ valueProp: "checked",
235
+ onChangeProp: "onChange"
236
+ }
237
+ },
238
+ importPath: "@plasmicpkgs/antd5/skinny/registerCheckbox",
239
+ importName: "AntdCheckbox"
240
+ });
241
+ registerComponentHelper(loader, CheckboxGroup, {
242
+ name: "plasmic-antd5-checkbox-group",
243
+ displayName: "Checkbox Group",
244
+ props: {
245
+ value: {
246
+ type: "choice",
247
+ editOnly: true,
248
+ uncontrolledProp: "defaultValue",
249
+ description: "Default selected value",
250
+ multiSelect: true,
251
+ options: (ps) => {
252
+ const options = /* @__PURE__ */ new Set();
253
+ traverseReactEltTree(ps.children, (elt) => {
254
+ var _a;
255
+ if ((elt == null ? void 0 : elt.type) === AntdCheckbox && typeof ((_a = elt == null ? void 0 : elt.props) == null ? void 0 : _a.value) === "string") {
256
+ options.add(elt.props.value);
257
+ }
258
+ });
259
+ return Array.from(options.keys());
260
+ }
261
+ },
262
+ disabled: {
263
+ type: "boolean",
264
+ description: "Disables all checkboxes",
265
+ defaultValueHint: false
266
+ },
267
+ children: {
268
+ type: "slot",
269
+ allowedComponents: ["plasmic-antd5-checkbox"]
270
+ },
271
+ onChange: {
272
+ type: "eventHandler",
273
+ argTypes: [{ name: "value", type: "object" }]
274
+ }
275
+ },
276
+ unstable__states: {
277
+ value: {
278
+ type: "writable",
279
+ valueProp: "value",
280
+ onChangeProp: "onChange"
281
+ }
282
+ },
283
+ importPath: "@plasmicapp/antd5/skinny/registerCheckbox",
284
+ importName: "AntdCheckboxGroup",
285
+ parentComponentName: "plasmic-antd5-checkbox"
286
+ });
287
+ }
288
+
289
+ var __defProp$5 = Object.defineProperty;
290
+ var __defProps$4 = Object.defineProperties;
291
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
292
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
293
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
294
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
295
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
296
+ var __spreadValues$5 = (a, b) => {
297
+ for (var prop in b || (b = {}))
298
+ if (__hasOwnProp$5.call(b, prop))
299
+ __defNormalProp$5(a, prop, b[prop]);
300
+ if (__getOwnPropSymbols$5)
301
+ for (var prop of __getOwnPropSymbols$5(b)) {
302
+ if (__propIsEnum$5.call(b, prop))
303
+ __defNormalProp$5(a, prop, b[prop]);
304
+ }
305
+ return a;
306
+ };
307
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
308
+ var __objRest$5 = (source, exclude) => {
309
+ var target = {};
310
+ for (var prop in source)
311
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
312
+ target[prop] = source[prop];
313
+ if (source != null && __getOwnPropSymbols$5)
314
+ for (var prop of __getOwnPropSymbols$5(source)) {
315
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
84
316
  target[prop] = source[prop];
85
317
  }
86
318
  return target;
@@ -102,7 +334,7 @@ function themeToAntdConfig(opts) {
102
334
  wireframe,
103
335
  spacing
104
336
  } = opts;
105
- return __spreadProps$1(__spreadValues$2({}, spacing && { size: spacing }), {
337
+ return __spreadProps$4(__spreadValues$5({}, spacing && { size: spacing }), {
106
338
  theme: {
107
339
  token: Object.fromEntries(Object.entries({
108
340
  colorTextBase,
@@ -123,8 +355,8 @@ function themeToAntdConfig(opts) {
123
355
  });
124
356
  }
125
357
  function AntdConfigProvider(props) {
126
- const _a = props, { children, themeStyles } = _a, rest = __objRest$2(_a, ["children", "themeStyles"]);
127
- return /* @__PURE__ */ React.createElement(ConfigProvider, __spreadValues$2({}, themeToAntdConfig(__spreadProps$1(__spreadValues$2({}, rest), {
358
+ const _a = props, { children, themeStyles } = _a, rest = __objRest$5(_a, ["children", "themeStyles"]);
359
+ return /* @__PURE__ */ React.createElement(ConfigProvider, __spreadValues$5({}, themeToAntdConfig(__spreadProps$4(__spreadValues$5({}, rest), {
128
360
  fontFamily: themeStyles.fontFamily,
129
361
  fontSize: themeStyles.fontSize ? parseInt(themeStyles.fontSize) : void 0,
130
362
  lineHeight: themeStyles.lineHeight ? parseInt(themeStyles.lineHeight) : void 0,
@@ -144,8 +376,8 @@ function InnerConfigProvider(props) {
144
376
  const actions = React.useMemo(() => ({
145
377
  showNotification: (opts) => {
146
378
  var _b;
147
- const _a = opts, rest = __objRest$2(_a, ["type"]);
148
- app.notification[(_b = opts.type) != null ? _b : "info"](__spreadValues$2({}, rest));
379
+ const _a = opts, rest = __objRest$5(_a, ["type"]);
380
+ app.notification[(_b = opts.type) != null ? _b : "info"](__spreadValues$5({}, rest));
149
381
  },
150
382
  hideNotifications: () => {
151
383
  app.notification.destroy();
@@ -401,7 +633,7 @@ function registerTokens(loader) {
401
633
  regs.forEach((t) => registerToken(t));
402
634
  }
403
635
  }
404
- const registerConfigProvider = makeRegisterGlobalContext(AntdConfigProvider, __spreadProps$1(__spreadValues$2({
636
+ const registerConfigProvider = makeRegisterGlobalContext(AntdConfigProvider, __spreadProps$4(__spreadValues$5({
405
637
  name: "plasmic-antd5-config-provider",
406
638
  displayName: "Ant Design System Settings",
407
639
  props: {
@@ -506,6 +738,650 @@ const registerConfigProvider = makeRegisterGlobalContext(AntdConfigProvider, __s
506
738
  importName: "AntdConfigProvider"
507
739
  }));
508
740
 
741
+ var __defProp$4 = Object.defineProperty;
742
+ var __defProps$3 = Object.defineProperties;
743
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
744
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
745
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
746
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
747
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
748
+ var __spreadValues$4 = (a, b) => {
749
+ for (var prop in b || (b = {}))
750
+ if (__hasOwnProp$4.call(b, prop))
751
+ __defNormalProp$4(a, prop, b[prop]);
752
+ if (__getOwnPropSymbols$4)
753
+ for (var prop of __getOwnPropSymbols$4(b)) {
754
+ if (__propIsEnum$4.call(b, prop))
755
+ __defNormalProp$4(a, prop, b[prop]);
756
+ }
757
+ return a;
758
+ };
759
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
760
+ var __objRest$4 = (source, exclude) => {
761
+ var target = {};
762
+ for (var prop in source)
763
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
764
+ target[prop] = source[prop];
765
+ if (source != null && __getOwnPropSymbols$4)
766
+ for (var prop of __getOwnPropSymbols$4(source)) {
767
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
768
+ target[prop] = source[prop];
769
+ }
770
+ return target;
771
+ };
772
+ function AntdDropdown(props) {
773
+ const _a = props, { children, onAction, menuItems } = _a, rest = __objRest$4(_a, ["children", "onAction", "menuItems"]);
774
+ return /* @__PURE__ */ React.createElement(Dropdown, __spreadProps$3(__spreadValues$4({}, rest), {
775
+ overlay: () => {
776
+ var _a2;
777
+ const items = (_a2 = menuItems == null ? void 0 : menuItems()) != null ? _a2 : [];
778
+ return /* @__PURE__ */ React.createElement(Menu, {
779
+ onClick: (event) => onAction == null ? void 0 : onAction(event.key)
780
+ }, items);
781
+ }
782
+ }), typeof children === "string" ? /* @__PURE__ */ React.createElement("div", null, children) : children);
783
+ }
784
+ function registerDropdown(loader) {
785
+ registerComponentHelper(loader, AntdDropdown, {
786
+ name: "plasmic-antd5-dropdown",
787
+ displayName: "Dropdown",
788
+ props: {
789
+ open: {
790
+ type: "boolean",
791
+ description: "Toggle visibility of dropdown menu in Plasmic Editor",
792
+ editOnly: true,
793
+ uncontrolledProp: "fakeOpen",
794
+ defaultValueHint: false
795
+ },
796
+ disabled: {
797
+ type: "boolean",
798
+ description: "Whether the dropdown menu is disabled",
799
+ defaultValueHint: false
800
+ },
801
+ arrow: {
802
+ type: "boolean",
803
+ description: "Whether the dropdown arrow should be visible",
804
+ defaultValueHint: false,
805
+ advanced: true
806
+ },
807
+ placement: {
808
+ type: "choice",
809
+ options: [
810
+ "bottomLeft",
811
+ "bottomCenter",
812
+ "bottomRight",
813
+ "topLeft",
814
+ "topCenter",
815
+ "topRight"
816
+ ],
817
+ description: "Placement of popup menu",
818
+ defaultValueHint: "bottomLeft",
819
+ advanced: true
820
+ },
821
+ menuItems: {
822
+ type: "slot",
823
+ allowedComponents: [
824
+ "plasmic-antd5-menu-item",
825
+ "plasmic-antd5-menu-item-group",
826
+ "plasmic-antd5-menu-divider",
827
+ "plasmic-antd5-submenu"
828
+ ],
829
+ defaultValue: [
830
+ {
831
+ type: "component",
832
+ name: "plasmic-antd5-menu-item",
833
+ props: {
834
+ key: "menu-item-1"
835
+ }
836
+ },
837
+ {
838
+ type: "component",
839
+ name: "plasmic-antd5-menu-item",
840
+ props: {
841
+ key: "menu-item-2"
842
+ }
843
+ }
844
+ ],
845
+ renderPropParams: []
846
+ },
847
+ trigger: {
848
+ type: "choice",
849
+ options: ["click", "hover", "contextMenu"],
850
+ description: "The trigger mode which executes the dropdown action",
851
+ defaultValueHint: "hover"
852
+ },
853
+ children: {
854
+ type: "slot",
855
+ defaultValue: [
856
+ {
857
+ type: "default-component",
858
+ kind: "button",
859
+ props: {
860
+ children: {
861
+ type: "text",
862
+ value: "Dropdown"
863
+ }
864
+ }
865
+ }
866
+ ]
867
+ },
868
+ onAction: {
869
+ type: "eventHandler",
870
+ argTypes: [{ name: "key", type: "string" }]
871
+ }
872
+ },
873
+ importPath: "@plasmicpkgs/antd/skinny/registerDropdown",
874
+ importName: "AntdDropdown"
875
+ });
876
+ }
877
+
878
+ const AntdMenu = Menu;
879
+ const AntdMenuDivider = Menu.Divider;
880
+ const AntdMenuItem = Menu.Item;
881
+ const AntdMenuItemGroup = Menu.ItemGroup;
882
+ const AntdSubMenu = Menu.SubMenu;
883
+ function registerMenu(loader) {
884
+ registerComponentHelper(loader, AntdMenu, {
885
+ name: "plasmic-antd5-menu",
886
+ displayName: "Menu",
887
+ props: {
888
+ expandIcon: {
889
+ type: "slot",
890
+ hidePlaceholder: true
891
+ },
892
+ mode: {
893
+ type: "choice",
894
+ options: ["horizontal", "vertical", "inline"],
895
+ description: "Type of menu",
896
+ defaultValueHint: "vertical"
897
+ },
898
+ multiple: {
899
+ type: "boolean",
900
+ description: "Allows selection of multiple items",
901
+ defaultValueHint: false
902
+ },
903
+ triggerSubMenuAction: {
904
+ type: "choice",
905
+ options: ["hover", "click"],
906
+ description: "Which action can trigger submenu open/close",
907
+ defaultValueHint: "hover",
908
+ advanced: true
909
+ },
910
+ children: {
911
+ type: "slot",
912
+ allowedComponents: [
913
+ "plasmic-antd5-menu-item",
914
+ "plasmic-antd5-menu-divider",
915
+ "plasmic-antd5-submenu",
916
+ "plasmic-antd5-menu-group"
917
+ ],
918
+ defaultValue: [
919
+ {
920
+ type: "component",
921
+ name: "plasmic-antd5-menu-item"
922
+ },
923
+ {
924
+ type: "component",
925
+ name: "plasmic-antd5-menu-item"
926
+ }
927
+ ]
928
+ },
929
+ onSelect: {
930
+ type: "eventHandler",
931
+ argTypes: [{ name: "key", type: "string" }]
932
+ }
933
+ },
934
+ importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
935
+ importName: "AntdMenu"
936
+ });
937
+ registerComponentHelper(loader, AntdMenuItem, {
938
+ name: "plasmic-antd5-menu-item",
939
+ displayName: "Menu Item",
940
+ props: {
941
+ danger: {
942
+ type: "boolean",
943
+ description: "Display the danger style",
944
+ defaultValueHint: false
945
+ },
946
+ disabled: {
947
+ type: "boolean",
948
+ description: "Whether disabled select",
949
+ defaultValueHint: false
950
+ },
951
+ key: {
952
+ type: "string",
953
+ description: "Unique ID of the menu item",
954
+ defaultValue: "menuItemKey"
955
+ },
956
+ title: {
957
+ type: "string",
958
+ description: "Set display title for collapsed item"
959
+ },
960
+ children: {
961
+ type: "slot",
962
+ defaultValue: [
963
+ {
964
+ type: "text",
965
+ value: "Option"
966
+ }
967
+ ]
968
+ }
969
+ },
970
+ importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
971
+ importName: "AntdMenuItem",
972
+ parentComponentName: "plasmic-antd5-menu"
973
+ });
974
+ registerComponentHelper(loader, AntdMenuItemGroup, {
975
+ name: "plasmic-antd5-menu-item-group",
976
+ displayName: "Item Group",
977
+ props: {
978
+ title: {
979
+ type: "slot",
980
+ defaultValue: [
981
+ {
982
+ type: "text",
983
+ value: "Group"
984
+ }
985
+ ]
986
+ },
987
+ children: {
988
+ type: "slot",
989
+ allowedComponents: [
990
+ "plasmic-antd5-menu-item",
991
+ "plasmic-antd5-menu-divider",
992
+ "plasmic-antd5-menu-item-group",
993
+ "plasmic-antd5-submenu"
994
+ ],
995
+ defaultValue: [
996
+ {
997
+ type: "component",
998
+ name: "plasmic-antd5-menu-item"
999
+ }
1000
+ ]
1001
+ }
1002
+ },
1003
+ importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
1004
+ importName: "AntdMenuItemGroup",
1005
+ parentComponentName: "plasmic-antd5-menu"
1006
+ });
1007
+ registerComponentHelper(loader, AntdMenuDivider, {
1008
+ name: "plasmic-antd5-menu-divider",
1009
+ displayName: "Menu Divider",
1010
+ props: {
1011
+ dashed: {
1012
+ type: "boolean",
1013
+ description: "Whether line is dashed",
1014
+ defaultValueHint: false
1015
+ }
1016
+ },
1017
+ importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
1018
+ importName: "AntdMenuDivider",
1019
+ parentComponentName: "plasmic-antd5-menu"
1020
+ });
1021
+ registerComponentHelper(loader, AntdSubMenu, {
1022
+ name: "plasmic-antd5-submenu",
1023
+ displayName: "Sub Menu",
1024
+ props: {
1025
+ disabled: {
1026
+ type: "boolean",
1027
+ description: "Whether sub-menu is disabled",
1028
+ defaultValueHint: false
1029
+ },
1030
+ key: {
1031
+ type: "string",
1032
+ description: "Unique ID of the sub-menu",
1033
+ advanced: true
1034
+ },
1035
+ title: {
1036
+ type: "slot",
1037
+ defaultValue: [
1038
+ {
1039
+ type: "text",
1040
+ value: "Sub-menu"
1041
+ }
1042
+ ]
1043
+ },
1044
+ children: {
1045
+ type: "slot",
1046
+ allowedComponents: [
1047
+ "plasmic-antd5-menu-item",
1048
+ "plasmic-antd5-menu-divider",
1049
+ "plasmic-antd5-menu-item-group",
1050
+ "plasmic-antd5-submenu"
1051
+ ],
1052
+ defaultValue: [1, 2].map((i) => ({
1053
+ type: "component",
1054
+ name: "plasmic-antd5-menu-item",
1055
+ props: {
1056
+ key: `subMenuItemKey${i}`,
1057
+ children: [
1058
+ {
1059
+ type: "text",
1060
+ value: `Sub-menu item ${i}`
1061
+ }
1062
+ ]
1063
+ }
1064
+ }))
1065
+ }
1066
+ },
1067
+ importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
1068
+ importName: "AntdSubMenu",
1069
+ parentComponentName: "plasmic-antd5-menu"
1070
+ });
1071
+ }
1072
+
1073
+ var __defProp$3 = Object.defineProperty;
1074
+ var __defProps$2 = Object.defineProperties;
1075
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1076
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1077
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1078
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1079
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1080
+ var __spreadValues$3 = (a, b) => {
1081
+ for (var prop in b || (b = {}))
1082
+ if (__hasOwnProp$3.call(b, prop))
1083
+ __defNormalProp$3(a, prop, b[prop]);
1084
+ if (__getOwnPropSymbols$3)
1085
+ for (var prop of __getOwnPropSymbols$3(b)) {
1086
+ if (__propIsEnum$3.call(b, prop))
1087
+ __defNormalProp$3(a, prop, b[prop]);
1088
+ }
1089
+ return a;
1090
+ };
1091
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1092
+ var __objRest$3 = (source, exclude) => {
1093
+ var target = {};
1094
+ for (var prop in source)
1095
+ if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
1096
+ target[prop] = source[prop];
1097
+ if (source != null && __getOwnPropSymbols$3)
1098
+ for (var prop of __getOwnPropSymbols$3(source)) {
1099
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
1100
+ target[prop] = source[prop];
1101
+ }
1102
+ return target;
1103
+ };
1104
+ function AntdModal(props) {
1105
+ const _a = props, { onOpenChange, onOk, onCancel, open, footer } = _a, rest = __objRest$3(_a, ["onOpenChange", "onOk", "onCancel", "open", "footer"]);
1106
+ const memoOnOk = React.useMemo(() => {
1107
+ if (onOpenChange || onOk) {
1108
+ return (e) => {
1109
+ onOpenChange == null ? void 0 : onOpenChange(false);
1110
+ onOk == null ? void 0 : onOk(e);
1111
+ };
1112
+ } else {
1113
+ return void 0;
1114
+ }
1115
+ }, [onOpenChange, onOk]);
1116
+ const memoOnCancel = React.useMemo(() => {
1117
+ if (onOpenChange || onCancel) {
1118
+ return (e) => {
1119
+ onOpenChange == null ? void 0 : onOpenChange(false);
1120
+ onCancel == null ? void 0 : onCancel(e);
1121
+ };
1122
+ } else {
1123
+ return void 0;
1124
+ }
1125
+ }, [onOpenChange, onCancel]);
1126
+ return /* @__PURE__ */ React.createElement(Modal, __spreadProps$2(__spreadValues$3({}, rest), {
1127
+ onOk: memoOnOk,
1128
+ onCancel: memoOnCancel,
1129
+ open,
1130
+ footer: footer != null ? footer : void 0
1131
+ }));
1132
+ }
1133
+ function registerModal(loader) {
1134
+ registerComponentHelper(loader, AntdModal, {
1135
+ name: "plasmic-antd5-modal",
1136
+ displayName: "Modal",
1137
+ props: {
1138
+ open: {
1139
+ type: "boolean"
1140
+ },
1141
+ children: {
1142
+ type: "slot",
1143
+ defaultValue: {
1144
+ type: "vbox",
1145
+ children: ["Modal content"]
1146
+ }
1147
+ },
1148
+ title: {
1149
+ type: "slot",
1150
+ defaultValue: "Modal title"
1151
+ },
1152
+ footer: {
1153
+ type: "slot",
1154
+ hidePlaceholder: true
1155
+ },
1156
+ closeIcon: {
1157
+ type: "slot",
1158
+ hidePlaceholder: true
1159
+ },
1160
+ onOk: {
1161
+ type: "eventHandler",
1162
+ argTypes: []
1163
+ },
1164
+ onCancel: {
1165
+ type: "eventHandler",
1166
+ argTypes: []
1167
+ },
1168
+ okText: {
1169
+ type: "string",
1170
+ hidden: (ps) => !!ps.footer,
1171
+ advanced: true
1172
+ },
1173
+ cancelText: {
1174
+ type: "string",
1175
+ hidden: (ps) => !!ps.footer,
1176
+ advanced: true
1177
+ },
1178
+ onOpenChange: {
1179
+ type: "eventHandler",
1180
+ argTypes: [{ name: "open", type: "boolean" }]
1181
+ },
1182
+ modalScopeClassName: {
1183
+ type: "styleScopeClass",
1184
+ scopeName: "modal"
1185
+ },
1186
+ modalClassName: {
1187
+ type: "class",
1188
+ displayName: "Modal content styles",
1189
+ noSelf: true,
1190
+ selectors: [
1191
+ {
1192
+ selector: ":modal .ant-modal .ant-modal-content",
1193
+ label: "Base"
1194
+ }
1195
+ ],
1196
+ advanced: true
1197
+ },
1198
+ closeButtonClassName: {
1199
+ type: "class",
1200
+ displayName: "Close button styles",
1201
+ noSelf: true,
1202
+ selectors: [
1203
+ {
1204
+ selector: ":modal .ant-modal .ant-modal-close",
1205
+ label: "Base"
1206
+ }
1207
+ ],
1208
+ advanced: true
1209
+ },
1210
+ defaultStylesClassName: {
1211
+ type: "themeResetClass"
1212
+ }
1213
+ },
1214
+ unstable__states: {
1215
+ open: {
1216
+ type: "writable",
1217
+ valueProp: "open",
1218
+ onChangeProp: "onOpenChange"
1219
+ }
1220
+ },
1221
+ importPath: "@plasmicpkgs/antd5/skinny/registerModal",
1222
+ importName: "AntdModal"
1223
+ });
1224
+ }
1225
+
1226
+ var __defProp$2 = Object.defineProperty;
1227
+ var __defProps$1 = Object.defineProperties;
1228
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1229
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1230
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1231
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1232
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1233
+ var __spreadValues$2 = (a, b) => {
1234
+ for (var prop in b || (b = {}))
1235
+ if (__hasOwnProp$2.call(b, prop))
1236
+ __defNormalProp$2(a, prop, b[prop]);
1237
+ if (__getOwnPropSymbols$2)
1238
+ for (var prop of __getOwnPropSymbols$2(b)) {
1239
+ if (__propIsEnum$2.call(b, prop))
1240
+ __defNormalProp$2(a, prop, b[prop]);
1241
+ }
1242
+ return a;
1243
+ };
1244
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1245
+ var __objRest$2 = (source, exclude) => {
1246
+ var target = {};
1247
+ for (var prop in source)
1248
+ if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
1249
+ target[prop] = source[prop];
1250
+ if (source != null && __getOwnPropSymbols$2)
1251
+ for (var prop of __getOwnPropSymbols$2(source)) {
1252
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
1253
+ target[prop] = source[prop];
1254
+ }
1255
+ return target;
1256
+ };
1257
+ const AntdRadio = Radio;
1258
+ function AntdRadioGroup(props) {
1259
+ const _a = props, { onChange } = _a, rest = __objRest$2(_a, ["onChange"]);
1260
+ const wrappedOnChange = React.useMemo(() => {
1261
+ if (onChange) {
1262
+ return (event) => onChange(event.target.value);
1263
+ } else {
1264
+ return void 0;
1265
+ }
1266
+ }, [onChange]);
1267
+ return /* @__PURE__ */ React.createElement(RadioGroup, __spreadProps$1(__spreadValues$2({}, rest), {
1268
+ onChange: wrappedOnChange
1269
+ }));
1270
+ }
1271
+ function registerRadio(loader) {
1272
+ registerComponentHelper(loader, AntdRadio, {
1273
+ name: "plasmic-antd5-radio",
1274
+ displayName: "Radio",
1275
+ props: {
1276
+ value: {
1277
+ type: "string",
1278
+ description: "The radio option value"
1279
+ },
1280
+ disabled: {
1281
+ type: "boolean",
1282
+ defaultValueHint: false
1283
+ },
1284
+ autoFocus: {
1285
+ type: "boolean",
1286
+ description: "If focused when first shown",
1287
+ defaultValueHint: false,
1288
+ advanced: true
1289
+ },
1290
+ children: {
1291
+ type: "slot",
1292
+ defaultValue: [
1293
+ {
1294
+ type: "text",
1295
+ value: "Radio"
1296
+ }
1297
+ ]
1298
+ }
1299
+ },
1300
+ importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
1301
+ importName: "AntdRadio",
1302
+ parentComponentName: "plasmic-antd5-radio-group"
1303
+ });
1304
+ registerComponentHelper(loader, AntdRadio, {
1305
+ name: "plasmic-antd5-radio-button",
1306
+ displayName: "Radio Button",
1307
+ props: {
1308
+ value: {
1309
+ type: "string",
1310
+ description: "The radio option value"
1311
+ },
1312
+ disabled: {
1313
+ type: "boolean",
1314
+ defaultValueHint: false
1315
+ },
1316
+ autoFocus: {
1317
+ type: "boolean",
1318
+ description: "If focused when first shown",
1319
+ defaultValueHint: false,
1320
+ advanced: true
1321
+ },
1322
+ children: {
1323
+ type: "slot",
1324
+ defaultValue: [
1325
+ {
1326
+ type: "text",
1327
+ value: "Radio"
1328
+ }
1329
+ ]
1330
+ }
1331
+ },
1332
+ importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
1333
+ importName: "AntdRadioButton",
1334
+ parentComponentName: "plasmic-antd5-radio-group"
1335
+ });
1336
+ registerComponentHelper(loader, AntdRadioGroup, {
1337
+ name: "plasmic-antd5-radio-group",
1338
+ displayName: "Radio Group",
1339
+ props: {
1340
+ value: {
1341
+ type: "choice",
1342
+ editOnly: true,
1343
+ uncontrolledProp: "defaultValue",
1344
+ description: "Default selected value",
1345
+ options: (ps) => {
1346
+ const options = /* @__PURE__ */ new Set();
1347
+ traverseReactEltTree(ps.children, (elt) => {
1348
+ var _a;
1349
+ if (typeof ((_a = elt == null ? void 0 : elt.props) == null ? void 0 : _a.value) === "string") {
1350
+ options.add(elt.props.value);
1351
+ }
1352
+ });
1353
+ return Array.from(options.keys());
1354
+ }
1355
+ },
1356
+ disabled: {
1357
+ type: "boolean",
1358
+ description: "Disables all radios",
1359
+ defaultValueHint: false
1360
+ },
1361
+ children: {
1362
+ type: "slot",
1363
+ allowedComponents: [
1364
+ "plasmic-antd5-radio",
1365
+ "plasmic-antd5-radio-button"
1366
+ ]
1367
+ },
1368
+ onChange: {
1369
+ type: "eventHandler",
1370
+ argTypes: [{ name: "value", type: "string" }]
1371
+ }
1372
+ },
1373
+ unstable__states: {
1374
+ value: {
1375
+ type: "writable",
1376
+ valueProp: "value",
1377
+ onChangeProp: "onChange"
1378
+ }
1379
+ },
1380
+ importPath: "@plasmicapp/antd5/skinny/registerRadio",
1381
+ importName: "AntdRadioGroup"
1382
+ });
1383
+ }
1384
+
509
1385
  var __defProp$1 = Object.defineProperty;
510
1386
  var __defProps = Object.defineProperties;
511
1387
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
@@ -606,6 +1482,10 @@ function registerSelect(loader) {
606
1482
  type: "choice",
607
1483
  options: ["small", "middle", "large"]
608
1484
  },
1485
+ disabled: {
1486
+ type: "boolean",
1487
+ defaultValueHint: false
1488
+ },
609
1489
  showSearch: {
610
1490
  type: "boolean",
611
1491
  defaultValueHint: false,
@@ -623,6 +1503,7 @@ function registerSelect(loader) {
623
1503
  autoFocus: {
624
1504
  type: "boolean",
625
1505
  displayName: "Focus automatically",
1506
+ defaultValueHint: false,
626
1507
  advanced: true
627
1508
  },
628
1509
  onChange: {
@@ -997,6 +1878,12 @@ function registerAll(loader) {
997
1878
  registerTokens(loader);
998
1879
  registerSelect(loader);
999
1880
  registerTable(loader);
1881
+ registerCheckbox(loader);
1882
+ registerRadio(loader);
1883
+ registerModal(loader);
1884
+ registerButton(loader);
1885
+ registerMenu(loader);
1886
+ registerDropdown(loader);
1000
1887
  }
1001
1888
 
1002
1889
  export { registerAll };