@gnist/design-system 3.8.1 → 3.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +105 -6
  3. package/dist/building-blocks/inputs/InputHelperText.cjs +1 -1
  4. package/dist/building-blocks/inputs/InputHelperText.js +1 -1
  5. package/dist/building-blocks/skeletons/CircularSkeleton.cjs +1 -2
  6. package/dist/building-blocks/skeletons/CircularSkeleton.d.ts.map +1 -1
  7. package/dist/building-blocks/skeletons/CircularSkeleton.js +1 -2
  8. package/dist/building-blocks/skeletons/RectangularSkeleton.d.ts.map +1 -1
  9. package/dist/building-blocks/skeletons/TextSkeleton.d.ts.map +1 -1
  10. package/dist/components/actions/buttons/ButtonBase.cjs +4 -4
  11. package/dist/components/actions/buttons/ButtonBase.d.ts +2 -1
  12. package/dist/components/actions/buttons/ButtonBase.d.ts.map +1 -1
  13. package/dist/components/actions/buttons/ButtonBase.js +4 -4
  14. package/dist/components/actions/buttons/DangerButton.cjs +3 -4
  15. package/dist/components/actions/buttons/DangerButton.d.ts +1 -1
  16. package/dist/components/actions/buttons/DangerButton.d.ts.map +1 -1
  17. package/dist/components/actions/buttons/DangerButton.js +3 -4
  18. package/dist/components/actions/buttons/GhostButton.cjs +3 -4
  19. package/dist/components/actions/buttons/GhostButton.d.ts +1 -1
  20. package/dist/components/actions/buttons/GhostButton.d.ts.map +1 -1
  21. package/dist/components/actions/buttons/GhostButton.js +3 -4
  22. package/dist/components/actions/buttons/IconButton.cjs +11 -15
  23. package/dist/components/actions/buttons/IconButton.d.ts +3 -2
  24. package/dist/components/actions/buttons/IconButton.d.ts.map +1 -1
  25. package/dist/components/actions/buttons/IconButton.js +12 -16
  26. package/dist/components/actions/buttons/PrimaryButton.cjs +3 -4
  27. package/dist/components/actions/buttons/PrimaryButton.d.ts +1 -1
  28. package/dist/components/actions/buttons/PrimaryButton.d.ts.map +1 -1
  29. package/dist/components/actions/buttons/PrimaryButton.js +3 -4
  30. package/dist/components/actions/buttons/SecondaryButton.cjs +3 -4
  31. package/dist/components/actions/buttons/SecondaryButton.d.ts +1 -1
  32. package/dist/components/actions/buttons/SecondaryButton.d.ts.map +1 -1
  33. package/dist/components/actions/buttons/SecondaryButton.js +3 -4
  34. package/dist/components/actions/buttons/SuccessButton.cjs +3 -4
  35. package/dist/components/actions/buttons/SuccessButton.d.ts +1 -1
  36. package/dist/components/actions/buttons/SuccessButton.d.ts.map +1 -1
  37. package/dist/components/actions/buttons/SuccessButton.js +3 -4
  38. package/dist/components/actions/buttons/TextButton.cjs +2 -3
  39. package/dist/components/actions/buttons/TextButton.d.ts +3 -2
  40. package/dist/components/actions/buttons/TextButton.d.ts.map +1 -1
  41. package/dist/components/actions/buttons/TextButton.js +3 -4
  42. package/dist/components/actions/buttons/createButtonVariant.cjs +18 -21
  43. package/dist/components/actions/buttons/createButtonVariant.d.ts.map +1 -1
  44. package/dist/components/actions/buttons/createButtonVariant.js +18 -21
  45. package/dist/components/actions/chips/ActionChip.cjs +2 -2
  46. package/dist/components/actions/chips/ActionChip.js +2 -2
  47. package/dist/components/actions/chips/FilterChip.cjs +2 -2
  48. package/dist/components/actions/chips/FilterChip.js +2 -2
  49. package/dist/components/actions/selectionControls/Checkbox.cjs +1 -1
  50. package/dist/components/actions/selectionControls/Checkbox.js +1 -1
  51. package/dist/components/actions/selectionControls/RadioButton.cjs +2 -2
  52. package/dist/components/actions/selectionControls/RadioButton.js +2 -2
  53. package/dist/components/actions/selectionControls/shared.d.ts.map +1 -1
  54. package/dist/components/feedback/alerts/AlertBanner.cjs +9 -6
  55. package/dist/components/feedback/alerts/AlertBanner.d.ts.map +1 -1
  56. package/dist/components/feedback/alerts/AlertBanner.js +9 -6
  57. package/dist/components/feedback/loaders/LoadingSpinner.d.ts.map +1 -1
  58. package/dist/components/inputs/dropdowns/SelectBase.cjs +9 -16
  59. package/dist/components/inputs/dropdowns/SelectBase.js +9 -16
  60. package/dist/components/inputs/pickers/calendar.cjs +10 -12
  61. package/dist/components/inputs/pickers/calendar.js +10 -12
  62. package/dist/components/inputs/shared.cjs +1 -4
  63. package/dist/components/inputs/shared.js +1 -4
  64. package/dist/components/inputs/textFields/TextArea.cjs +4 -6
  65. package/dist/components/inputs/textFields/TextArea.d.ts.map +1 -1
  66. package/dist/components/inputs/textFields/TextArea.js +4 -6
  67. package/dist/components/inputs/textFields/TextField.cjs +6 -9
  68. package/dist/components/inputs/textFields/TextField.js +6 -9
  69. package/dist/components/surfaces/cards/internal/SelectionCard.d.ts.map +1 -1
  70. package/dist/components/surfaces/modal/Modal.cjs +19 -15
  71. package/dist/components/surfaces/modal/Modal.js +19 -15
  72. package/dist/translations/index.d.ts.map +1 -1
  73. package/dist/utilities/forms/formContext.cjs +2 -2
  74. package/dist/utilities/forms/formContext.js +2 -2
  75. package/dist/utilities/forms/formHelpers.cjs +12 -16
  76. package/dist/utilities/forms/formHelpers.d.ts.map +1 -1
  77. package/dist/utilities/forms/formHelpers.js +12 -16
  78. package/dist/utilities/forms/internal/components.cjs +2 -4
  79. package/dist/utilities/forms/internal/components.js +2 -4
  80. package/dist/utilities/forms/useFormProps.cjs +2 -4
  81. package/dist/utilities/forms/useFormProps.js +2 -4
  82. package/dist/utilities/html/index.d.ts.map +1 -1
  83. package/dist/utilities/time/date.d.ts.map +1 -1
  84. package/dist/utilities/tokens/tokens.cjs +1 -2
  85. package/dist/utilities/tokens/tokens.d.ts.map +1 -1
  86. package/dist/utilities/tokens/tokens.js +1 -2
  87. package/dist/utilities/validation/validation.cjs +1 -1
  88. package/dist/utilities/validation/validation.d.ts.map +1 -1
  89. package/dist/utilities/validation/validation.js +1 -1
  90. package/dist/utilities/validation/validationSteps.d.ts.map +1 -1
  91. package/dist/utilities/validation/validators.d.ts.map +1 -1
  92. package/package.json +9 -9
@@ -7,5 +7,5 @@ There shouldn’t be more than one success button on a page to avoid overwhelmin
7
7
 
8
8
  Documentation: [SuccessButton](https://gnist.moller.no/developers/components/latest/?path=/docs/components-actions-buttons-successbutton--docs)
9
9
  */
10
- export declare const SuccessButton: import("react").ForwardRefExoticComponent<Omit<BoxedButtonProps<ElementType>, "ref"> & import("react").RefAttributes<Element>>;
10
+ export declare function SuccessButton<AsElement extends ElementType = "button">(props: BoxedButtonProps<AsElement>): import("react/jsx-runtime").JSX.Element;
11
11
  //# sourceMappingURL=SuccessButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SuccessButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/buttons/SuccessButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4B,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAmB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGpE;;;;;;EAME;AAEF,eAAO,MAAM,aAAa,gIASxB,CAAC"}
1
+ {"version":3,"file":"SuccessButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/buttons/SuccessButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAmB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGpE;;;;;;EAME;AAEF,wBAAgB,aAAa,CAAC,SAAS,SAAS,WAAW,GAAG,QAAQ,EAClE,KAAK,EAAE,gBAAgB,CAAC,SAAS,CAAC,2CAGrC"}
@@ -1,11 +1,10 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
3
  import { BoxedButtonBase } from "./ButtonBase.js";
5
4
  import { getButtonVariantProps } from "./createButtonVariant.js";
6
- const SuccessButton = forwardRef(function SuccessButton2(props, ref) {
7
- return jsx(BoxedButtonBase, { ref, ...getButtonVariantProps("success", props) });
8
- });
5
+ function SuccessButton(props) {
6
+ return jsx(BoxedButtonBase, { ...getButtonVariantProps("success", props) });
7
+ }
9
8
  export {
10
9
  SuccessButton
11
10
  };
@@ -14,10 +14,9 @@ const states_css = require("../../../styles/states.css.cjs");
14
14
  const styles_css = require("./styles.css.cjs");
15
15
  const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
16
16
  const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
17
- const TextButton = React.forwardRef(function TextButton2({ $as, as, className, underline, ...props }, ref) {
17
+ function TextButton({ $as, as, className, underline, ...props }) {
18
18
  return React.createElement($as ?? as ?? "button", {
19
19
  ...props,
20
- ref,
21
20
  className: classNames__default.default(className, styles_css.buttonRecipe({ color: "transparent", buttonType: "text" }), states_css.stateLayers({
22
21
  borderSize: "medium",
23
22
  borderRadius: "button",
@@ -25,5 +24,5 @@ const TextButton = React.forwardRef(function TextButton2({ $as, as, className, u
25
24
  setFocusState: true
26
25
  }))
27
26
  }, props.children ? jsxRuntime.jsx(index.BodyText, { className: classNames__default.default(styles_css.actionText, styles_css.textButtonText({ underline })), children: props.children }) : void 0);
28
- });
27
+ }
29
28
  exports.TextButton = TextButton;
@@ -1,10 +1,11 @@
1
1
  import { PolymorphicProps } from "@gnist/component-utils";
2
- import { ElementType } from "react";
2
+ import { ElementType, ForwardedRef } from "react";
3
3
  type TextButtonProps<AsElement extends ElementType> = PolymorphicProps<AsElement> & {
4
4
  /**
5
5
  * Should the text be underlined?
6
6
  */
7
7
  underline?: boolean;
8
+ ref?: ForwardedRef<Element>;
8
9
  };
9
10
  /**
10
11
  Text buttons are typically used for less-pronounced actions, including those located in dialogs and cards. In cards and dialogs, text buttons help maintain an emphasis on card content. Because the background is transparent, the text and underline color is inherited from ancestors to acommodate use on different background colors.
@@ -13,6 +14,6 @@ Note: Unlike most button components, `disabled`, `loading` and `density` props d
13
14
 
14
15
  Documentation: [TextButton](https://gnist.moller.no/developers/components/latest/?path=/docs/components-actions-buttons-textbutton--docs)
15
16
  */
16
- export declare const TextButton: import("react").ForwardRefExoticComponent<Omit<TextButtonProps<ElementType>, "ref"> & import("react").RefAttributes<Element>>;
17
+ export declare function TextButton<AsElement extends ElementType = "button">({ $as, as, className, underline, ...props }: TextButtonProps<AsElement>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
17
18
  export {};
18
19
  //# sourceMappingURL=TextButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/buttons/TextButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,OAAO,EAAE,WAAW,EAA2C,MAAM,OAAO,CAAC;AAG7E,KAAK,eAAe,CAAC,SAAS,SAAS,WAAW,IAC9C,gBAAgB,CAAC,SAAS,CAAC,GAAG;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEN;;;;;;EAME;AACF,eAAO,MAAM,UAAU,+HAiCrB,CAAC"}
1
+ {"version":3,"file":"TextButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/buttons/TextButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAiB,MAAM,OAAO,CAAC;AAGjE,KAAK,eAAe,CAAC,SAAS,SAAS,WAAW,IAC9C,gBAAgB,CAAC,SAAS,CAAC,GAAG;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CAC/B,CAAC;AAEN;;;;;;EAME;AACF,wBAAgB,UAAU,CAAC,SAAS,SAAS,WAAW,GAAG,QAAQ,EAAE,EACjE,GAAG,EACH,EAAE,EACF,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACX,EAAE,eAAe,CAAC,SAAS,CAAC,0FA2B5B"}
@@ -5,15 +5,14 @@ import "../../../foundation/iconography/IconVariantProvider.js";
5
5
  import "../../../foundation/iconography/icons.js";
6
6
  import "../../../foundation/iconography/Icon.js";
7
7
  import { BodyText } from "../../../foundation/typography/index.js";
8
- import { forwardRef, createElement } from "react";
8
+ import { createElement } from "react";
9
9
  import classNames from "classnames";
10
10
  import "../../../foundation/logos/Logo.css.js";
11
11
  import { stateLayers } from "../../../styles/states.css.js";
12
12
  import { buttonRecipe, actionText, textButtonText } from "./styles.css.js";
13
- const TextButton = forwardRef(function TextButton2({ $as, as, className, underline, ...props }, ref) {
13
+ function TextButton({ $as, as, className, underline, ...props }) {
14
14
  return createElement($as ?? as ?? "button", {
15
15
  ...props,
16
- ref,
17
16
  className: classNames(className, buttonRecipe({ color: "transparent", buttonType: "text" }), stateLayers({
18
17
  borderSize: "medium",
19
18
  borderRadius: "button",
@@ -21,7 +20,7 @@ const TextButton = forwardRef(function TextButton2({ $as, as, className, underli
21
20
  setFocusState: true
22
21
  }))
23
22
  }, props.children ? jsx(BodyText, { className: classNames(actionText, textButtonText({ underline })), children: props.children }) : void 0);
24
- });
23
+ }
25
24
  export {
26
25
  TextButton
27
26
  };
@@ -6,25 +6,22 @@ const classNames = require("classnames");
6
6
  const styles_css = require("./styles.css.cjs");
7
7
  const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
8
8
  const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
9
- const getButtonVariantProps = (color, { ...props }) => {
10
- var _a;
11
- return {
12
- ...props,
13
- className: classNames__default.default(props.className, styles_css.buttonRecipe({
14
- color,
15
- buttonType: "box",
16
- isLoading: (_a = props.loading) == null ? void 0 : _a.isLoading
17
- }), color === "transparent" ? states_css.stateLayers({
18
- borderSize: "medium",
19
- borderRadius: "button",
20
- backgroundColor: "palette-black",
21
- setFocusState: true
22
- }) : states_css.stateLayers({
23
- borderSize: "none",
24
- borderRadius: "button",
25
- backgroundColor: `on-${color}`,
26
- setFocusState: true
27
- }))
28
- };
29
- };
9
+ const getButtonVariantProps = (color, { ...props }) => ({
10
+ ...props,
11
+ className: classNames__default.default(props.className, styles_css.buttonRecipe({
12
+ color,
13
+ buttonType: "box",
14
+ isLoading: props.loading?.isLoading
15
+ }), color === "transparent" ? states_css.stateLayers({
16
+ borderSize: "medium",
17
+ borderRadius: "button",
18
+ backgroundColor: "palette-black",
19
+ setFocusState: true
20
+ }) : states_css.stateLayers({
21
+ borderSize: "none",
22
+ borderRadius: "button",
23
+ backgroundColor: `on-${color}`,
24
+ setFocusState: true
25
+ }))
26
+ });
30
27
  exports.getButtonVariantProps = getButtonVariantProps;
@@ -1 +1 @@
1
- {"version":3,"file":"createButtonVariant.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/buttons/createButtonVariant.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,eAAO,MAAM,qBAAqB,GAAI,SAAS,SAAS,WAAW,EAC/D,OAAO,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,EACpE,cAAc,gBAAgB,CAAC,SAAS,CAAC,KAC1C,gBAAgB,CAAC,SAAS,CAuB3B,CAAC"}
1
+ {"version":3,"file":"createButtonVariant.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/buttons/createButtonVariant.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,eAAO,MAAM,qBAAqB,GAAI,SAAS,SAAS,WAAW,SACxD,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,gBACtD,gBAAgB,CAAC,SAAS,CAAC,KAC1C,gBAAgB,CAAC,SAAS,CAuB3B,CAAC"}
@@ -2,27 +2,24 @@
2
2
  import { stateLayers } from "../../../styles/states.css.js";
3
3
  import classNames from "classnames";
4
4
  import { buttonRecipe } from "./styles.css.js";
5
- const getButtonVariantProps = (color, { ...props }) => {
6
- var _a;
7
- return {
8
- ...props,
9
- className: classNames(props.className, buttonRecipe({
10
- color,
11
- buttonType: "box",
12
- isLoading: (_a = props.loading) == null ? void 0 : _a.isLoading
13
- }), color === "transparent" ? stateLayers({
14
- borderSize: "medium",
15
- borderRadius: "button",
16
- backgroundColor: "palette-black",
17
- setFocusState: true
18
- }) : stateLayers({
19
- borderSize: "none",
20
- borderRadius: "button",
21
- backgroundColor: `on-${color}`,
22
- setFocusState: true
23
- }))
24
- };
25
- };
5
+ const getButtonVariantProps = (color, { ...props }) => ({
6
+ ...props,
7
+ className: classNames(props.className, buttonRecipe({
8
+ color,
9
+ buttonType: "box",
10
+ isLoading: props.loading?.isLoading
11
+ }), color === "transparent" ? stateLayers({
12
+ borderSize: "medium",
13
+ borderRadius: "button",
14
+ backgroundColor: "palette-black",
15
+ setFocusState: true
16
+ }) : stateLayers({
17
+ borderSize: "none",
18
+ borderRadius: "button",
19
+ backgroundColor: `on-${color}`,
20
+ setFocusState: true
21
+ }))
22
+ });
26
23
  export {
27
24
  getButtonVariantProps
28
25
  };
@@ -22,12 +22,12 @@ const ActionChip = React.forwardRef(function ActionChip2({ label, onClick, selec
22
22
  return jsxRuntime.jsx("button", { type: "button", ...props, title: label, onClick, className: classNames__default.default(styles_css$1.chipRecipe({
23
23
  selected,
24
24
  filterVariant: false,
25
- loading: loading == null ? void 0 : loading.isLoading
25
+ loading: loading?.isLoading
26
26
  }), animations_css.clickAnimation, states_css.focusStyle, states_css.stateLayers({
27
27
  borderSize: "medium",
28
28
  borderRadius: "full",
29
29
  backgroundColor: "on-background",
30
30
  setFocusState: true
31
- })), ref, children: (loading == null ? void 0 : loading.isLoading) ? jsxRuntime.jsx(Spinner.Spinner, { diameter: density === "compact" ? tokens_css_js.tokens.size.xs : tokens_css_js.tokens.size.s, textDescription: loading.loadingText }) : jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [icon && jsxRuntime.jsx(Icon.Icon, { icon, size: density === "compact" ? "m" : "l" }), jsxRuntime.jsx(index.BodyText, { className: styles_css.actionText, children: label })] }) });
31
+ })), ref, children: loading?.isLoading ? jsxRuntime.jsx(Spinner.Spinner, { diameter: density === "compact" ? tokens_css_js.tokens.size.xs : tokens_css_js.tokens.size.s, textDescription: loading.loadingText }) : jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [icon && jsxRuntime.jsx(Icon.Icon, { icon, size: density === "compact" ? "m" : "l" }), jsxRuntime.jsx(index.BodyText, { className: styles_css.actionText, children: label })] }) });
32
32
  });
33
33
  exports.ActionChip = ActionChip;
@@ -18,13 +18,13 @@ const ActionChip = forwardRef(function ActionChip2({ label, onClick, selected, i
18
18
  return jsx("button", { type: "button", ...props, title: label, onClick, className: classNames(chipRecipe({
19
19
  selected,
20
20
  filterVariant: false,
21
- loading: loading == null ? void 0 : loading.isLoading
21
+ loading: loading?.isLoading
22
22
  }), clickAnimation, focusStyle, stateLayers({
23
23
  borderSize: "medium",
24
24
  borderRadius: "full",
25
25
  backgroundColor: "on-background",
26
26
  setFocusState: true
27
- })), ref, children: (loading == null ? void 0 : loading.isLoading) ? jsx(Spinner, { diameter: density === "compact" ? tokens.size.xs : tokens.size.s, textDescription: loading.loadingText }) : jsxs(Fragment, { children: [icon && jsx(Icon, { icon, size: density === "compact" ? "m" : "l" }), jsx(BodyText, { className: actionText, children: label })] }) });
27
+ })), ref, children: loading?.isLoading ? jsx(Spinner, { diameter: density === "compact" ? tokens.size.xs : tokens.size.s, textDescription: loading.loadingText }) : jsxs(Fragment, { children: [icon && jsx(Icon, { icon, size: density === "compact" ? "m" : "l" }), jsx(BodyText, { className: actionText, children: label })] }) });
28
28
  });
29
29
  export {
30
30
  ActionChip
@@ -22,12 +22,12 @@ const FilterChip = React.forwardRef(function FilterChip2({ label, onClick, selec
22
22
  return jsxRuntime.jsxs("button", { type: "button", ...props, title: label, onClick, className: classNames__default.default(styles_css$1.chipRecipe({
23
23
  selected,
24
24
  filterVariant: true,
25
- loading: loading == null ? void 0 : loading.isLoading
25
+ loading: loading?.isLoading
26
26
  }), animations_css.clickAnimation, states_css.focusStyle, states_css.stateLayers({
27
27
  borderSize: "medium",
28
28
  borderRadius: "full",
29
29
  backgroundColor: "on-background",
30
30
  setFocusState: true
31
- })), ref, children: [(icon || selected) && !(loading == null ? void 0 : loading.isLoading) && jsxRuntime.jsx(Icon.Icon, { icon: selected ? "check" : icon }), (loading == null ? void 0 : loading.isLoading) ? jsxRuntime.jsx(Spinner.Spinner, { diameter: density === "compact" ? tokens_css_js.tokens.size.xs : tokens_css_js.tokens.size.s, textDescription: loading.loadingText }) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(index.BodyText, { className: styles_css.actionText, children: label }) })] });
31
+ })), ref, children: [(icon || selected) && !loading?.isLoading && jsxRuntime.jsx(Icon.Icon, { icon: selected ? "check" : icon }), loading?.isLoading ? jsxRuntime.jsx(Spinner.Spinner, { diameter: density === "compact" ? tokens_css_js.tokens.size.xs : tokens_css_js.tokens.size.s, textDescription: loading.loadingText }) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(index.BodyText, { className: styles_css.actionText, children: label }) })] });
32
32
  });
33
33
  exports.FilterChip = FilterChip;
@@ -18,13 +18,13 @@ const FilterChip = forwardRef(function FilterChip2({ label, onClick, selected, l
18
18
  return jsxs("button", { type: "button", ...props, title: label, onClick, className: classNames(chipRecipe({
19
19
  selected,
20
20
  filterVariant: true,
21
- loading: loading == null ? void 0 : loading.isLoading
21
+ loading: loading?.isLoading
22
22
  }), clickAnimation, focusStyle, stateLayers({
23
23
  borderSize: "medium",
24
24
  borderRadius: "full",
25
25
  backgroundColor: "on-background",
26
26
  setFocusState: true
27
- })), ref, children: [(icon || selected) && !(loading == null ? void 0 : loading.isLoading) && jsx(Icon, { icon: selected ? "check" : icon }), (loading == null ? void 0 : loading.isLoading) ? jsx(Spinner, { diameter: density === "compact" ? tokens.size.xs : tokens.size.s, textDescription: loading.loadingText }) : jsx(Fragment, { children: jsx(BodyText, { className: actionText, children: label }) })] });
27
+ })), ref, children: [(icon || selected) && !loading?.isLoading && jsx(Icon, { icon: selected ? "check" : icon }), loading?.isLoading ? jsx(Spinner, { diameter: density === "compact" ? tokens.size.xs : tokens.size.s, textDescription: loading.loadingText }) : jsx(Fragment, { children: jsx(BodyText, { className: actionText, children: label }) })] });
28
28
  });
29
29
  export {
30
30
  FilterChip
@@ -49,7 +49,7 @@ const Checkbox = React.forwardRef(function Checkbox2({
49
49
  const checkboxElement = jsxRuntime.jsx("span", { className: `${shared_css.InputWrapper} ${className}`, ref, children: jsxRuntime.jsxs("label", { htmlFor: inputId, className: shared_css.LabelRecipe({ disabled }), id: labelId, children: [jsxRuntime.jsx("input", { type: "checkbox", id: inputId, disabled, onChange, checked: value === true, className: shared_css.InputStyleRecipe({ disabled }), tabIndex: 0, ...inputAriaProps, ...rest }), jsxRuntime.jsx("span", { className: checkbox_css.CheckboxRecipe({
50
50
  checked: value,
51
51
  disabled,
52
- validity: (validity == null ? void 0 : validity.type) === "error" ? "error" : void 0
52
+ validity: validity?.type === "error" ? "error" : void 0
53
53
  }), children: jsxRuntime.jsx(CustomCheckbox, { value, disabled }) }), hideLabel ? jsxRuntime.jsx(ScreenReaderOnly.ScreenReaderOnly, { children: label }) : jsxRuntime.jsx("span", { className: shared_css.LabelStyle, children: label })] }) });
54
54
  return jsxRuntime.jsx(shared.HelperTextWrapper, { ...helperTextProps, children: render(checkboxElement, descriptionElement) });
55
55
  });
@@ -47,7 +47,7 @@ const Checkbox = forwardRef(function Checkbox2({
47
47
  const checkboxElement = jsx("span", { className: `${InputWrapper} ${className}`, ref, children: jsxs("label", { htmlFor: inputId, className: LabelRecipe({ disabled }), id: labelId, children: [jsx("input", { type: "checkbox", id: inputId, disabled, onChange, checked: value === true, className: InputStyleRecipe({ disabled }), tabIndex: 0, ...inputAriaProps, ...rest }), jsx("span", { className: CheckboxRecipe({
48
48
  checked: value,
49
49
  disabled,
50
- validity: (validity == null ? void 0 : validity.type) === "error" ? "error" : void 0
50
+ validity: validity?.type === "error" ? "error" : void 0
51
51
  }), children: jsx(CustomCheckbox, { value, disabled }) }), hideLabel ? jsx(ScreenReaderOnly, { children: label }) : jsx("span", { className: LabelStyle, children: label })] }) });
52
52
  return jsx(HelperTextWrapper, { ...helperTextProps, children: render(checkboxElement, descriptionElement) });
53
53
  });
@@ -16,11 +16,11 @@ const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
16
16
  const CustomRadioButton = ({ value, disabled, validity }) => {
17
17
  return jsxRuntime.jsx("span", { className: radiobutton_css.RadioButtonRecipe({
18
18
  disabled,
19
- validity: validity == null ? void 0 : validity.type
19
+ validity: validity?.type
20
20
  }), "aria-hidden": true, children: jsxRuntime.jsx("span", { className: radiobutton_css.CheckedCircleRecipe({
21
21
  checked: value,
22
22
  disabled,
23
- validity: validity == null ? void 0 : validity.type
23
+ validity: validity?.type
24
24
  }) }) });
25
25
  };
26
26
  const defaultRender = (radio, description) => jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [radio, jsxRuntime.jsx("div", { className: shared_css.indentedDescriptionStyle, children: description })] });
@@ -12,11 +12,11 @@ import { SelectionDescription, HelperTextWrapper } from "./shared.js";
12
12
  const CustomRadioButton = ({ value, disabled, validity }) => {
13
13
  return jsx("span", { className: RadioButtonRecipe({
14
14
  disabled,
15
- validity: validity == null ? void 0 : validity.type
15
+ validity: validity?.type
16
16
  }), "aria-hidden": true, children: jsx("span", { className: CheckedCircleRecipe({
17
17
  checked: value,
18
18
  disabled,
19
- validity: validity == null ? void 0 : validity.type
19
+ validity: validity?.type
20
20
  }) }) });
21
21
  };
22
22
  const defaultRender = (radio, description) => jsxs(Fragment, { children: [radio, jsx("div", { className: indentedDescriptionStyle, children: description })] });
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/shared.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAI/E,MAAM,WAAW,qBAAqB,CAAC,MAAM,CACzC,SAAQ,IAAI,CACJ,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,IAAI,CACnE,EACD,gBAAgB,CAAC,MAAM,CAAC,EACxB,QAAQ,CAAC;IAAE,gBAAgB,EAAE,KAAK,CAAA;CAAE,CAAC;IACzC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;CAC3E;AAED,UAAU,sBAAuB,SAAQ,QAAQ,CAAC;IAAE,gBAAgB,EAAE,KAAK,CAAA;CAAE,CAAC;IAC1E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmB9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,yBAGlC;IACC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,4CAMA,CAAC"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/shared.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAI/E,MAAM,WAAW,qBAAqB,CAAC,MAAM,CACzC,SAAQ,IAAI,CACJ,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,IAAI,CACnE,EACD,gBAAgB,CAAC,MAAM,CAAC,EACxB,QAAQ,CAAC;IAAE,gBAAgB,EAAE,KAAK,CAAA;CAAE,CAAC;IACzC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;CAC3E;AAED,UAAU,sBAAuB,SAAQ,QAAQ,CAAC;IAAE,gBAAgB,EAAE,KAAK,CAAA;CAAE,CAAC;IAC1E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmB9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,4BAG9B;IACC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,4CAMA,CAAC"}
@@ -10,11 +10,14 @@ const Icon = require("../../../foundation/iconography/Icon.cjs");
10
10
  const index$1 = require("../../../foundation/typography/index.cjs");
11
11
  const index = require("../../../translations/index.cjs");
12
12
  const classNames = require("classnames");
13
- require("../../actions/buttons/PrimaryButton.cjs");
14
- require("../../actions/buttons/SecondaryButton.cjs");
15
- require("../../actions/buttons/SuccessButton.cjs");
16
- require("../../actions/buttons/DangerButton.cjs");
17
- require("../../actions/buttons/GhostButton.cjs");
13
+ require("react");
14
+ require("../../../foundation/logos/Logo.css.cjs");
15
+ require("@gnist/themes/tokens.css.js");
16
+ require("../../../utilities/accessibility/ScreenReaderOnly.cjs");
17
+ require("../../../utilities/accessibility/visuallyHidden.css.cjs");
18
+ require("../../progress/Spinner.cjs");
19
+ require("../../actions/buttons/styles.css.cjs");
20
+ require("../../../styles/states.css.cjs");
18
21
  const TextButton = require("../../actions/buttons/TextButton.cjs");
19
22
  const IconButton = require("../../actions/buttons/IconButton.cjs");
20
23
  const AlertBanner_css = require("./AlertBanner.css.cjs");
@@ -23,6 +26,6 @@ const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
23
26
  const BannerHeading = componentUtils.component("BannerHeading", AlertBanner_css.bannerHeading, "h2");
24
27
  const AlertBanner = ({ type, heading, message, dismiss, action, density = "default", headingLevel = "h2", className }) => {
25
28
  const text = index.useTranslation((t) => t.components.feedback.alerts);
26
- return jsxRuntime.jsxs("div", { className: classNames__default.default(className, AlertBanner_css.banner({ type, density })), children: [jsxRuntime.jsx(Icon.Icon, { type, icon: type, className: AlertBanner_css.icon({ type }) }), jsxRuntime.jsxs("div", { className: AlertBanner_css.mainContentContainer({ density }), children: [heading && jsxRuntime.jsx(BannerHeading, { "$as": headingLevel, children: heading }), dismiss && jsxRuntime.jsx(IconButton.IconButton, { className: AlertBanner_css.closeButton, icon: "close", label: text.dismissLabel, onClick: dismiss }), typeof message === "string" ? jsxRuntime.jsx(index$1.TextContainer, { className: AlertBanner_css.messageContainer, children: message }) : jsxRuntime.jsx("div", { className: AlertBanner_css.messageContainer, children: message }), action && jsxRuntime.jsx(TextButton.TextButton, { density: "compact", className: AlertBanner_css.actionButton, onClick: action.onClick, underline: true, children: action.label })] })] });
29
+ return jsxRuntime.jsxs("div", { className: classNames__default.default(className, AlertBanner_css.banner({ type, density })), children: [jsxRuntime.jsx(Icon.Icon, { type, icon: type, className: AlertBanner_css.icon({ type }) }), jsxRuntime.jsxs("div", { className: AlertBanner_css.mainContentContainer({ density }), children: [heading && jsxRuntime.jsx(BannerHeading, { "$as": headingLevel, children: heading }), dismiss && jsxRuntime.jsx(IconButton.IconButton, { className: AlertBanner_css.closeButton, icon: "close", label: text.dismissLabel, onClick: dismiss }), typeof message === "string" ? jsxRuntime.jsx(index$1.TextContainer, { className: AlertBanner_css.messageContainer, children: message }) : jsxRuntime.jsx("div", { className: AlertBanner_css.messageContainer, children: message }), action && jsxRuntime.jsx(TextButton.TextButton, { className: AlertBanner_css.actionButton, onClick: action.onClick, underline: true, children: action.label })] })] });
27
30
  };
28
31
  exports.AlertBanner = AlertBanner;
@@ -1 +1 @@
1
- {"version":3,"file":"AlertBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/alerts/AlertBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,YAAY,EAEf,uCAAmD;AAapD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACvB,CAAC;IACF,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAID;;;;;;;GAOG;AAEH,eAAO,MAAM,WAAW,GAAI,gFASzB,gBAAgB,4CAuClB,CAAC"}
1
+ {"version":3,"file":"AlertBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/alerts/AlertBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,YAAY,EAEf,uCAAmD;AAapD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACvB,CAAC;IACF,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAID;;;;;;;GAOG;AAEH,eAAO,MAAM,WAAW,mFASrB,gBAAgB,4CAsClB,CAAC"}
@@ -8,18 +8,21 @@ import { Icon } from "../../../foundation/iconography/Icon.js";
8
8
  import { TextContainer } from "../../../foundation/typography/index.js";
9
9
  import { useTranslation } from "../../../translations/index.js";
10
10
  import classNames from "classnames";
11
- import "../../actions/buttons/PrimaryButton.js";
12
- import "../../actions/buttons/SecondaryButton.js";
13
- import "../../actions/buttons/SuccessButton.js";
14
- import "../../actions/buttons/DangerButton.js";
15
- import "../../actions/buttons/GhostButton.js";
11
+ import "react";
12
+ import "../../../foundation/logos/Logo.css.js";
13
+ import "@gnist/themes/tokens.css.js";
14
+ import "../../../utilities/accessibility/ScreenReaderOnly.js";
15
+ import "../../../utilities/accessibility/visuallyHidden.css.js";
16
+ import "../../progress/Spinner.js";
17
+ import "../../actions/buttons/styles.css.js";
18
+ import "../../../styles/states.css.js";
16
19
  import { TextButton } from "../../actions/buttons/TextButton.js";
17
20
  import { IconButton } from "../../actions/buttons/IconButton.js";
18
21
  import { bannerHeading, icon, mainContentContainer, closeButton, messageContainer, actionButton, banner } from "./AlertBanner.css.js";
19
22
  const BannerHeading = component("BannerHeading", bannerHeading, "h2");
20
23
  const AlertBanner = ({ type, heading, message, dismiss, action, density = "default", headingLevel = "h2", className }) => {
21
24
  const text = useTranslation((t) => t.components.feedback.alerts);
22
- return jsxs("div", { className: classNames(className, banner({ type, density })), children: [jsx(Icon, { type, icon: type, className: icon({ type }) }), jsxs("div", { className: mainContentContainer({ density }), children: [heading && jsx(BannerHeading, { "$as": headingLevel, children: heading }), dismiss && jsx(IconButton, { className: closeButton, icon: "close", label: text.dismissLabel, onClick: dismiss }), typeof message === "string" ? jsx(TextContainer, { className: messageContainer, children: message }) : jsx("div", { className: messageContainer, children: message }), action && jsx(TextButton, { density: "compact", className: actionButton, onClick: action.onClick, underline: true, children: action.label })] })] });
25
+ return jsxs("div", { className: classNames(className, banner({ type, density })), children: [jsx(Icon, { type, icon: type, className: icon({ type }) }), jsxs("div", { className: mainContentContainer({ density }), children: [heading && jsx(BannerHeading, { "$as": headingLevel, children: heading }), dismiss && jsx(IconButton, { className: closeButton, icon: "close", label: text.dismissLabel, onClick: dismiss }), typeof message === "string" ? jsx(TextContainer, { className: messageContainer, children: message }) : jsx("div", { className: messageContainer, children: message }), action && jsx(TextButton, { className: actionButton, onClick: action.onClick, underline: true, children: action.label })] })] });
23
26
  };
24
27
  export {
25
28
  AlertBanner
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingSpinner.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/loaders/LoadingSpinner.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;CACpD;AAID;;;;KAIK;AAEL,eAAO,MAAM,cAAc,GAAI,4CAI5B,mBAAmB,mDAgCrB,CAAC"}
1
+ {"version":3,"file":"LoadingSpinner.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/loaders/LoadingSpinner.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;CACpD;AAID;;;;KAIK;AAEL,eAAO,MAAM,cAAc,+CAIxB,mBAAmB,mDAgCrB,CAAC"}
@@ -19,13 +19,11 @@ require("../../../foundation/logos/Logo.css.cjs");
19
19
  const atoms_css_js = require("@gnist/themes/atoms.css.js");
20
20
  const base = require("@mui/base");
21
21
  const dynamic = require("@vanilla-extract/dynamic");
22
- require("../../actions/buttons/PrimaryButton.cjs");
23
- require("../../actions/buttons/SecondaryButton.cjs");
24
- require("../../actions/buttons/SuccessButton.cjs");
25
- require("../../actions/buttons/DangerButton.cjs");
26
- require("../../actions/buttons/GhostButton.cjs");
27
- require("../../actions/buttons/TextButton.cjs");
28
- require("../../actions/buttons/IconButton.cjs");
22
+ require("../../../utilities/accessibility/ScreenReaderOnly.cjs");
23
+ require("../../../utilities/accessibility/visuallyHidden.css.cjs");
24
+ require("../../progress/Spinner.cjs");
25
+ require("../../actions/buttons/styles.css.cjs");
26
+ require("../../../styles/states.css.cjs");
29
27
  const Checkbox = require("../../actions/selectionControls/Checkbox.cjs");
30
28
  require("../../actions/selectionControls/RadioButton.cjs");
31
29
  require("../../actions/chips/ActionChip.cjs");
@@ -40,14 +38,13 @@ const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
40
38
  const listBoxComponent = base.prepareForSlot(componentUtils.component("listBox", select_css.listBoxStyle, "div"));
41
39
  const popUpComponent = base.prepareForSlot(componentUtils.component("popUp", select_css.popUpStyle, "div"));
42
40
  function SelectBase(props, isMultiple, ref) {
43
- var _a, _b;
44
41
  const { contentProps, wrapperProps, commonInputProps } = shared.useSelectInputLogic(props);
45
42
  const { selectProps } = shared.getSelectInputProps(props);
46
43
  const [isExpanded, setIsExpanded] = React.useState(false);
47
44
  return jsxRuntime.jsxs("span", { ref, className: classNames__default.default(wrapperProps.className, inputField_css.wrapperStyle), children: [jsxRuntime.jsxs("label", { htmlFor: props.id, className: inputField_css.inputFieldWrapperRecipe({
48
45
  disabled: props.disabled,
49
46
  density: props.density,
50
- validityType: (_a = props.validity) == null ? void 0 : _a.type
47
+ validityType: props.validity?.type
51
48
  }), children: [jsxRuntime.jsx(base.Select, { className: select_css.selectStyle, style: {
52
49
  ...dynamic.assignInlineVars({
53
50
  [inputFieldConstants_css.preInputWidth]: wrapperProps.preInputWidth,
@@ -57,17 +54,13 @@ function SelectBase(props, isMultiple, ref) {
57
54
  listbox: listBoxComponent,
58
55
  popup: popUpComponent
59
56
  }, onChange: (e, value) => {
60
- var _a2;
61
- (_a2 = selectProps.onChange) == null ? void 0 : _a2.call(selectProps, value);
62
- }, children: props.options.map((option) => {
63
- var _a2;
64
- return jsxRuntime.jsxs(base.Option, { value: option.value, className: select_css.optionStyle, children: [jsxRuntime.jsx("div", { className: select_css.optionBackground }), isMultiple ? jsxRuntime.jsx(Checkbox.Checkbox, { label: option.label, value: Array.isArray(props.value) && ((_a2 = props.value) == null ? void 0 : _a2.includes(option.value)), readOnly: true, tabIndex: -1 }) : jsxRuntime.jsxs("div", { className: select_css.singleOptionStyle, children: [jsxRuntime.jsx("p", { children: option.label }), typeof props.value === "string" && props.value === option.value && jsxRuntime.jsx(Icon.Icon, { icon: "check" })] })] }, option.value);
65
- }) }), jsxRuntime.jsxs("span", { className: inputField_css.inputContentWrapper({ density: props.density }), children: [props.leadingIcon && jsxRuntime.jsx(Icon.Icon, { icon: props.leadingIcon, className: atoms_css_js.atoms({
57
+ selectProps.onChange?.(value);
58
+ }, children: props.options.map((option) => jsxRuntime.jsxs(base.Option, { value: option.value, className: select_css.optionStyle, children: [jsxRuntime.jsx("div", { className: select_css.optionBackground }), isMultiple ? jsxRuntime.jsx(Checkbox.Checkbox, { label: option.label, value: Array.isArray(props.value) && props.value?.includes(option.value), readOnly: true, tabIndex: -1 }) : jsxRuntime.jsxs("div", { className: select_css.singleOptionStyle, children: [jsxRuntime.jsx("p", { children: option.label }), typeof props.value === "string" && props.value === option.value && jsxRuntime.jsx(Icon.Icon, { icon: "check" })] })] }, option.value)) }), jsxRuntime.jsxs("span", { className: inputField_css.inputContentWrapper({ density: props.density }), children: [props.leadingIcon && jsxRuntime.jsx(Icon.Icon, { icon: props.leadingIcon, className: atoms_css_js.atoms({
66
59
  paddingRight: "xxs",
67
60
  color: props.disabled ? "on-disabled" : "on-surface"
68
61
  }) }), jsxRuntime.jsx("label", { id: contentProps.labelId, className: labelStyles_css.labelStyle({
69
62
  density: props.density,
70
- validityType: (_b = props.validity) == null ? void 0 : _b.type,
63
+ validityType: props.validity?.type,
71
64
  isElevated: !!props.value,
72
65
  disabled: props.disabled
73
66
  }), style: {
@@ -17,13 +17,11 @@ import "../../../foundation/logos/Logo.css.js";
17
17
  import { atoms } from "@gnist/themes/atoms.css.js";
18
18
  import { prepareForSlot, Select, Option } from "@mui/base";
19
19
  import { assignInlineVars } from "@vanilla-extract/dynamic";
20
- import "../../actions/buttons/PrimaryButton.js";
21
- import "../../actions/buttons/SecondaryButton.js";
22
- import "../../actions/buttons/SuccessButton.js";
23
- import "../../actions/buttons/DangerButton.js";
24
- import "../../actions/buttons/GhostButton.js";
25
- import "../../actions/buttons/TextButton.js";
26
- import "../../actions/buttons/IconButton.js";
20
+ import "../../../utilities/accessibility/ScreenReaderOnly.js";
21
+ import "../../../utilities/accessibility/visuallyHidden.css.js";
22
+ import "../../progress/Spinner.js";
23
+ import "../../actions/buttons/styles.css.js";
24
+ import "../../../styles/states.css.js";
27
25
  import { Checkbox } from "../../actions/selectionControls/Checkbox.js";
28
26
  import "../../actions/selectionControls/RadioButton.js";
29
27
  import "../../actions/chips/ActionChip.js";
@@ -36,14 +34,13 @@ import { listBoxStyle, popUpStyle, selectStyle, optionStyle, optionBackground, s
36
34
  const listBoxComponent = prepareForSlot(component("listBox", listBoxStyle, "div"));
37
35
  const popUpComponent = prepareForSlot(component("popUp", popUpStyle, "div"));
38
36
  function SelectBase(props, isMultiple, ref) {
39
- var _a, _b;
40
37
  const { contentProps, wrapperProps, commonInputProps } = useSelectInputLogic(props);
41
38
  const { selectProps } = getSelectInputProps(props);
42
39
  const [isExpanded, setIsExpanded] = useState(false);
43
40
  return jsxs("span", { ref, className: classNames(wrapperProps.className, wrapperStyle), children: [jsxs("label", { htmlFor: props.id, className: inputFieldWrapperRecipe({
44
41
  disabled: props.disabled,
45
42
  density: props.density,
46
- validityType: (_a = props.validity) == null ? void 0 : _a.type
43
+ validityType: props.validity?.type
47
44
  }), children: [jsx(Select, { className: selectStyle, style: {
48
45
  ...assignInlineVars({
49
46
  [preInputWidth]: wrapperProps.preInputWidth,
@@ -53,17 +50,13 @@ function SelectBase(props, isMultiple, ref) {
53
50
  listbox: listBoxComponent,
54
51
  popup: popUpComponent
55
52
  }, onChange: (e, value) => {
56
- var _a2;
57
- (_a2 = selectProps.onChange) == null ? void 0 : _a2.call(selectProps, value);
58
- }, children: props.options.map((option) => {
59
- var _a2;
60
- return jsxs(Option, { value: option.value, className: optionStyle, children: [jsx("div", { className: optionBackground }), isMultiple ? jsx(Checkbox, { label: option.label, value: Array.isArray(props.value) && ((_a2 = props.value) == null ? void 0 : _a2.includes(option.value)), readOnly: true, tabIndex: -1 }) : jsxs("div", { className: singleOptionStyle, children: [jsx("p", { children: option.label }), typeof props.value === "string" && props.value === option.value && jsx(Icon, { icon: "check" })] })] }, option.value);
61
- }) }), jsxs("span", { className: inputContentWrapper({ density: props.density }), children: [props.leadingIcon && jsx(Icon, { icon: props.leadingIcon, className: atoms({
53
+ selectProps.onChange?.(value);
54
+ }, children: props.options.map((option) => jsxs(Option, { value: option.value, className: optionStyle, children: [jsx("div", { className: optionBackground }), isMultiple ? jsx(Checkbox, { label: option.label, value: Array.isArray(props.value) && props.value?.includes(option.value), readOnly: true, tabIndex: -1 }) : jsxs("div", { className: singleOptionStyle, children: [jsx("p", { children: option.label }), typeof props.value === "string" && props.value === option.value && jsx(Icon, { icon: "check" })] })] }, option.value)) }), jsxs("span", { className: inputContentWrapper({ density: props.density }), children: [props.leadingIcon && jsx(Icon, { icon: props.leadingIcon, className: atoms({
62
55
  paddingRight: "xxs",
63
56
  color: props.disabled ? "on-disabled" : "on-surface"
64
57
  }) }), jsx("label", { id: contentProps.labelId, className: labelStyle({
65
58
  density: props.density,
66
- validityType: (_b = props.validity) == null ? void 0 : _b.type,
59
+ validityType: props.validity?.type,
67
60
  isElevated: !!props.value,
68
61
  disabled: props.disabled
69
62
  }), style: {
@@ -22,12 +22,11 @@ const date = require("../../../utilities/time/date.cjs");
22
22
  const dynamic = require("@vanilla-extract/dynamic");
23
23
  const Array = require("fp-ts/Array");
24
24
  const _function = require("fp-ts/function");
25
- require("../../actions/buttons/PrimaryButton.cjs");
26
- require("../../actions/buttons/SecondaryButton.cjs");
27
- require("../../actions/buttons/SuccessButton.cjs");
28
- require("../../actions/buttons/DangerButton.cjs");
29
- require("../../actions/buttons/GhostButton.cjs");
30
- require("../../actions/buttons/TextButton.cjs");
25
+ require("../../../utilities/accessibility/ScreenReaderOnly.cjs");
26
+ require("../../../utilities/accessibility/visuallyHidden.css.cjs");
27
+ require("../../progress/Spinner.cjs");
28
+ require("../../actions/buttons/styles.css.cjs");
29
+ require("../../../styles/states.css.cjs");
31
30
  const IconButton = require("../../actions/buttons/IconButton.cjs");
32
31
  require("../../actions/selectionControls/Checkbox.cjs");
33
32
  require("../../actions/selectionControls/RadioButton.cjs");
@@ -66,8 +65,8 @@ const Week = ({ weekDays, current, setCurrent, selected, setSelected, focused, s
66
65
  isSelected: selected ? date.isSameDate(d, selected) : false,
67
66
  isHoliday: date.isNorwegianHoliday(d),
68
67
  isDisabled: !isDateWithinRange(d),
69
- isUnavailable: (isDateUnavailable == null ? void 0 : isDateUnavailable(d)) || false
70
- }), role: "gridcell", "aria-selected": selected ? date.isSameDate(d, selected) : false, disabled: !isDateWithinRange(d), "aria-disabled": (isDateUnavailable == null ? void 0 : isDateUnavailable(d)) ? true : void 0, tabIndex: date.isSameDate(current, d) ? 0 : -1, ref: date.isSameDate(focused, d) ? focusRef : void 0, onKeyDown: (event) => {
68
+ isUnavailable: isDateUnavailable?.(d) || false
69
+ }), role: "gridcell", "aria-selected": selected ? date.isSameDate(d, selected) : false, disabled: !isDateWithinRange(d), "aria-disabled": isDateUnavailable?.(d) ? true : void 0, tabIndex: date.isSameDate(current, d) ? 0 : -1, ref: date.isSameDate(focused, d) ? focusRef : void 0, onKeyDown: (event) => {
71
70
  switch (event.key) {
72
71
  case "ArrowUp":
73
72
  event.preventDefault();
@@ -135,7 +134,7 @@ const Week = ({ weekDays, current, setCurrent, selected, setSelected, focused, s
135
134
  break;
136
135
  }
137
136
  }, onClick: () => {
138
- if (isDateUnavailable == null ? void 0 : isDateUnavailable(d)) {
137
+ if (isDateUnavailable?.(d)) {
139
138
  return;
140
139
  }
141
140
  moveToDate(d);
@@ -183,13 +182,12 @@ const Calendar = React.forwardRef(function Calendar2({ selected, setSelected, is
183
182
  }, [maxDate, minDate]);
184
183
  const setCurrent = (date2) => {
185
184
  internalSetCurrent(date2);
186
- onNavigate == null ? void 0 : onNavigate(date2);
185
+ onNavigate?.(date2);
187
186
  };
188
187
  const [focused, setFocus] = React.useState(current);
189
188
  const focusRef = React.useRef(null);
190
189
  React.useEffect(() => {
191
- var _a;
192
- (_a = focusRef.current) == null ? void 0 : _a.focus();
190
+ focusRef.current?.focus();
193
191
  }, [focused]);
194
192
  const handleChangeMonth = (count) => {
195
193
  const tmp = date.nextMonth(current, count);