@indico-data/design-system 3.14.1 → 3.16.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.
- package/lib/components/button/enums.d.ts +1 -1
- package/lib/components/button/types.d.ts +1 -1
- package/lib/components/icons/types.d.ts +1 -1
- package/lib/index.css +35 -28
- package/lib/index.d.ts +2 -2
- package/lib/index.esm.css +35 -28
- package/lib/index.esm.js +28 -7
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +28 -7
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/button/Button.mdx +24 -1
- package/src/components/button/Button.stories.tsx +7 -2
- package/src/components/button/Button.tsx +26 -16
- package/src/components/button/__tests__/Button.test.tsx +64 -11
- package/src/components/button/enums.ts +1 -1
- package/src/components/button/styles/Button.scss +19 -12
- package/src/components/button/styles/_variables.scss +2 -9
- package/src/components/button/types.ts +1 -1
- package/src/components/floatUI/FloatUI.stories.tsx +5 -0
- package/src/components/floatUI/FloatUI.tsx +5 -1
- package/src/components/forms/input/Input.tsx +7 -2
- package/src/components/forms/input/styles/Input.scss +4 -2
- package/src/components/forms/numberInput/NumberInput.tsx +7 -2
- package/src/components/forms/passwordInput/PasswordInput.tsx +2 -2
- package/src/components/icons/Icon.mdx +1 -1
- package/src/components/icons/Icon.stories.tsx +2 -2
- package/src/components/icons/styles/Icon.scss +1 -0
- package/src/components/icons/types.ts +1 -1
- package/src/components/menu/Menu.stories.tsx +3 -0
- package/src/components/menu/styles/Menu.scss +2 -2
- package/src/components/pagination/Pagination.tsx +2 -0
- package/src/components/stepper/components/Legend.tsx +1 -1
- package/src/components/toast/Toast.stories.tsx +5 -5
- package/src/docs/BaseColorPalette/Swatch.tsx +2 -2
- package/src/docs/Primitives.mdx +7 -1
- package/src/styles/primitives/_iconSizes.scss +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconName } from '../../types';
|
|
2
2
|
export type ButtonVariants = 'solid' | 'outline' | 'link' | 'action' | 'destructive' | 'soft';
|
|
3
|
-
export type ButtonSizes = 'xs' | 'sm' | 'md' | 'lg';
|
|
3
|
+
export type ButtonSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
4
|
export type ButtonTypes = 'button' | 'submit' | 'reset';
|
|
5
5
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
6
|
/**
|
|
@@ -2,7 +2,7 @@ import { MouseEventHandler, CSSProperties } from 'react';
|
|
|
2
2
|
import { PermafrostComponent } from '../../types';
|
|
3
3
|
import { IconName as FAIconName, IconPrefix } from '@fortawesome/fontawesome-svg-core';
|
|
4
4
|
import { indicons } from './indicons';
|
|
5
|
-
export type IconSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
5
|
+
export type IconSizes = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
6
6
|
export type IndiconName = keyof typeof indicons;
|
|
7
7
|
export type IconName = IndiconName | `fa-${FAIconName}`;
|
|
8
8
|
export type IconProps = PermafrostComponent & {
|
package/lib/index.css
CHANGED
|
@@ -290,9 +290,10 @@
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
:root {
|
|
293
|
-
--pf-icon-size-
|
|
294
|
-
--pf-icon-size-
|
|
295
|
-
--pf-icon-size-
|
|
293
|
+
--pf-icon-size-xxs: 10px;
|
|
294
|
+
--pf-icon-size-xs: 12px;
|
|
295
|
+
--pf-icon-size-sm: 16px;
|
|
296
|
+
--pf-icon-size-md: 20px;
|
|
296
297
|
--pf-icon-size-lg: 24px;
|
|
297
298
|
--pf-icon-size-xl: 32px;
|
|
298
299
|
--pf-icon-size-2xl: 48px;
|
|
@@ -4489,15 +4490,7 @@ a:hover,
|
|
|
4489
4490
|
:root,
|
|
4490
4491
|
:root [data-theme=light],
|
|
4491
4492
|
:root [data-theme=dark] {
|
|
4492
|
-
--pf-button-font-weight: var(--pf-font-weight-
|
|
4493
|
-
--pf-button-font-size-xs: calc(0.875 * var(--pf-font-size-base));
|
|
4494
|
-
--pf-button-font-size-sm: calc(0.875 * var(--pf-font-size-base));
|
|
4495
|
-
--pf-button-font-size-md: calc(0.875 * var(--pf-font-size-base));
|
|
4496
|
-
--pf-button-font-size-lg: var(--pf-font-size-base);
|
|
4497
|
-
--pf-button-line-height-xs: var(--pf-line-height-md);
|
|
4498
|
-
--pf-button-line-height-sm: var(--pf-line-height-md);
|
|
4499
|
-
--pf-button-line-height-md: var(--pf-line-height-md);
|
|
4500
|
-
--pf-button-line-height-lg: var(--pf-line-height-lg);
|
|
4493
|
+
--pf-button-font-weight: var(--pf-font-weight-medium);
|
|
4501
4494
|
--pf-button-border-radius: var(--pf-border-radius-md);
|
|
4502
4495
|
--pf-button-pill-border-radius: 100px;
|
|
4503
4496
|
--pf-button-focus-box-shadow: var(--pf-focus-box-shadow-alignment) rgba(25, 139, 220, 0.25);
|
|
@@ -4595,6 +4588,7 @@ a:hover,
|
|
|
4595
4588
|
border-color: transparent;
|
|
4596
4589
|
border-radius: var(--pf-button-border-radius);
|
|
4597
4590
|
font-weight: var(--pf-button-font-weight);
|
|
4591
|
+
gap: 0;
|
|
4598
4592
|
cursor: pointer;
|
|
4599
4593
|
}
|
|
4600
4594
|
.btn:disabled {
|
|
@@ -4602,27 +4596,33 @@ a:hover,
|
|
|
4602
4596
|
}
|
|
4603
4597
|
|
|
4604
4598
|
.btn--xs {
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4599
|
+
padding: var(--pf-spacing-xxs) var(--pf-spacing-sm);
|
|
4600
|
+
font-size: var(--pf-font-size-sm);
|
|
4601
|
+
gap: var(--pf-spacing-xs);
|
|
4608
4602
|
}
|
|
4609
4603
|
|
|
4610
4604
|
.btn--sm {
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4605
|
+
padding: var(--pf-spacing-xs) var(--pf-spacing-lg);
|
|
4606
|
+
font-size: var(--pf-font-size-md);
|
|
4607
|
+
gap: var(--pf-spacing-xs);
|
|
4614
4608
|
}
|
|
4615
4609
|
|
|
4616
4610
|
.btn--md {
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4611
|
+
padding: var(--pf-spacing-sm) var(--pf-spacing-2xl);
|
|
4612
|
+
font-size: var(--pf-font-size-base);
|
|
4613
|
+
gap: var(--pf-spacing-md);
|
|
4620
4614
|
}
|
|
4621
4615
|
|
|
4622
4616
|
.btn--lg {
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4617
|
+
padding: var(--pf-spacing-md) var(--pf-spacing-2xl);
|
|
4618
|
+
font-size: var(--pf-font-size-2xl);
|
|
4619
|
+
gap: var(--pf-spacing-md);
|
|
4620
|
+
}
|
|
4621
|
+
|
|
4622
|
+
.btn--xl {
|
|
4623
|
+
padding: var(--pf-spacing-lg) var(--pf-spacing-3xl);
|
|
4624
|
+
font-size: var(--pf-font-size-3xl);
|
|
4625
|
+
gap: var(--pf-spacing-md);
|
|
4626
4626
|
}
|
|
4627
4627
|
|
|
4628
4628
|
.btn--icon-only {
|
|
@@ -4755,6 +4755,11 @@ a:hover,
|
|
|
4755
4755
|
.icon {
|
|
4756
4756
|
display: inline-block;
|
|
4757
4757
|
}
|
|
4758
|
+
.icon--xxs {
|
|
4759
|
+
width: var(--pf-icon-size-xxs);
|
|
4760
|
+
height: var(--pf-icon-size-xxs);
|
|
4761
|
+
font-size: var(--pf-icon-size-xxs);
|
|
4762
|
+
}
|
|
4758
4763
|
.icon--xs {
|
|
4759
4764
|
width: var(--pf-icon-size-xs);
|
|
4760
4765
|
height: var(--pf-icon-size-xs);
|
|
@@ -5014,13 +5019,15 @@ a:hover,
|
|
|
5014
5019
|
}
|
|
5015
5020
|
.input-wrapper .embedded-icon {
|
|
5016
5021
|
position: absolute;
|
|
5017
|
-
top:
|
|
5022
|
+
top: 50%;
|
|
5023
|
+
transform: translateY(-50%);
|
|
5018
5024
|
left: var(--pf-spacing-sm);
|
|
5019
5025
|
color: var(--pf-semantic-font-regular);
|
|
5020
5026
|
}
|
|
5021
5027
|
.input-wrapper .clearable-icon {
|
|
5022
5028
|
position: absolute;
|
|
5023
|
-
top:
|
|
5029
|
+
top: 50%;
|
|
5030
|
+
transform: translateY(-50%);
|
|
5024
5031
|
right: var(--pf-spacing-sm);
|
|
5025
5032
|
color: var(--pf-semantic-font-regular);
|
|
5026
5033
|
cursor: pointer;
|
|
@@ -5716,8 +5723,8 @@ body div[class*=select__single-value] {
|
|
|
5716
5723
|
width: 100%;
|
|
5717
5724
|
background: var(--pf-semantic-background-secondary);
|
|
5718
5725
|
color: var(--pf-semantic-font-regular);
|
|
5719
|
-
display:
|
|
5720
|
-
|
|
5726
|
+
display: flex;
|
|
5727
|
+
justify-content: flex-start;
|
|
5721
5728
|
text-align: left;
|
|
5722
5729
|
border: none;
|
|
5723
5730
|
border-radius: 0;
|
package/lib/index.d.ts
CHANGED
|
@@ -177,7 +177,7 @@ declare const indicons: {
|
|
|
177
177
|
'zoom-out': react_jsx_runtime.JSX.Element;
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
-
type IconSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
180
|
+
type IconSizes = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
181
181
|
type IndiconName = keyof typeof indicons;
|
|
182
182
|
type IconName = IndiconName | `fa-${IconName$1}`;
|
|
183
183
|
type IconProps = PermafrostComponent & {
|
|
@@ -258,7 +258,7 @@ type PermafrostComponent = {
|
|
|
258
258
|
type ChromaticColor = 'blue' | 'purple' | 'red' | 'yellow' | 'gray' | 'green' | 'pink' | 'orange' | 'teal';
|
|
259
259
|
|
|
260
260
|
type ButtonVariants = 'solid' | 'outline' | 'link' | 'action' | 'destructive' | 'soft';
|
|
261
|
-
type ButtonSizes = 'xs' | 'sm' | 'md' | 'lg';
|
|
261
|
+
type ButtonSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
262
262
|
type ButtonTypes = 'button' | 'submit' | 'reset';
|
|
263
263
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
264
264
|
/**
|
package/lib/index.esm.css
CHANGED
|
@@ -290,9 +290,10 @@
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
:root {
|
|
293
|
-
--pf-icon-size-
|
|
294
|
-
--pf-icon-size-
|
|
295
|
-
--pf-icon-size-
|
|
293
|
+
--pf-icon-size-xxs: 10px;
|
|
294
|
+
--pf-icon-size-xs: 12px;
|
|
295
|
+
--pf-icon-size-sm: 16px;
|
|
296
|
+
--pf-icon-size-md: 20px;
|
|
296
297
|
--pf-icon-size-lg: 24px;
|
|
297
298
|
--pf-icon-size-xl: 32px;
|
|
298
299
|
--pf-icon-size-2xl: 48px;
|
|
@@ -4489,15 +4490,7 @@ a:hover,
|
|
|
4489
4490
|
:root,
|
|
4490
4491
|
:root [data-theme=light],
|
|
4491
4492
|
:root [data-theme=dark] {
|
|
4492
|
-
--pf-button-font-weight: var(--pf-font-weight-
|
|
4493
|
-
--pf-button-font-size-xs: calc(0.875 * var(--pf-font-size-base));
|
|
4494
|
-
--pf-button-font-size-sm: calc(0.875 * var(--pf-font-size-base));
|
|
4495
|
-
--pf-button-font-size-md: calc(0.875 * var(--pf-font-size-base));
|
|
4496
|
-
--pf-button-font-size-lg: var(--pf-font-size-base);
|
|
4497
|
-
--pf-button-line-height-xs: var(--pf-line-height-md);
|
|
4498
|
-
--pf-button-line-height-sm: var(--pf-line-height-md);
|
|
4499
|
-
--pf-button-line-height-md: var(--pf-line-height-md);
|
|
4500
|
-
--pf-button-line-height-lg: var(--pf-line-height-lg);
|
|
4493
|
+
--pf-button-font-weight: var(--pf-font-weight-medium);
|
|
4501
4494
|
--pf-button-border-radius: var(--pf-border-radius-md);
|
|
4502
4495
|
--pf-button-pill-border-radius: 100px;
|
|
4503
4496
|
--pf-button-focus-box-shadow: var(--pf-focus-box-shadow-alignment) rgba(25, 139, 220, 0.25);
|
|
@@ -4595,6 +4588,7 @@ a:hover,
|
|
|
4595
4588
|
border-color: transparent;
|
|
4596
4589
|
border-radius: var(--pf-button-border-radius);
|
|
4597
4590
|
font-weight: var(--pf-button-font-weight);
|
|
4591
|
+
gap: 0;
|
|
4598
4592
|
cursor: pointer;
|
|
4599
4593
|
}
|
|
4600
4594
|
.btn:disabled {
|
|
@@ -4602,27 +4596,33 @@ a:hover,
|
|
|
4602
4596
|
}
|
|
4603
4597
|
|
|
4604
4598
|
.btn--xs {
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4599
|
+
padding: var(--pf-spacing-xxs) var(--pf-spacing-sm);
|
|
4600
|
+
font-size: var(--pf-font-size-sm);
|
|
4601
|
+
gap: var(--pf-spacing-xs);
|
|
4608
4602
|
}
|
|
4609
4603
|
|
|
4610
4604
|
.btn--sm {
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4605
|
+
padding: var(--pf-spacing-xs) var(--pf-spacing-lg);
|
|
4606
|
+
font-size: var(--pf-font-size-md);
|
|
4607
|
+
gap: var(--pf-spacing-xs);
|
|
4614
4608
|
}
|
|
4615
4609
|
|
|
4616
4610
|
.btn--md {
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4611
|
+
padding: var(--pf-spacing-sm) var(--pf-spacing-2xl);
|
|
4612
|
+
font-size: var(--pf-font-size-base);
|
|
4613
|
+
gap: var(--pf-spacing-md);
|
|
4620
4614
|
}
|
|
4621
4615
|
|
|
4622
4616
|
.btn--lg {
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4617
|
+
padding: var(--pf-spacing-md) var(--pf-spacing-2xl);
|
|
4618
|
+
font-size: var(--pf-font-size-2xl);
|
|
4619
|
+
gap: var(--pf-spacing-md);
|
|
4620
|
+
}
|
|
4621
|
+
|
|
4622
|
+
.btn--xl {
|
|
4623
|
+
padding: var(--pf-spacing-lg) var(--pf-spacing-3xl);
|
|
4624
|
+
font-size: var(--pf-font-size-3xl);
|
|
4625
|
+
gap: var(--pf-spacing-md);
|
|
4626
4626
|
}
|
|
4627
4627
|
|
|
4628
4628
|
.btn--icon-only {
|
|
@@ -4755,6 +4755,11 @@ a:hover,
|
|
|
4755
4755
|
.icon {
|
|
4756
4756
|
display: inline-block;
|
|
4757
4757
|
}
|
|
4758
|
+
.icon--xxs {
|
|
4759
|
+
width: var(--pf-icon-size-xxs);
|
|
4760
|
+
height: var(--pf-icon-size-xxs);
|
|
4761
|
+
font-size: var(--pf-icon-size-xxs);
|
|
4762
|
+
}
|
|
4758
4763
|
.icon--xs {
|
|
4759
4764
|
width: var(--pf-icon-size-xs);
|
|
4760
4765
|
height: var(--pf-icon-size-xs);
|
|
@@ -5014,13 +5019,15 @@ a:hover,
|
|
|
5014
5019
|
}
|
|
5015
5020
|
.input-wrapper .embedded-icon {
|
|
5016
5021
|
position: absolute;
|
|
5017
|
-
top:
|
|
5022
|
+
top: 50%;
|
|
5023
|
+
transform: translateY(-50%);
|
|
5018
5024
|
left: var(--pf-spacing-sm);
|
|
5019
5025
|
color: var(--pf-semantic-font-regular);
|
|
5020
5026
|
}
|
|
5021
5027
|
.input-wrapper .clearable-icon {
|
|
5022
5028
|
position: absolute;
|
|
5023
|
-
top:
|
|
5029
|
+
top: 50%;
|
|
5030
|
+
transform: translateY(-50%);
|
|
5024
5031
|
right: var(--pf-spacing-sm);
|
|
5025
5032
|
color: var(--pf-semantic-font-regular);
|
|
5026
5033
|
cursor: pointer;
|
|
@@ -5716,8 +5723,8 @@ body div[class*=select__single-value] {
|
|
|
5716
5723
|
width: 100%;
|
|
5717
5724
|
background: var(--pf-semantic-background-secondary);
|
|
5718
5725
|
color: var(--pf-semantic-font-regular);
|
|
5719
|
-
display:
|
|
5720
|
-
|
|
5726
|
+
display: flex;
|
|
5727
|
+
justify-content: flex-start;
|
|
5721
5728
|
text-align: left;
|
|
5722
5729
|
border: none;
|
|
5723
5730
|
border-radius: 0;
|
package/lib/index.esm.js
CHANGED
|
@@ -5050,12 +5050,31 @@ const Button$1 = forwardRef((props, ref) => {
|
|
|
5050
5050
|
'btn--loading': isLoading,
|
|
5051
5051
|
'btn--pill': isPill,
|
|
5052
5052
|
}, className);
|
|
5053
|
+
// Map button size to icon size
|
|
5054
|
+
// xs → xs (12px), sm → sm (16px), md → md (20px), lg → md (20px), xl → lg (24px)
|
|
5055
|
+
const getIconSize = (buttonSize) => {
|
|
5056
|
+
switch (buttonSize) {
|
|
5057
|
+
case 'xs':
|
|
5058
|
+
return 'xs';
|
|
5059
|
+
case 'sm':
|
|
5060
|
+
return 'sm';
|
|
5061
|
+
case 'md':
|
|
5062
|
+
return 'md'; // md buttons use md icons (20px)
|
|
5063
|
+
case 'lg':
|
|
5064
|
+
return 'md'; // lg buttons use md icons (20px)
|
|
5065
|
+
case 'xl':
|
|
5066
|
+
return 'lg'; // xl buttons use lg icons (24px)
|
|
5067
|
+
default:
|
|
5068
|
+
return 'md';
|
|
5069
|
+
}
|
|
5070
|
+
};
|
|
5071
|
+
const iconSize = getIconSize(size);
|
|
5053
5072
|
const handleOnClick = (event) => {
|
|
5054
5073
|
if (!isLoading && onClick) {
|
|
5055
5074
|
onClick(event);
|
|
5056
5075
|
}
|
|
5057
5076
|
};
|
|
5058
|
-
return (jsxs("button", Object.assign({ ref: ref, disabled: isLoading || isDisabled, className: buttonClasses, role: "button", onClick: handleOnClick, "aria-label": ariaLabel || 'button', "aria-disabled": isLoading || isDisabled, "aria-busy": isLoading, type: type, onMouseLeave: onMouseExit }, rest, { children: [isLoading && !iconRight && (jsx(Icon, { name: "indico-o", style: { animation: 'spin 1s linear infinite' },
|
|
5077
|
+
return (jsxs("button", Object.assign({ ref: ref, disabled: isLoading || isDisabled, className: buttonClasses, role: "button", onClick: handleOnClick, "aria-label": ariaLabel || 'button', "aria-disabled": isLoading || isDisabled, "aria-busy": isLoading, type: type, onMouseLeave: onMouseExit }, rest, { children: [isLoading && !iconRight && (jsx(Icon, { name: "indico-o", style: { animation: 'spin 1s linear infinite' }, ariaLabel: "Loading...", size: iconSize })), iconLeft && !isLoading && (jsx(Icon, { name: iconLeft, ariaLabel: `${iconLeft} Icon`, size: iconSize })), children, iconRight && !isLoading && (jsx(Icon, { name: iconRight, ariaLabel: `${iconRight} Icon`, size: iconSize })), isLoading && iconRight && (jsx(Icon, { name: "indico-o", style: { animation: 'spin 1s linear infinite' }, ariaLabel: "Loading...", size: iconSize }))] })));
|
|
5059
5078
|
});
|
|
5060
5079
|
|
|
5061
5080
|
var l;function r$1(e,t){return e[t]}function i(e=[],t,n=0){return [...e.slice(0,n),t,...e.slice(n)]}function s(e=[],t,n="id"){const o=e.slice(),a=r$1(t,n);return a?o.splice(o.findIndex((e=>r$1(e,n)===a)),1):o.splice(o.findIndex((e=>e===t)),1),o}function d(e){return e.map(((e,t)=>{const n=Object.assign(Object.assign({},e),{sortable:e.sortable||!!e.sortFunction||void 0});return e.id||(n.id=t+1),n}))}function c(e,t){return Math.ceil(e/t)}function g(e,t){return Math.min(e,t)}!function(e){e.ASC="asc",e.DESC="desc";}(l||(l={}));const u=()=>null;function p(e,t=[],n=[]){let o={},a=[...n];return t.length&&t.forEach((t=>{if(!t.when||"function"!=typeof t.when)throw new Error('"when" must be defined in the conditional style object and must be function');t.when(e)&&(o=t.style||{},t.classNames&&(a=[...a,...t.classNames]),"function"==typeof t.style&&(o=t.style(e)||{}));})),{conditionalStyle:o,classNames:a.join(" ")}}function b$1(e,t=[],n="id"){const o=r$1(e,n);return o?t.some((e=>r$1(e,n)===o)):t.some((t=>t===e))}function m(e,t){return t?e.findIndex((e=>h$1(e.id,t))):-1}function h$1(e,t){return e==t}function w$1(e,t){const n=!e.toggleOnSelectedRowsChange;switch(t.type){case"SELECT_ALL_ROWS":{const{keyField:n,rows:o,rowCount:a,mergeSelections:l}=t,r=!e.allSelected,i=!e.toggleOnSelectedRowsChange;if(l){const t=r?[...e.selectedRows,...o.filter((t=>!b$1(t,e.selectedRows,n)))]:e.selectedRows.filter((e=>!b$1(e,o,n)));return Object.assign(Object.assign({},e),{allSelected:r,selectedCount:t.length,selectedRows:t,toggleOnSelectedRowsChange:i})}return Object.assign(Object.assign({},e),{allSelected:r,selectedCount:r?a:0,selectedRows:r?o:[],toggleOnSelectedRowsChange:i})}case"SELECT_SINGLE_ROW":{const{keyField:o,row:a,isSelected:l,rowCount:r,singleSelect:d}=t;return d?l?Object.assign(Object.assign({},e),{selectedCount:0,allSelected:!1,selectedRows:[],toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:1,allSelected:!1,selectedRows:[a],toggleOnSelectedRowsChange:n}):l?Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length>0?e.selectedRows.length-1:0,allSelected:!1,selectedRows:s(e.selectedRows,a,o),toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length+1,allSelected:e.selectedRows.length+1===r,selectedRows:i(e.selectedRows,a),toggleOnSelectedRowsChange:n})}case"SELECT_MULTIPLE_ROWS":{const{keyField:o,selectedRows:a,totalRows:l,mergeSelections:r}=t;if(r){const t=[...e.selectedRows,...a.filter((t=>!b$1(t,e.selectedRows,o)))];return Object.assign(Object.assign({},e),{selectedCount:t.length,allSelected:!1,selectedRows:t,toggleOnSelectedRowsChange:n})}return Object.assign(Object.assign({},e),{selectedCount:a.length,allSelected:a.length===l,selectedRows:a,toggleOnSelectedRowsChange:n})}case"CLEAR_SELECTED_ROWS":{const{selectedRowsFlag:n}=t;return Object.assign(Object.assign({},e),{allSelected:!1,selectedCount:0,selectedRows:[],selectedRowsFlag:n})}case"SORT_CHANGE":{const{sortDirection:o,selectedColumn:a,clearSelectedOnSort:l}=t;return Object.assign(Object.assign(Object.assign({},e),{selectedColumn:a,sortDirection:o,currentPage:1}),l&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_PAGE":{const{page:o,paginationServer:a,visibleOnly:l,persistSelectedOnPageChange:r}=t,i=a&&r,s=a&&!r||l;return Object.assign(Object.assign(Object.assign(Object.assign({},e),{currentPage:o}),i&&{allSelected:!1}),s&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_ROWS_PER_PAGE":{const{rowsPerPage:n,page:o}=t;return Object.assign(Object.assign({},e),{currentPage:o,rowsPerPage:n})}}}const f=css`
|
|
@@ -5477,7 +5496,7 @@ const Input = React__default.forwardRef((_a, ref) => {
|
|
|
5477
5496
|
error: hasErrors,
|
|
5478
5497
|
'input--has-icon': iconName,
|
|
5479
5498
|
}, className);
|
|
5480
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: "input-wrapper", children: [iconName && (jsx(Icon, { name: iconName, "data-testid": `${name}-embedded-icon`, className: "embedded-icon" })), jsx("input", Object.assign({ ref: ref, tabIndex: tabIndex, id: id, "data-testid": `form-input-${name}`, name: name, type: "text", disabled: isDisabled, placeholder: placeholder, readOnly: readonly, onChange: onChange, onBlur: onBlur, maxLength: maxLength, onKeyDown: onKeyDown, className: inputClasses, "aria-invalid": hasErrors ? true : undefined, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, rest)), isClearable && !isDisabled && (jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "
|
|
5499
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: "input-wrapper", children: [iconName && (jsx(Icon, { name: iconName, "data-testid": `${name}-embedded-icon`, className: "embedded-icon", size: "sm" })), jsx("input", Object.assign({ ref: ref, tabIndex: tabIndex, id: id, "data-testid": `form-input-${name}`, name: name, type: "text", disabled: isDisabled, placeholder: placeholder, readOnly: readonly, onChange: onChange, onBlur: onBlur, maxLength: maxLength, onKeyDown: onKeyDown, className: inputClasses, "aria-invalid": hasErrors ? true : undefined, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, rest)), isClearable && !isDisabled && (jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "xs", onClick: handleClear, className: "clearable-icon" }))] }), hasErrors && jsx(DisplayFormError, { "data-testid": `${name}-error`, message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
5481
5500
|
});
|
|
5482
5501
|
const LabeledInput = withLabel(Input);
|
|
5483
5502
|
|
|
@@ -5516,7 +5535,7 @@ const Pagination = (_a) => {
|
|
|
5516
5535
|
const isNextButtonDisabled = currentPage === totalPages;
|
|
5517
5536
|
const isPreviousButtonDisabled = currentPage === 1;
|
|
5518
5537
|
const hasError = Number(inputValue) > totalPages || Number(inputValue) < 1;
|
|
5519
|
-
return (jsx("div", Object.assign({ className: classes }, rest, { children: jsx(Container, { children: jsxs(Row, { gutterWidth: 12, align: "center", children: [jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__previous", children: jsx(Button$1, { "data-testid": "pagination-previous-button", ariaLabel: "Previous Page", variant: "link", onClick: handlePreviousPage, iconLeft: "chevron-left", isDisabled: isPreviousButtonDisabled || totalPages === 0 }) }) }), jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__current-page", children: jsx(LabeledInput, { "data-testid": "pagination-current-page-input", className: classNames('pagination__current-page-input', {
|
|
5538
|
+
return (jsx("div", Object.assign({ className: classes }, rest, { children: jsx(Container, { children: jsxs(Row, { gutterWidth: 12, align: "center", children: [jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__previous", children: jsx(Button$1, { "data-testid": "pagination-previous-button", ariaLabel: "Previous Page", variant: "link", onClick: handlePreviousPage, iconLeft: "chevron-left", size: "sm", isDisabled: isPreviousButtonDisabled || totalPages === 0 }) }) }), jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__current-page", children: jsx(LabeledInput, { "data-testid": "pagination-current-page-input", className: classNames('pagination__current-page-input', {
|
|
5520
5539
|
'has-error': hasError,
|
|
5521
5540
|
}), value: totalPages === 0 ? '0' : inputValue, name: "currentPage", label: "Current Page", hasHiddenLabel: true, onKeyDown: (e) => {
|
|
5522
5541
|
if (e.key === 'Enter') {
|
|
@@ -5528,7 +5547,7 @@ const Pagination = (_a) => {
|
|
|
5528
5547
|
if (value === '' || /^\d*$/.test(value)) {
|
|
5529
5548
|
setInputValue(value);
|
|
5530
5549
|
}
|
|
5531
|
-
}, onBlur: (e) => validateAndUpdatePage(e.currentTarget.value) }) }) }), jsx(Col, { xs: "content", children: jsx("p", { className: "pagination__page-total", children: totalPagesText }) }), jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__next", children: jsx(Button$1, { "data-testid": "pagination-next-button", ariaLabel: "Next Page", variant: "link", onClick: handleNextPage, iconLeft: "chevron-right", isDisabled: isNextButtonDisabled || totalPages === 0 }) }) })] }) }) })));
|
|
5550
|
+
}, onBlur: (e) => validateAndUpdatePage(e.currentTarget.value) }) }) }), jsx(Col, { xs: "content", children: jsx("p", { className: "pagination__page-total", children: totalPagesText }) }), jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__next", children: jsx(Button$1, { "data-testid": "pagination-next-button", ariaLabel: "Next Page", variant: "link", onClick: handleNextPage, iconLeft: "chevron-right", isDisabled: isNextButtonDisabled || totalPages === 0, size: "sm" }) }) })] }) }) })));
|
|
5532
5551
|
};
|
|
5533
5552
|
|
|
5534
5553
|
const TablePagination$1 = ({ rowsPerPage, rowCount, onChangePage, currentPage, totalEntriesText, }) => {
|
|
@@ -5807,7 +5826,7 @@ const PasswordInput = React__default.forwardRef((_a, ref) => {
|
|
|
5807
5826
|
const inputClasses = classNames('password-input', {
|
|
5808
5827
|
error: hasErrors,
|
|
5809
5828
|
}, 'password-input--has-icon');
|
|
5810
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: "password-input-wrapper", children: [jsx(Icon, { name: "lock", "data-testid": `${name}-embedded-icon`, className: "embedded-icon" }), jsx("input", Object.assign({ ref: ref, "data-testid": `form-password-input-${name}`, name: name, type: showPassword ? 'text' : 'password', disabled: isDisabled, placeholder: placeholder, onChange: onChange, onBlur: onBlur, onKeyDown: onKeyDown, className: inputClasses, "aria-invalid": hasErrors ? 'true' : 'false', "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, rest)), hasShowPassword && (jsx(Icon, { name: showPassword ? 'fa-eye-slash' : 'eye', "data-testid": `${name}-${showPassword ? 'hide' : 'show'}-password-icon`, size: "
|
|
5829
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: "password-input-wrapper", children: [jsx(Icon, { name: "lock", "data-testid": `${name}-embedded-icon`, className: "embedded-icon", size: "sm" }), jsx("input", Object.assign({ ref: ref, "data-testid": `form-password-input-${name}`, name: name, type: showPassword ? 'text' : 'password', disabled: isDisabled, placeholder: placeholder, onChange: onChange, onBlur: onBlur, onKeyDown: onKeyDown, className: inputClasses, "aria-invalid": hasErrors ? 'true' : 'false', "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, rest)), hasShowPassword && (jsx(Icon, { name: showPassword ? 'fa-eye-slash' : 'eye', "data-testid": `${name}-${showPassword ? 'hide' : 'show'}-password-icon`, size: "sm", onClick: handleShowPassword, className: "toggle-show-password-icon" }))] }), hasErrors && jsx(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
5811
5830
|
});
|
|
5812
5831
|
const LabeledPasswordInput = withLabel(PasswordInput);
|
|
5813
5832
|
|
|
@@ -13827,6 +13846,7 @@ const defaultOptions$1 = {
|
|
|
13827
13846
|
middleware: [offset$2(5), flip$2(), shift$2()],
|
|
13828
13847
|
};
|
|
13829
13848
|
function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal = false, portalOptions = {}, floatingOptions = defaultOptions$1, className, hover = false, onOpenChange, }) {
|
|
13849
|
+
var _a;
|
|
13830
13850
|
const [internalIsOpen, setInternalIsOpen] = useState(false);
|
|
13831
13851
|
// Determine whether the component is controlled or uncontrolled
|
|
13832
13852
|
const isControlled = controlledIsOpen !== undefined && controlledSetIsOpen !== undefined;
|
|
@@ -13842,11 +13862,12 @@ function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: con
|
|
|
13842
13862
|
if (!isValidElement(trigger) || !isValidElement(content)) {
|
|
13843
13863
|
throw new Error('Both children of FloatUI must be valid React elements.');
|
|
13844
13864
|
}
|
|
13865
|
+
const referenceElement = ((_a = floatingOptions.elements) === null || _a === void 0 ? void 0 : _a.reference) || referenceElementRef.current;
|
|
13845
13866
|
const { refs, floatingStyles, context } = useFloating(Object.assign(Object.assign({}, floatingOptions), { open: isOpen, onOpenChange: (isOpen) => {
|
|
13846
13867
|
setIsOpen(isOpen);
|
|
13847
13868
|
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);
|
|
13848
13869
|
}, elements: {
|
|
13849
|
-
reference:
|
|
13870
|
+
reference: referenceElement,
|
|
13850
13871
|
} }));
|
|
13851
13872
|
// Can't call hooks conditionally so this enabled option is needed.
|
|
13852
13873
|
const click = useClick(context, { enabled: !hover });
|
|
@@ -43468,7 +43489,7 @@ const Legend = ({ currentStep, steps, onStepClick }) => {
|
|
|
43468
43489
|
return (jsxs("div", { children: [jsxs(Row, { nogutter: true, align: "center", children: [jsx(Col, { xs: "content", children: jsx("div", { className: classNames('stepper-legend-circle', {
|
|
43469
43490
|
completed: isCompleted,
|
|
43470
43491
|
current: isCurrent,
|
|
43471
|
-
}), children: isCompleted ? jsx(Icon, { name: "check" }) : index + 1 }) }), jsx(Col, { children: jsx("div", { className: classNames('stepper-legend-step', {
|
|
43492
|
+
}), children: isCompleted ? jsx(Icon, { name: "check", size: "sm" }) : index + 1 }) }), jsx(Col, { children: jsx("div", { className: classNames('stepper-legend-step', {
|
|
43472
43493
|
'stepper-legend-step--current-step': isCurrent,
|
|
43473
43494
|
'stepper-legend-step--completed-step': isCompleted,
|
|
43474
43495
|
'stepper-legend-step--disabled-step': !isSidebarEnabled,
|