@patternfly/patternfly-doc-core 1.6.0 → 1.8.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 (88) hide show
  1. package/.astro/collections/examples.schema.json +19 -0
  2. package/.astro/collections/textContent.schema.json +19 -0
  3. package/.astro/content-modules.mjs +1 -0
  4. package/dist/client/_astro/{PageContext.D1pNBMhh.js → Button.IBWho7ny.js} +2 -2
  5. package/dist/client/_astro/CSSTable.V4xaGXjj.js +1185 -0
  6. package/dist/client/_astro/Content.Dv9vgAns.js +1 -0
  7. package/dist/client/_astro/DropdownGroup.DmTizX-Q.js +1 -0
  8. package/dist/client/_astro/DropdownList.BUcpBUVP.js +1 -0
  9. package/dist/client/_astro/LiveExample.CiM2pGMB.js +18 -0
  10. package/dist/client/_astro/Navigation.CnvE1VCH.js +1 -0
  11. package/dist/client/_astro/PageContext.ipir86Hm.js +1 -0
  12. package/dist/client/_astro/PageSidebarBody.vGxFk_DU.js +1 -0
  13. package/dist/client/_astro/PageToggle.C6_rp-Bm.js +1 -0
  14. package/dist/client/_astro/PageToggleButton.CagcouJB.js +1 -0
  15. package/dist/client/_astro/SearchInput.BwWsXfyf.js +1 -0
  16. package/dist/client/_astro/SectionGallery.DqD5bUWQ.js +1 -0
  17. package/dist/client/_astro/Toolbar.BmilfRHR.js +1 -0
  18. package/dist/client/_astro/ToolbarContent.Cd-kqxku.js +1 -0
  19. package/dist/client/_astro/_page_.BWicMEzd.css +1 -0
  20. package/dist/client/_astro/_page_.Chv_bGyU.css +1 -0
  21. package/dist/client/_astro/angle-left-icon.C3MzYN3k.js +1 -0
  22. package/dist/client/_astro/{client.CTJTt880.js → client.zs76E0tG.js} +1 -1
  23. package/dist/client/_astro/divider.O4WEhuBq.js +1 -0
  24. package/dist/client/_astro/help-icon.Du6t7nyh.js +8 -0
  25. package/dist/client/_astro/{index.Dhi-S4Ah.js → index.BQFV5hT1.js} +1 -1
  26. package/dist/client/_astro/index.BkswdOFP.js +16 -0
  27. package/dist/client/_astro/index.CAChmxYj.js +1 -0
  28. package/dist/client/_astro/{index.Dkaqzkgy.js → index.eCxJ45ll.js} +2 -2
  29. package/dist/client/_astro/page.BTC3Kf3x.js +1 -0
  30. package/dist/client/components/accordion/index.html +42 -17
  31. package/dist/client/components/accordion/react/index.html +110 -0
  32. package/dist/client/components/all-components/index.html +97 -0
  33. package/dist/client/design-foundations/typography/index.html +36 -9
  34. package/dist/client/design-foundations/usage-and-behavior/index.html +36 -9
  35. package/dist/client/get-started/contribute/index.html +36 -9
  36. package/dist/client/index.html +3 -4
  37. package/dist/server/chunks/Button_DVSwQ8oX.mjs +639 -0
  38. package/dist/server/chunks/CSSTable_CG80uW98.mjs +740 -0
  39. package/dist/server/chunks/CSSTable_Dj2CroFz.mjs +4 -0
  40. package/dist/server/chunks/{PropsTables_IgCNCQTX.mjs → PropsTables_DUo7F9VR.mjs} +36 -47
  41. package/dist/server/chunks/Stack_Xm3fJVbK.mjs +22 -0
  42. package/dist/server/chunks/_astro_data-layer-content_D4Ib_RjR.mjs +1 -0
  43. package/dist/server/chunks/{angle-down-icon_C5YQ7k8s.mjs → angle-down-icon_DtGGiMR5.mjs} +5 -637
  44. package/dist/server/chunks/content-modules_fX1c2JRG.mjs +1 -0
  45. package/dist/server/entry.mjs +3 -2
  46. package/dist/server/{manifest_DoNTQyvZ.mjs → manifest_CXkcH4VT.mjs} +1 -1
  47. package/jest.config.ts +1 -1
  48. package/package.json +1 -1
  49. package/src/components/AutoLinkHeader.tsx +56 -0
  50. package/src/components/CSSSearch.tsx +33 -0
  51. package/src/components/CSSTable.astro +33 -0
  52. package/src/components/CSSTable.tsx +268 -0
  53. package/src/components/NavEntry.tsx +3 -0
  54. package/src/components/Navigation.astro +16 -9
  55. package/src/components/section-gallery/SectionGallery.astro +19 -0
  56. package/src/components/section-gallery/SectionGallery.css +20 -0
  57. package/src/components/section-gallery/SectionGallery.tsx +111 -0
  58. package/src/components/section-gallery/SectionGalleryGridLayout.tsx +97 -0
  59. package/src/components/section-gallery/SectionGalleryListLayout.tsx +108 -0
  60. package/src/components/section-gallery/SectionGalleryToolbar.tsx +93 -0
  61. package/src/content.config.ts +11 -3
  62. package/src/layouts/Main.astro +12 -8
  63. package/src/pages/[section]/[...page].astro +20 -6
  64. package/src/pages/[section]/[page]/[...tab].astro +29 -23
  65. package/src/pages/index.astro +0 -1
  66. package/src/styles/global.scss +47 -1
  67. package/src/utils/index.ts +1 -0
  68. package/src/utils/slugger.ts +14 -0
  69. package/textContent/AllComponents.mdx +16 -0
  70. package/textContent/components-data.js +476 -0
  71. package/textContent/contribute.md +19 -13
  72. package/textContent/examples/Accordion/Accordion.mdx +1 -0
  73. package/dist/client/_astro/LiveExample.Df-EUsee.js +0 -40
  74. package/dist/client/_astro/Navigation.CabjIYg4.js +0 -1
  75. package/dist/client/_astro/PageSidebarBody.Y-7d6zQM.js +0 -1
  76. package/dist/client/_astro/PageToggle.CbfM9bJB.js +0 -1
  77. package/dist/client/_astro/PageToggleButton.CZ3xPbcc.js +0 -1
  78. package/dist/client/_astro/Toolbar.9-YSFh3P.js +0 -1
  79. package/dist/client/_astro/ToolbarContent.BXdFKbs9.js +0 -1
  80. package/dist/client/_astro/_page_.B8cBYNKa.css +0 -1
  81. package/dist/client/_astro/_tab_.YrfmckTJ.css +0 -1
  82. package/dist/client/_astro/divider.DjbDHO_6.js +0 -1
  83. package/dist/client/_astro/page.CDtWFZb5.js +0 -1
  84. /package/dist/client/_astro/{_tab_.DxJDkZPc.css → _page_.DxJDkZPc.css} +0 -0
  85. /package/dist/server/chunks/{Accordion_CGgMUho2.mjs → Accordion_BJka4Qvb.mjs} +0 -0
  86. /package/dist/server/chunks/{Accordion_DlM2LvlF.mjs → Accordion_BQIphkaZ.mjs} +0 -0
  87. /package/dist/server/chunks/{_astro_data-layer-content_Ni7IDnLe.mjs → AllComponents_CRhgTsiT.mjs} +0 -0
  88. /package/dist/server/chunks/{content-modules_BzUEG69n.mjs → AllComponents_CjOtwUH6.mjs} +0 -0
@@ -1,420 +1,10 @@
1
+ import { r as getUniqueId, a as canUseDOM, w as getLanguageDirection, x as clearTimeouts, c as css, b as createIcon, K as KeyTypes, g as getDefaultOUIAId, e as getOUIAProps, B as Button, d as ExclamationCircleIcon, E as ExclamationTriangleIcon, C as CheckCircleIcon, l as formatBreakpointMods, u as useOUIAProps } from './Button_DVSwQ8oX.mjs';
1
2
  import { __rest } from 'tslib';
2
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
- import { Component, useMemo, useLayoutEffect, useEffect, useRef, useState, useCallback, isValidElement, cloneElement, forwardRef, createRef, createContext, useContext } from 'react';
4
- /* empty css */
3
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
4
+ import { Component, useLayoutEffect, useEffect, useRef, useState, useMemo, useCallback, isValidElement, cloneElement, createRef, createContext, forwardRef, useContext } from 'react';
5
+ /* empty css */
5
6
  import * as ReactDOM from 'react-dom';
6
7
 
7
- /** Joins args into a className string
8
- *
9
- * @param {any} args list of objects, string, or arrays to reduce
10
- */
11
- function css(...args) {
12
- // Adapted from https://github.com/JedWatson/classnames/blob/master/index.js
13
- const classes = [];
14
- const hasOwn = {}.hasOwnProperty;
15
- args.filter(Boolean).forEach((arg) => {
16
- const argType = typeof arg;
17
- if (argType === 'string' || argType === 'number') {
18
- classes.push(arg);
19
- }
20
- else if (Array.isArray(arg) && arg.length) {
21
- const inner = css(...arg);
22
- if (inner) {
23
- classes.push(inner);
24
- }
25
- }
26
- else if (argType === 'object') {
27
- for (const key in arg) {
28
- if (hasOwn.call(arg, key) && arg[key]) {
29
- classes.push(key);
30
- }
31
- }
32
- }
33
- });
34
- return classes.join(' ');
35
- }
36
-
37
- const t_global_breakpoint_sm = {
38
- "value": "36rem"};
39
-
40
- const t_global_breakpoint_md = {
41
- "value": "48rem"};
42
-
43
- const t_global_breakpoint_lg = {
44
- "value": "62rem"};
45
-
46
- const t_global_breakpoint_xl = {
47
- "value": "75rem"};
48
-
49
- const t_global_breakpoint_2xl = {
50
- "value": "90.625rem"};
51
-
52
- const t_global_breakpoint_height_sm = {
53
- "value": "0rem"};
54
-
55
- const t_global_breakpoint_height_md = {
56
- "value": "40rem"};
57
-
58
- const t_global_breakpoint_height_lg = {
59
- "value": "48rem"};
60
-
61
- const t_global_breakpoint_height_xl = {
62
- "value": "60rem"};
63
-
64
- const t_global_breakpoint_height_2xl = {
65
- "value": "80rem"};
66
-
67
- let currentId$1 = 0;
68
- /**
69
- * Factory to create Icon class components for consumers
70
- */
71
- function createIcon({ name, xOffset = 0, yOffset = 0, width, height, svgPath }) {
72
- var _a;
73
- return _a = class SVGIcon extends Component {
74
- constructor() {
75
- super(...arguments);
76
- this.id = `icon-title-${currentId$1++}`;
77
- }
78
- render() {
79
- const _b = this.props, { title, className } = _b, props = __rest(_b, ["title", "className"]);
80
- const classes = className ? `pf-v6-svg ${className}` : 'pf-v6-svg';
81
- const hasTitle = Boolean(title);
82
- const viewBox = [xOffset, yOffset, width, height].join(' ');
83
- return (jsxs("svg", Object.assign({ className: classes, viewBox: viewBox, fill: "currentColor", "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img", width: "1em", height: "1em" }, props, { children: [hasTitle && jsx("title", { id: this.id, children: title }), jsx("path", { d: svgPath })] })));
84
- }
85
- },
86
- _a.displayName = name,
87
- _a;
88
- }
89
-
90
- const CheckCircleIconConfig = {
91
- name: 'CheckCircleIcon',
92
- height: 512,
93
- width: 512,
94
- svgPath: 'M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z',
95
- yOffset: 0,
96
- xOffset: 0,
97
- };
98
-
99
- const CheckCircleIcon = createIcon(CheckCircleIconConfig);
100
-
101
- const ExclamationCircleIconConfig = {
102
- name: 'ExclamationCircleIcon',
103
- height: 512,
104
- width: 512,
105
- svgPath: 'M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z',
106
- yOffset: 0,
107
- xOffset: 0,
108
- };
109
-
110
- const ExclamationCircleIcon = createIcon(ExclamationCircleIconConfig);
111
-
112
- const ExclamationTriangleIconConfig = {
113
- name: 'ExclamationTriangleIcon',
114
- height: 512,
115
- width: 576,
116
- svgPath: 'M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z',
117
- yOffset: 0,
118
- xOffset: 0,
119
- };
120
-
121
- const ExclamationTriangleIcon = createIcon(ExclamationTriangleIconConfig);
122
-
123
- const InfoCircleIconConfig = {
124
- name: 'InfoCircleIcon',
125
- height: 512,
126
- width: 512,
127
- svgPath: 'M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z',
128
- yOffset: 0,
129
- xOffset: 0,
130
- };
131
-
132
- const InfoCircleIcon = createIcon(InfoCircleIconConfig);
133
-
134
- const BellIconConfig = {
135
- name: 'BellIcon',
136
- height: 1024,
137
- width: 896,
138
- svgPath: 'M448,0 C465.333333,0 480.333333,6.33333333 493,19 C505.666667,31.6666667 512,46.6666667 512,64 L512,106 L514.23,106.45 C587.89,121.39 648.48,157.24 696,214 C744,271.333333 768,338.666667 768,416 C768,500 780,568.666667 804,622 C818.666667,652.666667 841.333333,684 872,716 C873.773676,718.829136 875.780658,721.505113 878,724 C890,737.333333 896,752.333333 896,769 C896,785.666667 890,800.333333 878,813 C866,825.666667 850.666667,832 832,832 L63.3,832 C44.9533333,831.84 29.8533333,825.506667 18,813 C6,800.333333 0,785.666667 0,769 C0,752.333333 6,737.333333 18,724 L24,716 L25.06,714.9 C55.1933333,683.28 77.5066667,652.313333 92,622 C116,568.666667 128,500 128,416 C128,338.666667 152,271.333333 200,214 C248,156.666667 309.333333,120.666667 384,106 L384,63.31 C384.166667,46.27 390.5,31.5 403,19 C415.666667,6.33333333 430.666667,0 448,0 Z M576,896 L576,897.08 C575.74,932.6 563.073333,962.573333 538,987 C512.666667,1011.66667 482.666667,1024 448,1024 C413.333333,1024 383.333333,1011.66667 358,987 C332.666667,962.333333 320,932 320,896 L576,896 Z',
139
- yOffset: 0,
140
- xOffset: 0,
141
- };
142
-
143
- const BellIcon = createIcon(BellIconConfig);
144
-
145
- var ValidatedOptions;
146
- (function (ValidatedOptions) {
147
- ValidatedOptions["success"] = "success";
148
- ValidatedOptions["error"] = "error";
149
- ValidatedOptions["warning"] = "warning";
150
- ValidatedOptions["default"] = "default";
151
- })(ValidatedOptions || (ValidatedOptions = {}));
152
- const KeyTypes = {
153
- Space: ' ',
154
- Escape: 'Escape',
155
- Enter: 'Enter'};
156
- const globalWidthBreakpoints = {
157
- sm: parseInt(t_global_breakpoint_sm.value) * 16,
158
- md: parseInt(t_global_breakpoint_md.value) * 16,
159
- lg: parseInt(t_global_breakpoint_lg.value) * 16,
160
- xl: parseInt(t_global_breakpoint_xl.value) * 16,
161
- '2xl': parseInt(t_global_breakpoint_2xl.value) * 16
162
- };
163
- const globalHeightBreakpoints = {
164
- sm: parseInt(t_global_breakpoint_height_sm.value) * 16,
165
- md: parseInt(t_global_breakpoint_height_md.value) * 16,
166
- lg: parseInt(t_global_breakpoint_height_lg.value) * 16,
167
- xl: parseInt(t_global_breakpoint_height_xl.value) * 16,
168
- '2xl': parseInt(t_global_breakpoint_height_2xl.value) * 16
169
- };
170
- const statusIcons = {
171
- success: CheckCircleIcon,
172
- danger: ExclamationCircleIcon,
173
- warning: ExclamationTriangleIcon,
174
- info: InfoCircleIcon,
175
- custom: BellIcon
176
- };
177
-
178
- /**
179
- * @param {string} prefix - String to prefix ID with
180
- */
181
- function getUniqueId(prefix = 'pf') {
182
- const uid = new Date().getTime() + Math.random().toString(36).slice(2);
183
- return `${prefix}-${uid}`;
184
- }
185
- /**
186
- * This function is a helper for turning arrays of breakpointMod objects for flex and grid into style object
187
- *
188
- * @param {object} mods The modifiers object
189
- * @param {string} css-variable The appropriate css variable for the component
190
- */
191
- const setBreakpointCssVars = (mods, cssVar) => Object.entries(mods || {}).reduce((acc, [breakpoint, value]) => breakpoint === 'default' ? Object.assign(Object.assign({}, acc), { [cssVar]: value }) : Object.assign(Object.assign({}, acc), { [`${cssVar}-on-${breakpoint}`]: value }), {});
192
- /**
193
- * This function is a helper for turning arrays of breakpointMod objects for data toolbar and flex into classes
194
- *
195
- * @param {object} mods The modifiers object
196
- * @param {any} styles The appropriate styles object for the component
197
- */
198
- const formatBreakpointMods = (mods, styles, stylePrefix = '', breakpoint, vertical) => {
199
- if (!mods) {
200
- return '';
201
- }
202
- if (breakpoint && !vertical) {
203
- if (breakpoint in mods) {
204
- return styles.modifiers[toCamel(`${stylePrefix}${mods[breakpoint]}`)];
205
- }
206
- // the current breakpoint is not specified in mods, so we try to find the next nearest
207
- const breakpointsOrder = ['2xl', 'xl', 'lg', 'md', 'sm', 'default'];
208
- const breakpointsIndex = breakpointsOrder.indexOf(breakpoint);
209
- for (let i = breakpointsIndex; i < breakpointsOrder.length; i++) {
210
- if (breakpointsOrder[i] in mods) {
211
- return styles.modifiers[toCamel(`${stylePrefix}${mods[breakpointsOrder[i]]}`)];
212
- }
213
- }
214
- return '';
215
- }
216
- return Object.entries(mods || {})
217
- .map(([breakpoint, mod]) => `${stylePrefix}${mod}${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}${vertical && breakpoint !== 'default' ? '-height' : ''}`)
218
- .map(toCamel)
219
- .map((mod) => mod.replace(/-?(\dxl)/gi, (_res, group) => `_${group}`))
220
- .map((modifierKey) => styles.modifiers[modifierKey])
221
- .filter(Boolean)
222
- .join(' ');
223
- };
224
- /**
225
- * Return the breakpoint for the given height
226
- *
227
- * @param {number | null} height The height to check
228
- * @returns {'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'} The breakpoint
229
- */
230
- const getVerticalBreakpoint = (height) => {
231
- if (height === null) {
232
- return null;
233
- }
234
- if (height >= globalHeightBreakpoints['2xl']) {
235
- return '2xl';
236
- }
237
- if (height >= globalHeightBreakpoints.xl) {
238
- return 'xl';
239
- }
240
- if (height >= globalHeightBreakpoints.lg) {
241
- return 'lg';
242
- }
243
- if (height >= globalHeightBreakpoints.md) {
244
- return 'md';
245
- }
246
- if (height >= globalHeightBreakpoints.sm) {
247
- return 'sm';
248
- }
249
- return 'default';
250
- };
251
- /**
252
- * Return the breakpoint for the given width
253
- *
254
- * @param {number | null} width The width to check
255
- * @returns {'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'} The breakpoint
256
- */
257
- const getBreakpoint = (width) => {
258
- if (width === null) {
259
- return null;
260
- }
261
- if (width >= globalWidthBreakpoints['2xl']) {
262
- return '2xl';
263
- }
264
- if (width >= globalWidthBreakpoints.xl) {
265
- return 'xl';
266
- }
267
- if (width >= globalWidthBreakpoints.lg) {
268
- return 'lg';
269
- }
270
- if (width >= globalWidthBreakpoints.md) {
271
- return 'md';
272
- }
273
- if (width >= globalWidthBreakpoints.sm) {
274
- return 'sm';
275
- }
276
- return 'default';
277
- };
278
- const camelize = (s) => s.toUpperCase().replace('-', '').replace('_', '');
279
- /**
280
- *
281
- * @param {string} s string to make camelCased
282
- */
283
- const toCamel = (s) => s.replace(/([-_][a-z])/gi, camelize);
284
- /**
285
- * Copied from exenv
286
- */
287
- const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
288
- /**
289
- * Calculate the width of the text
290
- * Example:
291
- * getTextWidth('my text', node)
292
- *
293
- * @param {string} text The text to calculate the width for
294
- * @param {HTMLElement} node The HTML element
295
- */
296
- const getTextWidth = (text, node) => {
297
- const computedStyle = getComputedStyle(node);
298
- // Firefox returns the empty string for .font, so this function creates the .font property manually
299
- const getFontFromComputedStyle = () => {
300
- let computedFont = '';
301
- // Firefox uses percentages for font-stretch, but Canvas does not accept percentages
302
- // so convert to keywords, as listed at:
303
- // https://developer.mozilla.org/en-US/docs/Web/CSS/font-stretch
304
- const fontStretchLookupTable = {
305
- '50%': 'ultra-condensed',
306
- '62.5%': 'extra-condensed',
307
- '75%': 'condensed',
308
- '87.5%': 'semi-condensed',
309
- '100%': 'normal',
310
- '112.5%': 'semi-expanded',
311
- '125%': 'expanded',
312
- '150%': 'extra-expanded',
313
- '200%': 'ultra-expanded'
314
- };
315
- // If the retrieved font-stretch percentage isn't found in the lookup table, use
316
- // 'normal' as a last resort.
317
- let fontStretch;
318
- if (computedStyle.fontStretch in fontStretchLookupTable) {
319
- fontStretch = fontStretchLookupTable[computedStyle.fontStretch];
320
- }
321
- else {
322
- fontStretch = 'normal';
323
- }
324
- computedFont =
325
- computedStyle.fontStyle +
326
- ' ' +
327
- computedStyle.fontVariant +
328
- ' ' +
329
- computedStyle.fontWeight +
330
- ' ' +
331
- fontStretch +
332
- ' ' +
333
- computedStyle.fontSize +
334
- '/' +
335
- computedStyle.lineHeight +
336
- ' ' +
337
- computedStyle.fontFamily;
338
- return computedFont;
339
- };
340
- const canvas = document.createElement('canvas');
341
- const context = canvas.getContext('2d');
342
- context.font = computedStyle.font || getFontFromComputedStyle();
343
- return context.measureText(text).width;
344
- };
345
- /**
346
- * Get the inner dimensions of an element
347
- *
348
- * @param {HTMLElement} node HTML element to calculate the inner dimensions for
349
- */
350
- const innerDimensions = (node) => {
351
- const computedStyle = getComputedStyle(node);
352
- let width = node.clientWidth; // width with padding
353
- let height = node.clientHeight; // height with padding
354
- height -= parseFloat(computedStyle.paddingTop) + parseFloat(computedStyle.paddingBottom);
355
- width -= parseFloat(computedStyle.paddingLeft) + parseFloat(computedStyle.paddingRight);
356
- return { height, width };
357
- };
358
- /**
359
- * This function is a helper for truncating text content on the left, leaving the right side of the content in view
360
- *
361
- * @param {HTMLElement} node HTML element
362
- * @param {string} value The original text value
363
- */
364
- const trimLeft = (node, value) => {
365
- const availableWidth = innerDimensions(node).width;
366
- let newValue = value;
367
- if (getTextWidth(value, node) > availableWidth) {
368
- // we have text overflow, trim the text to the left and add ... in the front until it fits
369
- while (getTextWidth(`...${newValue}`, node) > availableWidth) {
370
- newValue = newValue.substring(1);
371
- }
372
- // replace text with our truncated text
373
- if (node.value) {
374
- node.value = `...${newValue}`;
375
- }
376
- else {
377
- node.innerText = `...${newValue}`;
378
- }
379
- }
380
- else {
381
- if (node.value) {
382
- node.value = value;
383
- }
384
- else {
385
- node.innerText = value;
386
- }
387
- }
388
- };
389
- /**
390
- * @param {React.RefObject<any>[]} timeoutRefs - Timeout refs to clear
391
- */
392
- const clearTimeouts = (timeoutRefs) => {
393
- timeoutRefs.forEach((ref) => {
394
- if (ref.current) {
395
- clearTimeout(ref.current);
396
- }
397
- });
398
- };
399
- /**
400
- * Helper function to get the language direction of a given element, useful for figuring out if left-to-right
401
- * or right-to-left specific logic should be applied.
402
- *
403
- * @param {HTMLElement} targetElement - Element the helper will get the language direction of
404
- * @param {'ltr' | 'rtl'} defaultDirection - Language direction to assume if one can't be determined, defaults to 'ltr'
405
- * @returns {'ltr' | 'rtl'} - The language direction of the target element
406
- */
407
- const getLanguageDirection = (targetElement, defaultDirection = 'ltr') => {
408
- if (!targetElement) {
409
- return defaultDirection;
410
- }
411
- const computedDirection = getComputedStyle(targetElement).getPropertyValue('direction');
412
- if (['ltr', 'rtl'].includes(computedDirection)) {
413
- return computedDirection;
414
- }
415
- return defaultDirection;
416
- };
417
-
418
8
  /** This Component can be used to wrap a functional component in order to generate a random ID
419
9
  * Example of how to use this component
420
10
  *
@@ -455,90 +45,6 @@ GenerateId.defaultProps = {
455
45
 
456
46
  const ASTERISK = '*';
457
47
 
458
- let uid = 0;
459
- const ouiaPrefix = 'OUIA-Generated-';
460
- const ouiaIdByRoute = {};
461
- /** Get props to conform to OUIA spec
462
- *
463
- * For functional components, use the useOUIAProps function instead
464
- *
465
- * In class based components, create a state variable ouiaStateId to create a static generated ID:
466
- * state = {
467
- * ouiaStateId: getDefaultOUIAId(Chip.displayName)
468
- * }
469
- * This generated ID should remain alive as long as the component is not unmounted.
470
- *
471
- * Then add the attributes to the component
472
- * {...getOUIAProps('OverflowChip', this.props.ouiaId !== undefined ? this.props.ouiaId : this.state.ouiaStateId)}
473
- *
474
- * @param {string} componentType OUIA component type
475
- * @param {number|string} id OUIA component id
476
- * @param {boolean} ouiaSafe false if in animation
477
- */
478
- function getOUIAProps(componentType, id, ouiaSafe = true) {
479
- return {
480
- 'data-ouia-component-type': `PF6/${componentType}`,
481
- 'data-ouia-safe': ouiaSafe,
482
- 'data-ouia-component-id': id
483
- };
484
- }
485
- /**
486
- * Hooks version of the getOUIAProps function that also memoizes the generated ID
487
- * Can only be used in functional components
488
- *
489
- * @param {string} componentType OUIA component type
490
- * @param {number|string} id OUIA component id
491
- * @param {boolean} ouiaSafe false if in animation
492
- * @param {string} variant Optional variant to add to the generated ID
493
- */
494
- const useOUIAProps = (componentType, id, ouiaSafe = true, variant) => ({
495
- 'data-ouia-component-type': `PF6/${componentType}`,
496
- 'data-ouia-safe': ouiaSafe,
497
- 'data-ouia-component-id': useOUIAId(componentType, id, variant)
498
- });
499
- /**
500
- * Returns the ID or the memoized generated ID
501
- *
502
- * @param {string} componentType OUIA component type
503
- * @param {number|string} id OUIA component id
504
- * @param {string} variant Optional variant to add to the generated ID
505
- */
506
- const useOUIAId = (componentType, id, variant) => {
507
- const defaultOUIAId = useMemo(() => getDefaultOUIAId(componentType, variant), [componentType, variant]);
508
- return id !== null && id !== void 0 ? id : defaultOUIAId;
509
- };
510
- /**
511
- * Returns a generated id based on the URL location
512
- *
513
- * @param {string} componentType OUIA component type
514
- * @param {string} variant Optional variant to add to the generated ID
515
- */
516
- function getDefaultOUIAId(componentType, variant) {
517
- /*
518
- ouiaIdByRoute = {
519
- [route+componentType]: [number]
520
- }
521
- */
522
- try {
523
- let key;
524
- if (typeof window !== 'undefined') {
525
- // browser environments
526
- key = `${window.location.href}-${componentType}-${variant || ''}`;
527
- }
528
- else {
529
- // node/SSR environments
530
- key = `${componentType}-${variant || ''}`;
531
- }
532
- if (!ouiaIdByRoute[key]) {
533
- ouiaIdByRoute[key] = 0;
534
- }
535
- return `${ouiaPrefix}${componentType}-${variant ? `${variant}-` : ''}${++ouiaIdByRoute[key]}`;
536
- }
537
- catch (exception) {
538
- return `${ouiaPrefix}${componentType}-${variant ? `${variant}-` : ''}${++uid}`;
539
- }
540
- }
541
-
542
48
  /**
543
49
  * @param element
544
50
  */
@@ -2689,144 +2195,6 @@ KeyboardHandler.defaultProps = {
2689
2195
  noSpaceHandling: false
2690
2196
  };
2691
2197
 
2692
- const styles$4 = {
2693
- "button": "pf-v6-c-button",
2694
- "buttonCount": "pf-v6-c-button__count",
2695
- "buttonIcon": "pf-v6-c-button__icon",
2696
- "buttonProgress": "pf-v6-c-button__progress",
2697
- "modifiers": {
2698
- "primary": "pf-m-primary",
2699
- "unread": "pf-m-unread",
2700
- "secondary": "pf-m-secondary",
2701
- "danger": "pf-m-danger",
2702
- "tertiary": "pf-m-tertiary",
2703
- "link": "pf-m-link",
2704
- "inline": "pf-m-inline",
2705
- "displayLg": "pf-m-display-lg",
2706
- "warning": "pf-m-warning",
2707
- "control": "pf-m-control",
2708
- "stateful": "pf-m-stateful",
2709
- "read": "pf-m-read",
2710
- "attention": "pf-m-attention",
2711
- "plain": "pf-m-plain",
2712
- "noPadding": "pf-m-no-padding",
2713
- "block": "pf-m-block",
2714
- "small": "pf-m-small",
2715
- "favorite": "pf-m-favorite",
2716
- "favorited": "pf-m-favorited",
2717
- "clicked": "pf-m-clicked",
2718
- "disabled": "pf-m-disabled",
2719
- "ariaDisabled": "pf-m-aria-disabled",
2720
- "progress": "pf-m-progress",
2721
- "inProgress": "pf-m-in-progress",
2722
- "notify": "pf-m-notify",
2723
- "start": "pf-m-start",
2724
- "end": "pf-m-end"
2725
- }};
2726
-
2727
- const styles$3 = {
2728
- "modifiers": {
2729
- "inline": "pf-m-inline",
2730
- "sm": "pf-m-sm",
2731
- "md": "pf-m-md",
2732
- "lg": "pf-m-lg",
2733
- "xl": "pf-m-xl"
2734
- },
2735
- "spinner": "pf-v6-c-spinner",
2736
- "spinnerPath": "pf-v6-c-spinner__path"
2737
- };
2738
-
2739
- const c_spinner_diameter = {
2740
- "name": "--pf-v6-c-spinner--diameter"};
2741
-
2742
- var spinnerSize;
2743
- (function (spinnerSize) {
2744
- spinnerSize["sm"] = "sm";
2745
- spinnerSize["md"] = "md";
2746
- spinnerSize["lg"] = "lg";
2747
- spinnerSize["xl"] = "xl";
2748
- })(spinnerSize || (spinnerSize = {}));
2749
- const Spinner = (_a) => {
2750
- var { className = '', size = 'xl', 'aria-valuetext': ariaValueText = 'Loading...', diameter, isInline = false, 'aria-label': ariaLabel, 'aria-labelledBy': ariaLabelledBy } = _a, props = __rest(_a, ["className", "size", 'aria-valuetext', "diameter", "isInline", 'aria-label', 'aria-labelledBy']);
2751
- return (jsx("svg", Object.assign({ className: css(styles$3.spinner, isInline ? styles$3.modifiers.inline : styles$3.modifiers[size], className), role: "progressbar", "aria-valuetext": ariaValueText, viewBox: "0 0 100 100" }, (diameter && { style: { [c_spinner_diameter.name]: diameter } }), (ariaLabel && { 'aria-label': ariaLabel }), (ariaLabelledBy && { 'aria-labelledBy': ariaLabelledBy }), (!ariaLabel && !ariaLabelledBy && { 'aria-label': 'Contents' }), props, { children: jsx("circle", { className: styles$3.spinnerPath, cx: "50", cy: "50", r: "45", fill: "none" }) })));
2752
- };
2753
- Spinner.displayName = 'Spinner';
2754
-
2755
- const styles$2 = {
2756
- "badge": "pf-v6-c-badge",
2757
- "modifiers": {
2758
- "read": "pf-m-read",
2759
- "unread": "pf-m-unread",
2760
- "disabled": "pf-m-disabled"
2761
- }
2762
- };
2763
-
2764
- const Badge = (_a) => {
2765
- var { isRead = false, isDisabled = false, className = '', children = '', screenReaderText } = _a, props = __rest(_a, ["isRead", "isDisabled", "className", "children", "screenReaderText"]);
2766
- return (jsxs("span", Object.assign({}, props, { className: css(styles$2.badge, (isRead ? styles$2.modifiers.read : styles$2.modifiers.unread), isDisabled && styles$2.modifiers.disabled, className), children: [children, screenReaderText && jsx("span", { className: "pf-v6-screen-reader", children: screenReaderText })] })));
2767
- };
2768
- Badge.displayName = 'Badge';
2769
-
2770
- var ButtonVariant;
2771
- (function (ButtonVariant) {
2772
- ButtonVariant["primary"] = "primary";
2773
- ButtonVariant["secondary"] = "secondary";
2774
- ButtonVariant["tertiary"] = "tertiary";
2775
- ButtonVariant["danger"] = "danger";
2776
- ButtonVariant["warning"] = "warning";
2777
- ButtonVariant["link"] = "link";
2778
- ButtonVariant["plain"] = "plain";
2779
- ButtonVariant["control"] = "control";
2780
- ButtonVariant["stateful"] = "stateful";
2781
- })(ButtonVariant || (ButtonVariant = {}));
2782
- var ButtonType;
2783
- (function (ButtonType) {
2784
- ButtonType["button"] = "button";
2785
- ButtonType["submit"] = "submit";
2786
- ButtonType["reset"] = "reset";
2787
- })(ButtonType || (ButtonType = {}));
2788
- var ButtonSize;
2789
- (function (ButtonSize) {
2790
- ButtonSize["default"] = "default";
2791
- ButtonSize["sm"] = "sm";
2792
- ButtonSize["lg"] = "lg";
2793
- })(ButtonSize || (ButtonSize = {}));
2794
- var ButtonState;
2795
- (function (ButtonState) {
2796
- ButtonState["read"] = "read";
2797
- ButtonState["unread"] = "unread";
2798
- ButtonState["attention"] = "attention";
2799
- })(ButtonState || (ButtonState = {}));
2800
- const ButtonBase = (_a) => {
2801
- var { children = null, className = '', component = 'button', isClicked = false, isBlock = false, isDisabled = false, isAriaDisabled = false, isLoading = null, isDanger = false, spinnerAriaValueText, spinnerAriaLabelledBy, spinnerAriaLabel, size = ButtonSize.default, inoperableEvents = ['onClick', 'onKeyPress'], isInline = false, type = ButtonType.button, variant = ButtonVariant.primary, state = ButtonState.unread, hasNoPadding = false, iconPosition = 'start', 'aria-label': ariaLabel = null, icon = null, role, ouiaId, ouiaSafe = true, tabIndex = null, innerRef, countOptions } = _a, props = __rest(_a, ["children", "className", "component", "isClicked", "isBlock", "isDisabled", "isAriaDisabled", "isLoading", "isDanger", "spinnerAriaValueText", "spinnerAriaLabelledBy", "spinnerAriaLabel", "size", "inoperableEvents", "isInline", "type", "variant", "state", "hasNoPadding", "iconPosition", 'aria-label', "icon", "role", "ouiaId", "ouiaSafe", "tabIndex", "innerRef", "countOptions"]);
2802
- const ouiaProps = useOUIAProps(Button.displayName, ouiaId, ouiaSafe, variant);
2803
- const Component = component;
2804
- const isButtonElement = Component === 'button';
2805
- const isInlineSpan = isInline && Component === 'span';
2806
- const isIconAlignedAtEnd = iconPosition === 'end' || iconPosition === 'right';
2807
- const preventedEvents = inoperableEvents.reduce((handlers, eventToPrevent) => (Object.assign(Object.assign({}, handlers), { [eventToPrevent]: (event) => {
2808
- event.preventDefault();
2809
- } })), {});
2810
- const getDefaultTabIdx = () => {
2811
- if (isDisabled) {
2812
- return isButtonElement ? null : -1;
2813
- }
2814
- else if (isAriaDisabled) {
2815
- return null;
2816
- }
2817
- else if (isInlineSpan) {
2818
- return 0;
2819
- }
2820
- };
2821
- const _icon = icon && (jsx("span", { className: css(styles$4.buttonIcon, children && styles$4.modifiers[isIconAlignedAtEnd ? 'end' : 'start']), children: icon }));
2822
- const _children = children && jsx("span", { className: css('pf-v6-c-button__text'), children: children });
2823
- // We only want to render the aria-disabled attribute when true, similar to the disabled attribute natively.
2824
- const shouldRenderAriaDisabled = isAriaDisabled || (!isButtonElement && isDisabled);
2825
- return (jsxs(Component, Object.assign({}, props, (isAriaDisabled ? preventedEvents : null), (shouldRenderAriaDisabled && { 'aria-disabled': true }), { "aria-label": ariaLabel, className: css(styles$4.button, styles$4.modifiers[variant], isBlock && styles$4.modifiers.block, isDisabled && !isButtonElement && styles$4.modifiers.disabled, isAriaDisabled && styles$4.modifiers.ariaDisabled, isClicked && styles$4.modifiers.clicked, isInline && variant === ButtonVariant.link && styles$4.modifiers.inline, isDanger && (variant === ButtonVariant.secondary || variant === ButtonVariant.link) && styles$4.modifiers.danger, isLoading !== null && variant !== ButtonVariant.plain && styles$4.modifiers.progress, isLoading && styles$4.modifiers.inProgress, hasNoPadding && variant === ButtonVariant.plain && styles$4.modifiers.noPadding, variant === ButtonVariant.stateful && styles$4.modifiers[state], size === ButtonSize.sm && styles$4.modifiers.small, size === ButtonSize.lg && styles$4.modifiers.displayLg, className), disabled: isButtonElement ? isDisabled : null, tabIndex: tabIndex !== null ? tabIndex : getDefaultTabIdx(), type: isButtonElement || isInlineSpan ? type : null, role: isInlineSpan ? 'button' : role, ref: innerRef }, ouiaProps, { children: [isLoading && (jsx("span", { className: css(styles$4.buttonProgress), children: jsx(Spinner, { size: spinnerSize.md, isInline: isInline, "aria-valuetext": spinnerAriaValueText, "aria-label": spinnerAriaLabel, "aria-labelledby": spinnerAriaLabelledBy }) })), isIconAlignedAtEnd ? (jsxs(Fragment, { children: [_children, _icon] })) : (jsxs(Fragment, { children: [_icon, _children] })), countOptions && (jsx("span", { className: css(styles$4.buttonCount, countOptions.className), children: jsx(Badge, { isRead: countOptions.isRead, isDisabled: isDisabled, children: countOptions.count }) }))] })));
2826
- };
2827
- const Button = forwardRef((props, ref) => jsx(ButtonBase, Object.assign({ innerRef: ref }, props)));
2828
- Button.displayName = 'Button';
2829
-
2830
2198
  const TimesIconConfig = {
2831
2199
  name: 'TimesIcon',
2832
2200
  height: 512,
@@ -3917,4 +3285,4 @@ const AngleDownIconConfig = {
3917
3285
 
3918
3286
  const AngleDownIcon = createIcon(AngleDownIconConfig);
3919
3287
 
3920
- export { ASTERISK as A, Button as B, CheckCircleIcon as C, Divider as D, ExclamationTriangleIcon as E, getUniqueId as F, GenerateId as G, useIsomorphicLayoutEffect as H, Tooltip as I, BellIcon as J, KeyTypes as K, InfoCircleIcon as L, MenuToggle as M, checkStyles as N, StarIcon as O, Popper as P, Checkbox as Q, setTabIndex as R, Spinner as S, TimesIcon as T, handleArrows as U, ValidatedOptions as V, canUseDOM as a, createIcon as b, css as c, ExclamationCircleIcon as d, getOUIAProps as e, statusIcons as f, getDefaultOUIAId as g, ButtonVariant as h, CaretDownIcon as i, Badge as j, AngleDownIcon as k, getVerticalBreakpoint as l, menuStyles as m, getBreakpoint as n, formatBreakpointMods as o, t_global_breakpoint_2xl as p, t_global_breakpoint_xl as q, t_global_breakpoint_lg as r, setBreakpointCssVars as s, trimLeft as t, useOUIAProps as u, t_global_breakpoint_md as v, toCamel as w, Dropdown as x, DropdownList as y, DropdownItem as z };
3288
+ export { ASTERISK as A, CaretDownIcon as C, Divider as D, GenerateId as G, MenuToggle as M, Popper as P, StarIcon as S, TimesIcon as T, AngleDownIcon as a, Dropdown as b, DropdownList as c, DropdownItem as d, Tooltip as e, checkStyles as f, Checkbox as g, handleArrows as h, menuStyles as m, setTabIndex as s, useIsomorphicLayoutEffect as u };
@@ -0,0 +1 @@
1
+ // Contents removed by Astro as it's used for prerendering only