@redsift/design-system 11.8.2 → 11.8.3
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/_internal/AppBar.js +1 -1
- package/_internal/AppContainer.js +2 -2
- package/_internal/AppContent.js +1 -1
- package/_internal/Card2.js.map +1 -1
- package/_internal/DetailedCard.js +1 -1
- package/_internal/NumberField.js +1 -1
- package/_internal/NumberField.js.map +1 -1
- package/_internal/SideNavigationMenu.js +1 -1
- package/_internal/SideNavigationMenu.js.map +1 -1
- package/_internal/SideNavigationMenuItem.js.map +1 -1
- package/_internal/TextArea.js.map +1 -1
- package/_internal/TextField.js.map +1 -1
- package/_internal/app-container.js +1 -1
- package/_internal/context.js +297 -3
- package/_internal/context.js.map +1 -1
- package/_internal/context2.js +3 -297
- package/_internal/context2.js.map +1 -1
- package/_internal/styles3.js.map +1 -1
- package/_internal/useAppSidePanel.js +1 -1
- package/_internal/useLocalizedStringFormatter.js +1 -1
- package/_internal/useMessageFormatter.js +1 -1
- package/_internal/useNumberFormatter.js +1 -1
- package/_internal/useSideNavigationMenuBar.js +1 -1
- package/index.d.ts +167 -167
- package/index.js +7 -7
- package/package.json +3 -3
package/_internal/context2.js
CHANGED
|
@@ -1,300 +1,6 @@
|
|
|
1
|
-
import React__default
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
// @ts-nocheck
|
|
5
|
-
/*
|
|
6
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
7
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
-
* governing permissions and limitations under the License.
|
|
15
|
-
*/
|
|
3
|
+
const AppContainerContext = /*#__PURE__*/React__default.createContext(null);
|
|
16
4
|
|
|
17
|
-
|
|
18
|
-
const RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']);
|
|
19
|
-
const RTL_LANGS = new Set(['ae', 'ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', 'ku', 'mzn', 'nqo', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi']);
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}.
|
|
23
|
-
*/
|
|
24
|
-
function isRTL(localeString) {
|
|
25
|
-
// If the Intl.Locale API is available, use it to get the locale's text direction.
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
if (Intl.Locale) {
|
|
28
|
-
let locale = new Intl.Locale(localeString).maximize();
|
|
29
|
-
|
|
30
|
-
// Use the text info object to get the direction if possible.
|
|
31
|
-
// @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.
|
|
32
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo
|
|
33
|
-
let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;
|
|
34
|
-
if (textInfo) {
|
|
35
|
-
return textInfo.direction === 'rtl';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Fallback: guess using the script.
|
|
39
|
-
// This is more accurate than guessing by language, since languages can be written in multiple scripts.
|
|
40
|
-
if (locale.script) {
|
|
41
|
-
return RTL_SCRIPTS.has(locale.script);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// If not, just guess by the language (first part of the locale)
|
|
46
|
-
let lang = localeString.split('-')[0];
|
|
47
|
-
return RTL_LANGS.has(lang);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* eslint-disable prefer-const */
|
|
51
|
-
|
|
52
|
-
// To support SSR, the auto incrementing id counter is stored in a context. This allows
|
|
53
|
-
// it to be reset on every request to ensure the client and server are consistent.
|
|
54
|
-
// There is also a prefix string that is used to support async loading components
|
|
55
|
-
// Each async boundary must be wrapped in an SSR provider, which appends to the prefix
|
|
56
|
-
// and resets the current id counter. This ensures that async loaded components have
|
|
57
|
-
// consistent ids regardless of the loading order.
|
|
58
|
-
// Default context value to use in case there is no SSRProvider. This is fine for
|
|
59
|
-
// client-only apps. In order to support multiple copies of React Aria potentially
|
|
60
|
-
// being on the page at once, the prefix is set to a random number. SSRProvider
|
|
61
|
-
// will reset this to zero for consistency between server and client, so in the
|
|
62
|
-
// SSR case multiple copies of React Aria is not supported.
|
|
63
|
-
const defaultContext = {
|
|
64
|
-
prefix: String(Math.round(Math.random() * 10000000000)),
|
|
65
|
-
current: 0
|
|
66
|
-
};
|
|
67
|
-
const SSRContext = /*#__PURE__*/React__default.createContext(defaultContext);
|
|
68
|
-
const IsSSRContext = /*#__PURE__*/React__default.createContext(false);
|
|
69
|
-
// This is only used in React < 18.
|
|
70
|
-
function LegacySSRProvider(props) {
|
|
71
|
-
let cur = useContext(SSRContext);
|
|
72
|
-
let counter = useCounter(cur === defaultContext);
|
|
73
|
-
let [isSSR, setIsSSR] = useState(true);
|
|
74
|
-
let value = useMemo(() => ({
|
|
75
|
-
// If this is the first SSRProvider, start with an empty string prefix, otherwise
|
|
76
|
-
// append and increment the counter.
|
|
77
|
-
prefix: cur === defaultContext ? '' : `${cur.prefix}-${counter}`,
|
|
78
|
-
current: 0
|
|
79
|
-
}), [cur, counter]);
|
|
80
|
-
|
|
81
|
-
// If on the client, and the component was initially server rendered,
|
|
82
|
-
// then schedule a layout effect to update the component after hydration.
|
|
83
|
-
if (typeof document !== 'undefined') {
|
|
84
|
-
// This if statement technically breaks the rules of hooks, but is safe
|
|
85
|
-
// because the condition never changes after mounting.
|
|
86
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
87
|
-
useLayoutEffect(() => {
|
|
88
|
-
setIsSSR(false);
|
|
89
|
-
}, []);
|
|
90
|
-
}
|
|
91
|
-
return /*#__PURE__*/React__default.createElement(SSRContext.Provider, {
|
|
92
|
-
value: value
|
|
93
|
-
}, /*#__PURE__*/React__default.createElement(IsSSRContext.Provider, {
|
|
94
|
-
value: isSSR
|
|
95
|
-
}, props.children));
|
|
96
|
-
}
|
|
97
|
-
let warnedAboutSSRProvider = false;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* When using SSR with React Aria in React 16 or 17, applications must be wrapped in an SSRProvider.
|
|
101
|
-
* This ensures that auto generated ids are consistent between the client and server.
|
|
102
|
-
*/
|
|
103
|
-
function SSRProvider(props) {
|
|
104
|
-
if (typeof React__default['useId'] === 'function') {
|
|
105
|
-
if (process.env.NODE_ENV !== 'test' && !warnedAboutSSRProvider) {
|
|
106
|
-
console.warn('In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.');
|
|
107
|
-
warnedAboutSSRProvider = true;
|
|
108
|
-
}
|
|
109
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, props.children);
|
|
110
|
-
}
|
|
111
|
-
return /*#__PURE__*/React__default.createElement(LegacySSRProvider, props);
|
|
112
|
-
}
|
|
113
|
-
let canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
114
|
-
let componentIds = new WeakMap();
|
|
115
|
-
function useCounter() {
|
|
116
|
-
let isDisabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
117
|
-
let ctx = useContext(SSRContext);
|
|
118
|
-
let ref = useRef(null);
|
|
119
|
-
if (ref.current === null && !isDisabled) {
|
|
120
|
-
var _React$__SECRET_INTER, _React$__SECRET_INTER2;
|
|
121
|
-
// In strict mode, React renders components twice, and the ref will be reset to null on the second render.
|
|
122
|
-
// This means our id counter will be incremented twice instead of once. This is a problem because on the
|
|
123
|
-
// server, components are only rendered once and so ids generated on the server won't match the client.
|
|
124
|
-
// In React 18, useId was introduced to solve this, but it is not available in older versions. So to solve this
|
|
125
|
-
// we need to use some React internals to access the underlying Fiber instance, which is stable between renders.
|
|
126
|
-
// This is exposed as ReactCurrentOwner in development, which is all we need since StrictMode only runs in development.
|
|
127
|
-
// To ensure that we only increment the global counter once, we store the starting id for this component in
|
|
128
|
-
// a weak map associated with the Fiber. On the second render, we reset the global counter to this value.
|
|
129
|
-
// Since React runs the second render immediately after the first, this is safe.
|
|
130
|
-
// @ts-ignore
|
|
131
|
-
let currentOwner = (_React$__SECRET_INTER = React__default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React$__SECRET_INTER === void 0 ? void 0 : (_React$__SECRET_INTER2 = _React$__SECRET_INTER.ReactCurrentOwner) === null || _React$__SECRET_INTER2 === void 0 ? void 0 : _React$__SECRET_INTER2.current;
|
|
132
|
-
if (currentOwner) {
|
|
133
|
-
let prevComponentValue = componentIds.get(currentOwner);
|
|
134
|
-
if (prevComponentValue == null) {
|
|
135
|
-
// On the first render, and first call to useId, store the id and state in our weak map.
|
|
136
|
-
componentIds.set(currentOwner, {
|
|
137
|
-
id: ctx.current,
|
|
138
|
-
state: currentOwner.memoizedState
|
|
139
|
-
});
|
|
140
|
-
} else if (currentOwner.memoizedState !== prevComponentValue.state) {
|
|
141
|
-
// On the second render, the memoizedState gets reset by React.
|
|
142
|
-
// Reset the counter, and remove from the weak map so we don't
|
|
143
|
-
// do this for subsequent useId calls.
|
|
144
|
-
ctx.current = prevComponentValue.id;
|
|
145
|
-
componentIds.delete(currentOwner);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
ref.current = ++ctx.current;
|
|
149
|
-
}
|
|
150
|
-
return ref.current;
|
|
151
|
-
}
|
|
152
|
-
function useLegacySSRSafeId(defaultId) {
|
|
153
|
-
let ctx = useContext(SSRContext);
|
|
154
|
-
|
|
155
|
-
// If we are rendering in a non-DOM environment, and there's no SSRProvider,
|
|
156
|
-
// provide a warning to hint to the developer to add one.
|
|
157
|
-
if (ctx === defaultContext && !canUseDOM) {
|
|
158
|
-
console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');
|
|
159
|
-
}
|
|
160
|
-
let counter = useCounter(!!defaultId);
|
|
161
|
-
let prefix = ctx === defaultContext && process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${ctx.prefix}`;
|
|
162
|
-
return defaultId || `${prefix}-${counter}`;
|
|
163
|
-
}
|
|
164
|
-
function useModernSSRSafeId(defaultId) {
|
|
165
|
-
// @ts-ignore
|
|
166
|
-
let id = React__default.useId();
|
|
167
|
-
let [didSSR] = useState(useIsSSR());
|
|
168
|
-
let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${defaultContext.prefix}`;
|
|
169
|
-
return defaultId || `${prefix}-${id}`;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Use React.useId in React 18 if available, otherwise fall back to our old implementation.
|
|
173
|
-
/** @private */
|
|
174
|
-
const useSSRSafeId = typeof React__default['useId'] === 'function' ? useModernSSRSafeId : useLegacySSRSafeId;
|
|
175
|
-
function getSnapshot() {
|
|
176
|
-
return false;
|
|
177
|
-
}
|
|
178
|
-
function getServerSnapshot() {
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
183
|
-
function subscribe(onStoreChange) {
|
|
184
|
-
// noop
|
|
185
|
-
return () => {};
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Returns whether the component is currently being server side rendered or
|
|
190
|
-
* hydrated on the client. Can be used to delay browser-specific rendering
|
|
191
|
-
* until after hydration.
|
|
192
|
-
*/
|
|
193
|
-
function useIsSSR() {
|
|
194
|
-
// In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating.
|
|
195
|
-
if (typeof React__default['useSyncExternalStore'] === 'function') {
|
|
196
|
-
return React__default['useSyncExternalStore'](subscribe, getSnapshot, getServerSnapshot);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
200
|
-
return useContext(IsSSRContext);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/* eslint-disable prefer-const */
|
|
204
|
-
// Locale passed from server by PackageLocalizationProvider.
|
|
205
|
-
const localeSymbol = Symbol.for('react-aria.i18n.locale');
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Gets the locale setting of the browser.
|
|
209
|
-
*/
|
|
210
|
-
function getDefaultLocale() {
|
|
211
|
-
let locale = typeof window !== 'undefined' && window[localeSymbol] ||
|
|
212
|
-
// @ts-ignore
|
|
213
|
-
typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US';
|
|
214
|
-
try {
|
|
215
|
-
// @ts-ignore
|
|
216
|
-
Intl.DateTimeFormat.supportedLocalesOf([locale]);
|
|
217
|
-
} catch (_err) {
|
|
218
|
-
locale = 'en-US';
|
|
219
|
-
}
|
|
220
|
-
return {
|
|
221
|
-
locale,
|
|
222
|
-
direction: isRTL(locale) ? 'rtl' : 'ltr'
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
let currentLocale = getDefaultLocale();
|
|
226
|
-
let listeners = new Set();
|
|
227
|
-
function updateLocale() {
|
|
228
|
-
currentLocale = getDefaultLocale();
|
|
229
|
-
for (let listener of listeners) {
|
|
230
|
-
listener(currentLocale);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Returns the current browser/system language, and updates when it changes.
|
|
236
|
-
*/
|
|
237
|
-
function useDefaultLocale() {
|
|
238
|
-
let isSSR = useIsSSR();
|
|
239
|
-
let [defaultLocale, setDefaultLocale] = useState(currentLocale);
|
|
240
|
-
useEffect(() => {
|
|
241
|
-
if (listeners.size === 0) {
|
|
242
|
-
window.addEventListener('languagechange', updateLocale);
|
|
243
|
-
}
|
|
244
|
-
listeners.add(setDefaultLocale);
|
|
245
|
-
return () => {
|
|
246
|
-
listeners.delete(setDefaultLocale);
|
|
247
|
-
if (listeners.size === 0) {
|
|
248
|
-
window.removeEventListener('languagechange', updateLocale);
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
}, []);
|
|
252
|
-
|
|
253
|
-
// We cannot determine the browser's language on the server, so default to
|
|
254
|
-
// en-US. This will be updated after hydration on the client to the correct value.
|
|
255
|
-
if (isSSR) {
|
|
256
|
-
return {
|
|
257
|
-
locale: 'en-US',
|
|
258
|
-
direction: 'ltr'
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
return defaultLocale;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/* eslint-disable prefer-const */
|
|
265
|
-
const I18nContext = /*#__PURE__*/React__default.createContext(null);
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Provides the locale for the application to all child components.
|
|
269
|
-
*/
|
|
270
|
-
function I18nProvider(props) {
|
|
271
|
-
let {
|
|
272
|
-
locale,
|
|
273
|
-
children
|
|
274
|
-
} = props;
|
|
275
|
-
let defaultLocale = useDefaultLocale();
|
|
276
|
-
let value = React__default.useMemo(() => {
|
|
277
|
-
if (!locale) {
|
|
278
|
-
return defaultLocale;
|
|
279
|
-
}
|
|
280
|
-
return {
|
|
281
|
-
locale,
|
|
282
|
-
direction: isRTL(locale) ? 'rtl' : 'ltr'
|
|
283
|
-
};
|
|
284
|
-
}, [defaultLocale, locale]);
|
|
285
|
-
return /*#__PURE__*/React__default.createElement(I18nContext.Provider, {
|
|
286
|
-
value: value
|
|
287
|
-
}, children);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Returns the current locale and layout direction.
|
|
292
|
-
*/
|
|
293
|
-
function useLocale() {
|
|
294
|
-
let defaultLocale = useDefaultLocale();
|
|
295
|
-
let context = useContext(I18nContext);
|
|
296
|
-
return context || defaultLocale;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export { I18nProvider as I, SSRProvider as S, useSSRSafeId as a, useIsSSR as b, useLocale as u };
|
|
5
|
+
export { AppContainerContext as A };
|
|
300
6
|
//# sourceMappingURL=context2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context2.js","sources":["../../src/react-aria/react-aria/i18n/utils.ts","../../src/react-aria/react-aria/ssr/SSRProvider.tsx","../../src/react-aria/react-aria/i18n/useDefaultLocale.ts","../../src/react-aria/react-aria/i18n/context.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// https://en.wikipedia.org/wiki/Right-to-left\nconst RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']);\nconst RTL_LANGS = new Set([\n 'ae',\n 'ar',\n 'arc',\n 'bcc',\n 'bqi',\n 'ckb',\n 'dv',\n 'fa',\n 'glk',\n 'he',\n 'ku',\n 'mzn',\n 'nqo',\n 'pnb',\n 'ps',\n 'sd',\n 'ug',\n 'ur',\n 'yi',\n]);\n\n/**\n * Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}.\n */\nexport function isRTL(localeString: string) {\n // If the Intl.Locale API is available, use it to get the locale's text direction.\n // @ts-ignore\n if (Intl.Locale) {\n let locale = new Intl.Locale(localeString).maximize();\n\n // Use the text info object to get the direction if possible.\n // @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo\n let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;\n if (textInfo) {\n return textInfo.direction === 'rtl';\n }\n\n // Fallback: guess using the script.\n // This is more accurate than guessing by language, since languages can be written in multiple scripts.\n if (locale.script) {\n return RTL_SCRIPTS.has(locale.script);\n }\n }\n\n // If not, just guess by the language (first part of the locale)\n let lang = localeString.split('-')[0];\n return RTL_LANGS.has(lang);\n}\n","/* eslint-disable prefer-const */\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We must avoid a circular dependency with @react-aria/utils, and this useLayoutEffect is\n// guarded by a check that it only runs on the client side.\nimport React, { ReactNode, useContext, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\n// To support SSR, the auto incrementing id counter is stored in a context. This allows\n// it to be reset on every request to ensure the client and server are consistent.\n// There is also a prefix string that is used to support async loading components\n// Each async boundary must be wrapped in an SSR provider, which appends to the prefix\n// and resets the current id counter. This ensures that async loaded components have\n// consistent ids regardless of the loading order.\ninterface SSRContextValue {\n prefix: string;\n current: number;\n}\n\n// Default context value to use in case there is no SSRProvider. This is fine for\n// client-only apps. In order to support multiple copies of React Aria potentially\n// being on the page at once, the prefix is set to a random number. SSRProvider\n// will reset this to zero for consistency between server and client, so in the\n// SSR case multiple copies of React Aria is not supported.\nconst defaultContext: SSRContextValue = {\n prefix: String(Math.round(Math.random() * 10000000000)),\n current: 0,\n};\n\nconst SSRContext = React.createContext<SSRContextValue>(defaultContext);\nconst IsSSRContext = React.createContext(false);\n\nexport interface SSRProviderProps {\n /** Your application here. */\n children: ReactNode;\n}\n\n// This is only used in React < 18.\nfunction LegacySSRProvider(props: SSRProviderProps): JSX.Element {\n let cur = useContext(SSRContext);\n let counter = useCounter(cur === defaultContext);\n let [isSSR, setIsSSR] = useState(true);\n let value: SSRContextValue = useMemo(\n () => ({\n // If this is the first SSRProvider, start with an empty string prefix, otherwise\n // append and increment the counter.\n prefix: cur === defaultContext ? '' : `${cur.prefix}-${counter}`,\n current: 0,\n }),\n [cur, counter]\n );\n\n // If on the client, and the component was initially server rendered,\n // then schedule a layout effect to update the component after hydration.\n if (typeof document !== 'undefined') {\n // This if statement technically breaks the rules of hooks, but is safe\n // because the condition never changes after mounting.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return (\n <SSRContext.Provider value={value}>\n <IsSSRContext.Provider value={isSSR}>{props.children}</IsSSRContext.Provider>\n </SSRContext.Provider>\n );\n}\n\nlet warnedAboutSSRProvider = false;\n\n/**\n * When using SSR with React Aria in React 16 or 17, applications must be wrapped in an SSRProvider.\n * This ensures that auto generated ids are consistent between the client and server.\n */\nexport function SSRProvider(props: SSRProviderProps): JSX.Element {\n if (typeof React['useId'] === 'function') {\n if (process.env.NODE_ENV !== 'test' && !warnedAboutSSRProvider) {\n console.warn('In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.');\n warnedAboutSSRProvider = true;\n }\n return <>{props.children}</>;\n }\n return <LegacySSRProvider {...props} />;\n}\n\nlet canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nlet componentIds = new WeakMap();\n\nfunction useCounter(isDisabled = false) {\n let ctx = useContext(SSRContext);\n let ref = useRef<number | null>(null);\n if (ref.current === null && !isDisabled) {\n // In strict mode, React renders components twice, and the ref will be reset to null on the second render.\n // This means our id counter will be incremented twice instead of once. This is a problem because on the\n // server, components are only rendered once and so ids generated on the server won't match the client.\n // In React 18, useId was introduced to solve this, but it is not available in older versions. So to solve this\n // we need to use some React internals to access the underlying Fiber instance, which is stable between renders.\n // This is exposed as ReactCurrentOwner in development, which is all we need since StrictMode only runs in development.\n // To ensure that we only increment the global counter once, we store the starting id for this component in\n // a weak map associated with the Fiber. On the second render, we reset the global counter to this value.\n // Since React runs the second render immediately after the first, this is safe.\n // @ts-ignore\n let currentOwner = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;\n if (currentOwner) {\n let prevComponentValue = componentIds.get(currentOwner);\n if (prevComponentValue == null) {\n // On the first render, and first call to useId, store the id and state in our weak map.\n componentIds.set(currentOwner, {\n id: ctx.current,\n state: currentOwner.memoizedState,\n });\n } else if (currentOwner.memoizedState !== prevComponentValue.state) {\n // On the second render, the memoizedState gets reset by React.\n // Reset the counter, and remove from the weak map so we don't\n // do this for subsequent useId calls.\n ctx.current = prevComponentValue.id;\n componentIds.delete(currentOwner);\n }\n }\n\n ref.current = ++ctx.current;\n }\n\n return ref.current;\n}\n\nfunction useLegacySSRSafeId(defaultId?: string): string {\n let ctx = useContext(SSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider,\n // provide a warning to hint to the developer to add one.\n if (ctx === defaultContext && !canUseDOM) {\n console.warn(\n 'When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.'\n );\n }\n\n let counter = useCounter(!!defaultId);\n let prefix = ctx === defaultContext && process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${ctx.prefix}`;\n return defaultId || `${prefix}-${counter}`;\n}\n\nfunction useModernSSRSafeId(defaultId?: string): string {\n // @ts-ignore\n let id = React.useId();\n let [didSSR] = useState(useIsSSR());\n let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${defaultContext.prefix}`;\n return defaultId || `${prefix}-${id}`;\n}\n\n// Use React.useId in React 18 if available, otherwise fall back to our old implementation.\n/** @private */\nexport const useSSRSafeId = typeof React['useId'] === 'function' ? useModernSSRSafeId : useLegacySSRSafeId;\n\nfunction getSnapshot() {\n return false;\n}\n\nfunction getServerSnapshot() {\n return true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction subscribe(onStoreChange: () => void): () => void {\n // noop\n return () => {};\n}\n\n/**\n * Returns whether the component is currently being server side rendered or\n * hydrated on the client. Can be used to delay browser-specific rendering\n * until after hydration.\n */\nexport function useIsSSR(): boolean {\n // In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating.\n if (typeof React['useSyncExternalStore'] === 'function') {\n return React['useSyncExternalStore'](subscribe, getSnapshot, getServerSnapshot);\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useContext(IsSSRContext);\n}\n","/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { Direction } from '../../react-types/shared';\nimport { isRTL } from './utils';\nimport { useEffect, useState } from 'react';\nimport { useIsSSR } from '../ssr';\n\nexport interface Locale {\n /** The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale. */\n locale: string;\n /** The writing direction for the locale. */\n direction: Direction;\n}\n\n// Locale passed from server by PackageLocalizationProvider.\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\n\n/**\n * Gets the locale setting of the browser.\n */\nexport function getDefaultLocale(): Locale {\n let locale =\n (typeof window !== 'undefined' && window[localeSymbol]) ||\n // @ts-ignore\n (typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage)) ||\n 'en-US';\n\n try {\n // @ts-ignore\n Intl.DateTimeFormat.supportedLocalesOf([locale]);\n } catch (_err) {\n locale = 'en-US';\n }\n return {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr',\n };\n}\n\nlet currentLocale = getDefaultLocale();\nlet listeners = new Set<(locale: Locale) => void>();\n\nfunction updateLocale() {\n currentLocale = getDefaultLocale();\n for (let listener of listeners) {\n listener(currentLocale);\n }\n}\n\n/**\n * Returns the current browser/system language, and updates when it changes.\n */\nexport function useDefaultLocale(): Locale {\n let isSSR = useIsSSR();\n let [defaultLocale, setDefaultLocale] = useState(currentLocale);\n\n useEffect(() => {\n if (listeners.size === 0) {\n window.addEventListener('languagechange', updateLocale);\n }\n\n listeners.add(setDefaultLocale);\n\n return () => {\n listeners.delete(setDefaultLocale);\n if (listeners.size === 0) {\n window.removeEventListener('languagechange', updateLocale);\n }\n };\n }, []);\n\n // We cannot determine the browser's language on the server, so default to\n // en-US. This will be updated after hydration on the client to the correct value.\n if (isSSR) {\n return {\n locale: 'en-US',\n direction: 'ltr',\n };\n }\n\n return defaultLocale;\n}\n","/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { isRTL } from './utils';\nimport { Locale, useDefaultLocale } from './useDefaultLocale';\nimport React, { ReactNode, useContext } from 'react';\n\nexport interface I18nProviderProps {\n /** Contents that should have the locale applied. */\n children: ReactNode;\n /** The locale to apply to the children. */\n locale?: string;\n}\n\nconst I18nContext = React.createContext<Locale | null>(null);\n\n/**\n * Provides the locale for the application to all child components.\n */\nexport function I18nProvider(props: I18nProviderProps) {\n let { locale, children } = props;\n let defaultLocale = useDefaultLocale();\n\n let value: Locale = React.useMemo(() => {\n if (!locale) {\n return defaultLocale;\n }\n\n return {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr',\n };\n }, [defaultLocale, locale]);\n\n return <I18nContext.Provider value={value}>{children}</I18nContext.Provider>;\n}\n\n/**\n * Returns the current locale and layout direction.\n */\nexport function useLocale(): Locale {\n let defaultLocale = useDefaultLocale();\n let context = useContext(I18nContext);\n return context || defaultLocale;\n}\n"],"names":["RTL_SCRIPTS","Set","RTL_LANGS","isRTL","localeString","Intl","Locale","locale","maximize","textInfo","getTextInfo","direction","script","has","lang","split","defaultContext","prefix","String","Math","round","random","current","SSRContext","React","createContext","IsSSRContext","LegacySSRProvider","props","cur","useContext","counter","useCounter","isSSR","setIsSSR","useState","value","useMemo","document","useLayoutEffect","createElement","Provider","children","warnedAboutSSRProvider","SSRProvider","process","env","NODE_ENV","console","warn","Fragment","canUseDOM","Boolean","window","componentIds","WeakMap","isDisabled","arguments","length","undefined","ctx","ref","useRef","_React$__SECRET_INTER","_React$__SECRET_INTER2","currentOwner","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","prevComponentValue","get","set","id","state","memoizedState","delete","useLegacySSRSafeId","defaultId","useModernSSRSafeId","useId","didSSR","useIsSSR","useSSRSafeId","getSnapshot","getServerSnapshot","subscribe","onStoreChange","localeSymbol","Symbol","for","getDefaultLocale","navigator","language","userLanguage","DateTimeFormat","supportedLocalesOf","_err","currentLocale","listeners","updateLocale","listener","useDefaultLocale","defaultLocale","setDefaultLocale","useEffect","size","addEventListener","add","removeEventListener","I18nContext","I18nProvider","useLocale","context"],"mappings":";;AAAA;AACA;AACA;AACA;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AChC,EAAA,IAAIyE,aAAa,GAAGD,gBAAgB,EAAE,CAAA;AAEtC,EAAA,IAAIhE,KAAa,GAAGZ,cAAK,CAACa,OAAO,CAAC,MAAM;IACtC,IAAI,CAAC9B,MAAM,EAAE;AACX,MAAA,OAAO8F,aAAa,CAAA;AACtB,KAAA;IAEA,OAAO;MACL9F,MAAM;AACNI,MAAAA,SAAS,EAAER,KAAK,CAACI,MAAM,CAAC,GAAG,KAAK,GAAG,KAAA;KACpC,CAAA;AACH,GAAC,EAAE,CAAC8F,aAAa,EAAE9F,MAAM,CAAC,CAAC,CAAA;AAE3B,EAAA,oBAAOiB,cAAA,CAAAgB,aAAA,CAACoE,WAAW,CAACnE,QAAQ,EAAA;AAACL,IAAAA,KAAK,EAAEA,KAAAA;AAAM,GAAA,EAAEM,QAA+B,CAAC,CAAA;AAC9E,CAAA;;AAEA;AACA;AACA;AACO,SAASoE,SAASA,GAAW;AAClC,EAAA,IAAIT,aAAa,GAAGD,gBAAgB,EAAE,CAAA;AACtC,EAAA,IAAIW,OAAO,GAAGjF,UAAU,CAAC8E,WAAW,CAAC,CAAA;EACrC,OAAOG,OAAO,IAAIV,aAAa,CAAA;AACjC;;;;"}
|
|
1
|
+
{"version":3,"file":"context2.js","sources":["../../src/components/app-container/context.ts"],"sourcesContent":["import React from 'react';\nimport { AppContainerState } from './types';\n\nexport const AppContainerContext =\n React.createContext<AppContainerState | null>(null);\n"],"names":["AppContainerContext","React","createContext"],"mappings":";;AAGO,MAAMA,mBAAmB,gBAC9BC,cAAK,CAACC,aAAa,CAA2B,IAAI;;;;"}
|
package/_internal/styles3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles3.js","sources":["../../src/components/link/styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledLinkProps } from './types';\nimport { NotificationsColorPalette, NeutralColorPalette, ProductColorPalette } from '
|
|
1
|
+
{"version":3,"file":"styles3.js","sources":["../../src/components/link/styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledLinkProps } from './types';\nimport { NotificationsColorPalette, NeutralColorPalette, ProductColorPalette } from '../../types';\n\n/**\n * Component style.\n */\nexport const StyledLink = styled.a<StyledLinkProps>`\n background: none;\n border: none;\n color: unset;\n cursor: text !important;\n display: inline-flex;\n gap: 4px;\n align-items: center;\n font-family: var(--redsift-typography-link-font-family);\n font-size: var(--redsift-typography-link-font-size);\n font-weight: var(--redsift-typography-link-font-weight);\n height: var(--redsift-typography-link-line-height);\n line-height: var(--redsift-typography-link-line-height);\n padding: unset;\n position: relative;\n text-decoration: none;\n width: fit-content;\n\n ${({ $hasIcons }) =>\n $hasIcons\n ? css`\n bottom: -2px;\n `\n : ''}\n\n ${baseStyling}\n\n ${({ $isDisabled, $color, $theme, $hasIcons }) =>\n !$isDisabled\n ? css`\n ${\n $color && $color === 'radar'\n ? css`\n background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);\n background-clip: text;\n color: transparent;\n\n path {\n fill: url(#${$color}-gradient-default);\n }\n `\n : Object.keys(NotificationsColorPalette).indexOf($color!) !== -1\n ? css`\n &,\n .redsift-icon:not(.colored) {\n color: var(--redsift-color-notifications-${$color}-primary);\n }\n `\n : Object.keys(NeutralColorPalette).indexOf($color!) !== -1\n ? css`\n &,\n .redsift-icon:not(.colored) {\n color: var(--redsift-color-neutral-${$color});\n }\n `\n : Object.keys(ProductColorPalette).indexOf($color!) !== -1\n ? css`\n &,\n .redsift-icon:not(.colored) {\n color: var(--redsift-color-product-${$color});\n }\n `\n : css`\n &,\n .redsift-icon:not(.colored) {\n color: ${$color || css`var(--redsift-color-${$theme}-components-text-primary)`};\n }\n `\n }}\n\n ${\n $color && $color === 'radar' && !$hasIcons\n ? css`\n position: relative;\n\n &:hover,\n &:focus-visible {\n cursor: pointer !important;\n }\n\n &:hover::before,\n &:focus-visible::before {\n content: '';\n position: absolute;\n bottom: 3px;\n width: 100%;\n left: 0;\n height: 1px;\n background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);\n }\n `\n : $color && $color === 'radar' && $hasIcons\n ? css`\n position: relative;\n\n &:hover,\n &:focus-visible {\n cursor: pointer !important;\n }\n\n .text::before {\n content: '';\n position: absolute;\n bottom: 3px;\n width: 100%;\n left: 0;\n height: 1px;\n background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);\n transform: scaleX(0);\n }\n\n &:hover .text::before,\n .icon:hover + .text::before,\n .text:hover::before {\n transform: scaleX(1);\n }\n `\n : css`\n text-decoration: underline;\n text-decoration-color: transparent;\n text-underline-offset: 2px;\n\n &:hover,\n &:focus-visible {\n cursor: pointer !important;\n ${Object.keys(NotificationsColorPalette).indexOf($color!) !== -1\n ? css`\n text-decoration-color: var(--redsift-color-notifications-${$color}-primary);\n `\n : Object.keys(NeutralColorPalette).indexOf($color!) !== -1\n ? css`\n text-decoration-color: var(--redsift-color-neutral-${$color});\n `\n : Object.keys(ProductColorPalette).indexOf($color!) !== -1\n ? css`\n text-decoration-color: var(--redsift-color-product-${$color});\n `\n : css`\n text-decoration-color: ${$color ||\n css`var(--redsift-color-${$theme}-components-text-primary)`};\n `}\n }\n `\n }\n `\n : ''}\n\n &:focus-visible {\n outline: 2px solid var(--redsift-color-primary-n);\n }\n`;\n"],"names":["StyledLink","styled","a","_ref","$hasIcons","css","baseStyling","_ref2","$isDisabled","$color","$theme","Object","keys","NotificationsColorPalette","indexOf","NeutralColorPalette","ProductColorPalette"],"mappings":";;;;AAKA;AACA;AACA;AACaA,MAAAA,UAAU,GAAGC,MAAM,CAACC,CAAmB,CAAA;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,SAAAA;AAAU,GAAC,GAAAD,IAAA,CAAA;EAAA,OACdC,SAAS,GACLC,GAAI,CAAA;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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAiB,CAAA,GACDI,MAAM,IAAIA,MAAM,KAAK,OAAO,IAAIL,SAAS,GACzCC,GAAI,CAAA;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAA,CAAiB,GACDA,GAAI,CAAA;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAA,EAAsBM,MAAM,CAACC,IAAI,CAACC,yBAAyB,CAAC,CAACC,OAAO,CAACL,MAAO,CAAC,KAAK,CAAC,CAAC,GAC5DJ,GAAI,CAAA;AAC5B,mFAAA,EAAqFI,MAAO,CAAA;AAC5F,wBAAA,CAAyB,GACDE,MAAM,CAACC,IAAI,CAACG,mBAAmB,CAAC,CAACD,OAAO,CAACL,MAAO,CAAC,KAAK,CAAC,CAAC,GACxDJ,GAAI,CAAA;AAC5B,6EAAA,EAA+EI,MAAO,CAAA;AACtF,wBAAA,CAAyB,GACDE,MAAM,CAACC,IAAI,CAACI,mBAAmB,CAAC,CAACF,OAAO,CAACL,MAAO,CAAC,KAAK,CAAC,CAAC,GACxDJ,GAAI,CAAA;AAC5B,6EAAA,EAA+EI,MAAO,CAAA;AACtF,wBAAA,CAAyB,GACDJ,GAAI,CAAA;AAC5B,iDAAA,EAAmDI,MAAM,IAC/BJ,GAAI,CAAA,oBAAA,EAAsBK,MAAO,CAA2B,yBAAA,CAAA,CAAA;AACtF,wBAA0B,CAAA,CAAA;AAC1B;AACA,gBACW,CAAA,CAAA;AACX,QAAA,CAAS,GACD,EAAE,CAAA;AAAA,CAAC,CAAA;AACX;AACA;AACA;AACA;AACA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React__default, { useState, useEffect, forwardRef, useContext } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import { A as AppContainerContext } from './
|
|
4
|
+
import { A as AppContainerContext } from './context2.js';
|
|
5
5
|
import styled, { css } from 'styled-components';
|
|
6
6
|
import { A as AppSidePanelVariant } from './types.js';
|
|
7
7
|
import { mdiMenu } from '@redsift/icons';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo, useCallback } from 'react';
|
|
2
|
-
import { u as useLocale } from './
|
|
2
|
+
import { u as useLocale } from './context.js';
|
|
3
3
|
import { a as _defineProperty } from './_rollupPluginBabelHelpers.js';
|
|
4
4
|
import IntlMessageFormat from 'intl-messageformat';
|
|
5
5
|
|
|
@@ -6,7 +6,7 @@ import styled, { css } from 'styled-components';
|
|
|
6
6
|
import { S as SideNavigationMenuBarVariant, b as SideNavigationMenuBarContext, a as SideNavigationMenuItem } from './SideNavigationMenuItem.js';
|
|
7
7
|
import { f as filterComponents } from './filterComponents.js';
|
|
8
8
|
import { a as SideNavigationMenu } from './SideNavigationMenu.js';
|
|
9
|
-
import { A as AppContainerContext } from './
|
|
9
|
+
import { A as AppContainerContext } from './context2.js';
|
|
10
10
|
import { u as useTheme, a as ThemeProvider } from './useTheme.js';
|
|
11
11
|
import { A as AppSidePanelVariant } from './types.js';
|
|
12
12
|
|