@carbon-labs/react-ui-shell 0.50.0 → 0.51.0

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 (53) hide show
  1. package/README.md +1 -0
  2. package/es/components/Profile.d.ts +68 -0
  3. package/es/components/Profile.js +141 -0
  4. package/es/components/SideNavLinkPopover.d.ts +2 -2
  5. package/es/index.d.ts +7 -6
  6. package/es/index.js +2 -0
  7. package/es/node_modules/@carbon/ibm-products/es/_virtual/_commonjsHelpers.js +12 -0
  8. package/es/node_modules/@carbon/ibm-products/es/_virtual/_rollupPluginBabelHelpers.js +18 -0
  9. package/es/node_modules/@carbon/ibm-products/es/_virtual/index.js +14 -0
  10. package/es/node_modules/@carbon/ibm-products/es/_virtual/index2.js +12 -0
  11. package/es/node_modules/@carbon/ibm-products/es/components/TooltipTrigger/TooltipTrigger.js +63 -0
  12. package/es/node_modules/@carbon/ibm-products/es/components/UserAvatar/UserAvatar.js +170 -0
  13. package/es/node_modules/@carbon/ibm-products/es/components/_Canary/Canary.js +49 -0
  14. package/es/node_modules/@carbon/ibm-products/es/global/js/package-settings.js +245 -0
  15. package/es/node_modules/@carbon/ibm-products/es/global/js/utils/devtools.js +16 -0
  16. package/es/node_modules/@carbon/ibm-products/es/global/js/utils/pconsole.js +35 -0
  17. package/es/node_modules/@carbon/ibm-products/es/global/js/utils/props-helper.js +46 -0
  18. package/es/node_modules/@carbon/ibm-products/es/node_modules/object-assign/index.js +89 -0
  19. package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/checkPropTypes.js +95 -0
  20. package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/factoryWithThrowingShims.js +64 -0
  21. package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/factoryWithTypeCheckers.js +561 -0
  22. package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/index.js +32 -0
  23. package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/lib/ReactPropTypesSecret.js +18 -0
  24. package/es/node_modules/@carbon/ibm-products/es/node_modules/prop-types/lib/has.js +17 -0
  25. package/es/node_modules/@carbon/ibm-products/es/settings.js +84 -0
  26. package/lib/components/Profile.d.ts +68 -0
  27. package/lib/components/Profile.js +148 -0
  28. package/lib/components/SideNavLinkPopover.d.ts +2 -2
  29. package/lib/index.d.ts +7 -6
  30. package/lib/index.js +2 -0
  31. package/lib/node_modules/@carbon/ibm-products/es/_virtual/_commonjsHelpers.js +14 -0
  32. package/lib/node_modules/@carbon/ibm-products/es/_virtual/_rollupPluginBabelHelpers.js +20 -0
  33. package/lib/node_modules/@carbon/ibm-products/es/_virtual/index.js +19 -0
  34. package/lib/node_modules/@carbon/ibm-products/es/_virtual/index2.js +14 -0
  35. package/lib/node_modules/@carbon/ibm-products/es/components/TooltipTrigger/TooltipTrigger.js +63 -0
  36. package/lib/node_modules/@carbon/ibm-products/es/components/UserAvatar/UserAvatar.js +170 -0
  37. package/lib/node_modules/@carbon/ibm-products/es/components/_Canary/Canary.js +51 -0
  38. package/lib/node_modules/@carbon/ibm-products/es/global/js/package-settings.js +251 -0
  39. package/lib/node_modules/@carbon/ibm-products/es/global/js/utils/devtools.js +20 -0
  40. package/lib/node_modules/@carbon/ibm-products/es/global/js/utils/pconsole.js +45 -0
  41. package/lib/node_modules/@carbon/ibm-products/es/global/js/utils/props-helper.js +48 -0
  42. package/lib/node_modules/@carbon/ibm-products/es/node_modules/object-assign/index.js +91 -0
  43. package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/checkPropTypes.js +97 -0
  44. package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/factoryWithThrowingShims.js +66 -0
  45. package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/factoryWithTypeCheckers.js +563 -0
  46. package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/index.js +34 -0
  47. package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/lib/ReactPropTypesSecret.js +20 -0
  48. package/lib/node_modules/@carbon/ibm-products/es/node_modules/prop-types/lib/has.js +19 -0
  49. package/lib/node_modules/@carbon/ibm-products/es/settings.js +86 -0
  50. package/package.json +4 -3
  51. package/scss/styles/_header.scss +7 -0
  52. package/scss/styles/_profile.scss +63 -0
  53. package/scss/ui-shell.scss +1 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
11
+ var React = require('react');
12
+ var index$1 = require('../../_virtual/index.js');
13
+ var index = require('../../../../../../_virtual/index.js');
14
+ var packageSettings = require('../../global/js/package-settings.js');
15
+ var react = require('@carbon/react');
16
+
17
+ var _p, _br, _p2, _br2, _p3;
18
+
19
+ // The block part of our conventional BEM class names (blockClass__E--M).
20
+ const blockClass = `${packageSettings.default.prefix}--canary`;
21
+
22
+ /**
23
+ * Canary component used when the component requested is not yet production
24
+ */
25
+ const Canary = (_ref /*, originalArgs*/) => {
26
+ let {
27
+ className,
28
+ componentName,
29
+ ...rest
30
+ } = _ref;
31
+ const instructions = `
32
+ import { pkg } from '@carbon/ibm-products';
33
+ // NOTE: must happen before component is first used
34
+ pkg.component.${componentName} = true;
35
+ `;
36
+ return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
37
+ className: index.default(blockClass, className)
38
+ }), /*#__PURE__*/React.createElement("h2", null, "This component ", /*#__PURE__*/React.createElement("strong", null, componentName), " is not ready yet."), _p || (_p = /*#__PURE__*/React.createElement("p", null, "To enable it, initialize package flags before the component is first used.")), _br || (_br = /*#__PURE__*/React.createElement("br", null)), _p2 || (_p2 = /*#__PURE__*/React.createElement("p", null, "e.g. in main.js")), /*#__PURE__*/React.createElement(react.CodeSnippet, {
39
+ type: "multi"
40
+ }, instructions), _br2 || (_br2 = /*#__PURE__*/React.createElement("br", null)), _p3 || (_p3 = /*#__PURE__*/React.createElement("p", null, "View a live example on", ' ', /*#__PURE__*/React.createElement("a", {
41
+ href: "https://codesandbox.io/s/example-component-olif5?file=/src/config.js"
42
+ }, "codesandbox"), ".")));
43
+ };
44
+ Canary.propTypes = {
45
+ /** Provide an optional class to be applied to the containing node */
46
+ className: index$1.default.string,
47
+ /** Name of the component that is not ready yet */
48
+ componentName: index$1.default.string.isRequired
49
+ };
50
+
51
+ exports.Canary = Canary;
@@ -0,0 +1,251 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ // Copyright IBM Corp. 2020, 2024
13
+ //
14
+ // This source code is licensed under the Apache-2.0 license found in the
15
+ // LICENSE file in the root directory of this source tree.
16
+ //
17
+
18
+ const defaults = {
19
+ prefix: 'c4p',
20
+ // by default only released components are set to true
21
+ component: {
22
+ // reviewed and released components:
23
+ AboutModal: true,
24
+ APIKeyModal: true,
25
+ Cascade: true,
26
+ Checklist: true,
27
+ CreateModal: true,
28
+ CreateFullPage: true,
29
+ CreateFullPageStep: true,
30
+ CreateSidePanel: true,
31
+ CreateTearsheetNarrow: true,
32
+ CreateTearsheet: true,
33
+ CreateTearsheetStep: true,
34
+ CreateTearsheetDivider: true,
35
+ Datagrid: true,
36
+ EditInPlace: true,
37
+ EmptyState: true,
38
+ ErrorEmptyState: true,
39
+ ExportModal: true,
40
+ ExpressiveCard: true,
41
+ FullPageError: true,
42
+ HTTPError403: true,
43
+ HTTPError404: true,
44
+ HTTPErrorOther: true,
45
+ ImportModal: true,
46
+ MultiAddSelect: true,
47
+ NotificationsPanel: true,
48
+ NoDataEmptyState: true,
49
+ NoTagsEmptyState: true,
50
+ NotFoundEmptyState: true,
51
+ NotificationsEmptyState: true,
52
+ OptionsTile: true,
53
+ PageHeader: true,
54
+ ProductiveCard: true,
55
+ RemoveModal: true,
56
+ Saving: true,
57
+ SidePanel: true,
58
+ SingleAddSelect: true,
59
+ StatusIcon: true,
60
+ TagSet: true,
61
+ Tearsheet: true,
62
+ TearsheetNarrow: true,
63
+ UnauthorizedEmptyState: true,
64
+ UserProfileImage: true,
65
+ WebTerminal: true,
66
+ WebTerminalContentWrapper: true,
67
+ WebTerminalProvider: true,
68
+ UserAvatar: true,
69
+ // other public components not yet reviewed and released:
70
+ Toolbar: false,
71
+ ToolbarButton: false,
72
+ ToolbarGroup: false,
73
+ EditSidePanel: false,
74
+ CancelableTextEdit: false,
75
+ DataSpreadsheet: false,
76
+ EditTearsheet: false,
77
+ EditTearsheetForm: false,
78
+ EditTearsheetNarrow: false,
79
+ EditFullPage: false,
80
+ EditUpdateCards: false,
81
+ Nav: false,
82
+ NavItem: false,
83
+ NavList: false,
84
+ BigNumbers: false,
85
+ TruncatedList: false,
86
+ DelimitedList: false,
87
+ ScrollGradient: false,
88
+ StringFormatter: false,
89
+ StatusIndicator: false,
90
+ StatusIndicatorStep: false,
91
+ TagOverflow: false,
92
+ ActionBar: false,
93
+ FilterPanel: false,
94
+ FilterPanelAccordion: false,
95
+ FilterPanelAccordionItem: false,
96
+ FilterPanelCheckbox: false,
97
+ FilterPanelCheckboxWithOverflow: false,
98
+ FilterPanelGroup: false,
99
+ FilterPanelLabel: false,
100
+ FilterPanelSearch: false,
101
+ ConditionBuilder: false,
102
+ GetStartedCard: false,
103
+ /* new component flags here - comment used by generate CLI */
104
+
105
+ // Onboarding components not yet reviewed and released:
106
+ Coachmark: false,
107
+ CoachmarkBeacon: false,
108
+ CoachmarkButton: false,
109
+ CoachmarkFixed: false,
110
+ CoachmarkOverlayElement: false,
111
+ CoachmarkOverlayElements: false,
112
+ CoachmarkStack: false,
113
+ Decorator: false,
114
+ DecoratorLink: false,
115
+ DecoratorSingleButton: false,
116
+ DecoratorDualButton: false,
117
+ DescriptionList: false,
118
+ DescriptionListBody: false,
119
+ DescriptionListCell: false,
120
+ DescriptionListRow: false,
121
+ SearchBar: false,
122
+ /* new component flags here - comment used by generate CLI */
123
+
124
+ // Onboarding components not yet reviewed and released:
125
+ EmptyStateV2: false,
126
+ Guidebanner: false,
127
+ GuidebannerElement: false,
128
+ GuidebannerElementButton: false,
129
+ GuidebannerElementLink: false,
130
+ InlineTip: false,
131
+ InlineTipButton: false,
132
+ InlineTipLink: false,
133
+ InterstitialScreen: false,
134
+ NonLinearReading: false
135
+ },
136
+ // feature level flags
137
+ feature: {
138
+ 'default-portal-target-body': true,
139
+ 'Datagrid.useInlineEdit': false,
140
+ 'Datagrid.useEditableCell': false,
141
+ 'Datagrid.useCustomizeColumns': false,
142
+ 'ExampleComponent.secondaryIcon': false,
143
+ 'ExampleComponent.useExample': false
144
+ }
145
+ };
146
+ const warningMessageComponent = property => `Carbon for IBM Products (WARNING): Component "${property}" enabled via feature flags. This component has not yet completed its review process.`;
147
+ const warningMessageFeature = property => `Carbon for IBM Products (WARNING): Feature "${property}" enabled via feature flags.`;
148
+ const errorMessageFeature = property => `Carbon for IBM Products (Error): Feature "${property}" not enabled. To enable see the notes on feature flags in the README.`;
149
+ const warningMessageAllComponents = 'Carbon for IBM Products (WARNING): All components enabled through use of setAllComponents. This includes components that have not yet completed their review process.';
150
+ const warningMessageAllFeatures = 'Carbon for IBM Products (WARNING): All features enabled through use of setAllFeatures';
151
+
152
+ // Values to represent overrides for component or feature settings.
153
+ // Each value maps the initial value to the value that should be returned.
154
+ const all = {
155
+ INITIAL: v => v,
156
+ ON: () => true,
157
+ OFF: () => false
158
+ };
159
+ let allComponents = all.INITIAL;
160
+ let allFeatures = all.INITIAL;
161
+ let silent = false;
162
+ const component = new Proxy({
163
+ ...defaults.component
164
+ }, {
165
+ set(target, property, value) {
166
+ if (target[property] !== true && !silent && value) {
167
+ // not already true, not silent, and now true
168
+ console.warn(warningMessageComponent(property));
169
+ }
170
+ target[property] = value;
171
+ return true; // value set
172
+ },
173
+ get(target, property) {
174
+ return allComponents(target[property] ?? false);
175
+ }
176
+ });
177
+ const feature = new Proxy({
178
+ ...defaults.feature
179
+ }, {
180
+ set(target, property, value) {
181
+ // If we receive a feature flag that doesn't exist in our defaults we should not log
182
+ // a warning message and instead just return
183
+ if (!Object.getOwnPropertyDescriptor(defaults.feature, property)) {
184
+ return true;
185
+ }
186
+ if (target[property] !== true && !silent && value) {
187
+ // not already true, not silent, and now true
188
+ console.warn(warningMessageFeature(property));
189
+ }
190
+ target[property] = value;
191
+ return true; // value set
192
+ },
193
+ get(target, property) {
194
+ return allFeatures(target[property] ?? false);
195
+ }
196
+ });
197
+ const devtoolsAttribute = 'data-carbon-devtools-id';
198
+ function getDevtoolsId(componentName) {
199
+ return `${defaults.prefix}--${componentName}`;
200
+ }
201
+ var pkg = {
202
+ devtoolsAttribute,
203
+ getDevtoolsId,
204
+ prefix: defaults.prefix,
205
+ component: component,
206
+ feature: feature,
207
+ isComponentEnabled: function (componentOrName) {
208
+ let byDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
209
+ const componentName = componentOrName?.displayName || componentOrName?.name || componentOrName;
210
+ return byDefault ? defaults.component[componentName] : component[componentName];
211
+ },
212
+ isComponentPublic: function (componentOrName) {
213
+ let byDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
214
+ const componentName = componentOrName?.displayName || componentOrName?.name || componentOrName;
215
+ return Object.prototype.hasOwnProperty.call(byDefault ? defaults.component : component, componentName);
216
+ },
217
+ isFeatureEnabled: function (featureName) {
218
+ let byDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
219
+ return byDefault ? defaults.feature[featureName] : feature[featureName];
220
+ },
221
+ checkReportFeatureEnabled(featureName) {
222
+ if (feature[featureName]) {
223
+ // NOTE: Warning emitted if feature flag is enabled (see Proxy above)
224
+ return true;
225
+ } else {
226
+ console.error(errorMessageFeature(featureName));
227
+ }
228
+ },
229
+ isFeaturePublic: function (featureName) {
230
+ let byDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
231
+ return Object.prototype.hasOwnProperty.call(byDefault ? defaults.feature : feature, featureName);
232
+ },
233
+ setAllComponents: enabled => {
234
+ enabled === true && !silent && console.warn(warningMessageAllComponents);
235
+ allComponents = enabled === true ? all.ON : enabled === false ? all.OFF : all.INITIAL;
236
+ },
237
+ setAllFeatures: enabled => {
238
+ enabled === true && !silent && console.warn(warningMessageAllFeatures);
239
+ allFeatures = enabled === true ? all.ON : enabled === false ? all.OFF : all.INITIAL;
240
+ },
241
+ _silenceWarnings: value => {
242
+ // This will suppress console warnings when components or feature flags
243
+ // are enabled, and should only be used when this is not an issue, such
244
+ // as in internal test suites and storybook builds.
245
+ silent = value;
246
+ }
247
+ };
248
+
249
+ exports.default = pkg;
250
+ exports.devtoolsAttribute = devtoolsAttribute;
251
+ exports.getDevtoolsId = getDevtoolsId;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ var packageSettings = require('../package-settings.js');
11
+
12
+ function getDevtoolsProps(componentName) {
13
+ return {
14
+ [packageSettings.devtoolsAttribute]: packageSettings.getDevtoolsId(componentName)
15
+ };
16
+ }
17
+
18
+ exports.devtoolsAttribute = packageSettings.devtoolsAttribute;
19
+ exports.getDevtoolsId = packageSettings.getDevtoolsId;
20
+ exports.getDevtoolsProps = getDevtoolsProps;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ // Copyright IBM Corp. 2020, 2021
13
+ //
14
+ // This source code is licensed under the Apache-2.0 license found in the
15
+ // LICENSE file in the root directory of this source tree.
16
+ //
17
+
18
+ const isProduction = process.env.NODE_ENV === 'production';
19
+ const noop = () => undefined;
20
+ const shimIfProduction = fn => isProduction ? noop : fn;
21
+ const log = shimIfProduction(function () {
22
+ return console.log(...arguments);
23
+ });
24
+ const warn = shimIfProduction(function () {
25
+ return console.warn(...arguments);
26
+ });
27
+ const error = shimIfProduction(function () {
28
+ return console.error(...arguments);
29
+ });
30
+ var pconsole = {
31
+ isProduction,
32
+ noop,
33
+ shimIfProduction,
34
+ log,
35
+ warn,
36
+ error
37
+ };
38
+
39
+ exports.default = pconsole;
40
+ exports.error = error;
41
+ exports.isProduction = isProduction;
42
+ exports.log = log;
43
+ exports.noop = noop;
44
+ exports.shimIfProduction = shimIfProduction;
45
+ exports.warn = warn;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ require('react');
11
+ var index = require('../../../_virtual/index.js');
12
+ var pconsole = require('./pconsole.js');
13
+
14
+ /**
15
+ * A prop-types validation function that takes a type checkers and a condition
16
+ * function and invokes either the type checker or the isRequired variant of
17
+ * the type checker according to whether the condition function returns false
18
+ * or true when called with the full set of props. This can be useful to make
19
+ * a prop conditionally required. The function also has a decorate function
20
+ * which can be used to add isRequiredIf to any existing type which already has
21
+ * an isRequired variant, and this is automatically applied to the simple type
22
+ * checkers in PropTypes when this props-helper module is imported. The second
23
+ * example produces better results with DocGen and Storybook.
24
+ *
25
+ * Examples:
26
+ *
27
+ * MyComponent1.propTypes = {
28
+ * showFoo: PropTypes.bool,
29
+ * fooLabel: isRequiredIf(PropTypes.string, ({ showFoo }) => showFoo),
30
+ * }
31
+ *
32
+ * MyComponent2.propTypes = {
33
+ * showBar: PropTypes.bool,
34
+ * barLabel: PropTypes.string.isRequired.if(({ showBar }) => showBar),
35
+ * }
36
+ *
37
+ */
38
+ const isRequiredIf = (checker, conditionFn) => (props, propName, componentName, location, propFullName, secret) => (conditionFn(props) ? checker.isRequired : checker)(props, propName, componentName, location, propFullName, secret);
39
+ isRequiredIf.decorate = checker => {
40
+ checker.isRequired.if = pconsole.default.isProduction ? pconsole.default.noop : isRequiredIf.bind(null, checker);
41
+ };
42
+ for (const checker in index.default) {
43
+ if (index.default[checker].isRequired) {
44
+ isRequiredIf.decorate(index.default[checker]);
45
+ }
46
+ }
47
+
48
+ exports.isRequiredIf = isRequiredIf;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ var objectAssign;
11
+ var hasRequiredObjectAssign;
12
+ function requireObjectAssign() {
13
+ if (hasRequiredObjectAssign) return objectAssign;
14
+ hasRequiredObjectAssign = 1;
15
+ /* eslint-disable no-unused-vars */
16
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
17
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
18
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
19
+ function toObject(val) {
20
+ if (val === null || val === undefined) {
21
+ throw new TypeError('Object.assign cannot be called with null or undefined');
22
+ }
23
+ return Object(val);
24
+ }
25
+ function shouldUseNative() {
26
+ try {
27
+ if (!Object.assign) {
28
+ return false;
29
+ }
30
+
31
+ // Detect buggy property enumeration order in older V8 versions.
32
+
33
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
34
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
35
+ test1[5] = 'de';
36
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
37
+ return false;
38
+ }
39
+
40
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
41
+ var test2 = {};
42
+ for (var i = 0; i < 10; i++) {
43
+ test2['_' + String.fromCharCode(i)] = i;
44
+ }
45
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
46
+ return test2[n];
47
+ });
48
+ if (order2.join('') !== '0123456789') {
49
+ return false;
50
+ }
51
+
52
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
53
+ var test3 = {};
54
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
55
+ test3[letter] = letter;
56
+ });
57
+ if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
58
+ return false;
59
+ }
60
+ return true;
61
+ } catch (err) {
62
+ // We don't expect any of the above to throw, but better to be safe.
63
+ return false;
64
+ }
65
+ }
66
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
67
+ var from;
68
+ var to = toObject(target);
69
+ var symbols;
70
+ for (var s = 1; s < arguments.length; s++) {
71
+ from = Object(arguments[s]);
72
+ for (var key in from) {
73
+ if (hasOwnProperty.call(from, key)) {
74
+ to[key] = from[key];
75
+ }
76
+ }
77
+ if (getOwnPropertySymbols) {
78
+ symbols = getOwnPropertySymbols(from);
79
+ for (var i = 0; i < symbols.length; i++) {
80
+ if (propIsEnumerable.call(from, symbols[i])) {
81
+ to[symbols[i]] = from[symbols[i]];
82
+ }
83
+ }
84
+ }
85
+ }
86
+ return to;
87
+ };
88
+ return objectAssign;
89
+ }
90
+
91
+ exports.__require = requireObjectAssign;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret.js');
11
+ var has = require('./lib/has.js');
12
+
13
+ var checkPropTypes_1;
14
+ var hasRequiredCheckPropTypes;
15
+ function requireCheckPropTypes() {
16
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
17
+ hasRequiredCheckPropTypes = 1;
18
+ var printWarning = function () {};
19
+ if (process.env.NODE_ENV !== 'production') {
20
+ var ReactPropTypesSecret$1 = /*@__PURE__*/ReactPropTypesSecret.__require();
21
+ var loggedTypeFailures = {};
22
+ var has$1 = /*@__PURE__*/has.__require();
23
+ printWarning = function (text) {
24
+ var message = 'Warning: ' + text;
25
+ if (typeof console !== 'undefined') {
26
+ console.error(message);
27
+ }
28
+ try {
29
+ // --- Welcome to debugging React ---
30
+ // This error was thrown as a convenience so that you can use this stack
31
+ // to find the callsite that caused this warning to fire.
32
+ throw new Error(message);
33
+ } catch (x) {/**/}
34
+ };
35
+ }
36
+
37
+ /**
38
+ * Assert that the values match with the type specs.
39
+ * Error messages are memorized and will only be shown once.
40
+ *
41
+ * @param {object} typeSpecs Map of name to a ReactPropType
42
+ * @param {object} values Runtime values that need to be type-checked
43
+ * @param {string} location e.g. "prop", "context", "child context"
44
+ * @param {string} componentName Name of the component for error messages.
45
+ * @param {?Function} getStack Returns the component stack.
46
+ * @private
47
+ */
48
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
49
+ if (process.env.NODE_ENV !== 'production') {
50
+ for (var typeSpecName in typeSpecs) {
51
+ if (has$1(typeSpecs, typeSpecName)) {
52
+ var error;
53
+ // Prop type validation may throw. In case they do, we don't want to
54
+ // fail the render phase where it didn't fail before. So we log it.
55
+ // After these have been cleaned up, we'll let them throw.
56
+ try {
57
+ // This is intentionally an invariant that gets caught. It's the same
58
+ // behavior as without this statement except with a better message.
59
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
60
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
61
+ err.name = 'Invariant Violation';
62
+ throw err;
63
+ }
64
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
65
+ } catch (ex) {
66
+ error = ex;
67
+ }
68
+ if (error && !(error instanceof Error)) {
69
+ printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
70
+ }
71
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
72
+ // Only monitor this failure once because there tends to be a lot of the
73
+ // same error.
74
+ loggedTypeFailures[error.message] = true;
75
+ var stack = getStack ? getStack() : '';
76
+ printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Resets warning cache when testing.
85
+ *
86
+ * @private
87
+ */
88
+ checkPropTypes.resetWarningCache = function () {
89
+ if (process.env.NODE_ENV !== 'production') {
90
+ loggedTypeFailures = {};
91
+ }
92
+ };
93
+ checkPropTypes_1 = checkPropTypes;
94
+ return checkPropTypes_1;
95
+ }
96
+
97
+ exports.__require = requireCheckPropTypes;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret.js');
11
+
12
+ var factoryWithThrowingShims;
13
+ var hasRequiredFactoryWithThrowingShims;
14
+ function requireFactoryWithThrowingShims() {
15
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
16
+ hasRequiredFactoryWithThrowingShims = 1;
17
+ var ReactPropTypesSecret$1 = /*@__PURE__*/ReactPropTypesSecret.__require();
18
+ function emptyFunction() {}
19
+ function emptyFunctionWithReset() {}
20
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
21
+ factoryWithThrowingShims = function () {
22
+ function shim(props, propName, componentName, location, propFullName, secret) {
23
+ if (secret === ReactPropTypesSecret$1) {
24
+ // It is still safe when called from React.
25
+ return;
26
+ }
27
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
28
+ err.name = 'Invariant Violation';
29
+ throw err;
30
+ }
31
+ shim.isRequired = shim;
32
+ function getShim() {
33
+ return shim;
34
+ }
35
+ // Important!
36
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
37
+ var ReactPropTypes = {
38
+ array: shim,
39
+ bigint: shim,
40
+ bool: shim,
41
+ func: shim,
42
+ number: shim,
43
+ object: shim,
44
+ string: shim,
45
+ symbol: shim,
46
+ any: shim,
47
+ arrayOf: getShim,
48
+ element: shim,
49
+ elementType: shim,
50
+ instanceOf: getShim,
51
+ node: shim,
52
+ objectOf: getShim,
53
+ oneOf: getShim,
54
+ oneOfType: getShim,
55
+ shape: getShim,
56
+ exact: getShim,
57
+ checkPropTypes: emptyFunctionWithReset,
58
+ resetWarningCache: emptyFunction
59
+ };
60
+ ReactPropTypes.PropTypes = ReactPropTypes;
61
+ return ReactPropTypes;
62
+ };
63
+ return factoryWithThrowingShims;
64
+ }
65
+
66
+ exports.__require = requireFactoryWithThrowingShims;