@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.
- package/CHANGELOG.md +8 -0
- package/README.md +105 -6
- package/dist/building-blocks/inputs/InputHelperText.cjs +1 -1
- package/dist/building-blocks/inputs/InputHelperText.js +1 -1
- package/dist/building-blocks/skeletons/CircularSkeleton.cjs +1 -2
- package/dist/building-blocks/skeletons/CircularSkeleton.d.ts.map +1 -1
- package/dist/building-blocks/skeletons/CircularSkeleton.js +1 -2
- package/dist/building-blocks/skeletons/RectangularSkeleton.d.ts.map +1 -1
- package/dist/building-blocks/skeletons/TextSkeleton.d.ts.map +1 -1
- package/dist/components/actions/buttons/ButtonBase.cjs +4 -4
- package/dist/components/actions/buttons/ButtonBase.d.ts +2 -1
- package/dist/components/actions/buttons/ButtonBase.d.ts.map +1 -1
- package/dist/components/actions/buttons/ButtonBase.js +4 -4
- package/dist/components/actions/buttons/DangerButton.cjs +3 -4
- package/dist/components/actions/buttons/DangerButton.d.ts +1 -1
- package/dist/components/actions/buttons/DangerButton.d.ts.map +1 -1
- package/dist/components/actions/buttons/DangerButton.js +3 -4
- package/dist/components/actions/buttons/GhostButton.cjs +3 -4
- package/dist/components/actions/buttons/GhostButton.d.ts +1 -1
- package/dist/components/actions/buttons/GhostButton.d.ts.map +1 -1
- package/dist/components/actions/buttons/GhostButton.js +3 -4
- package/dist/components/actions/buttons/IconButton.cjs +11 -15
- package/dist/components/actions/buttons/IconButton.d.ts +3 -2
- package/dist/components/actions/buttons/IconButton.d.ts.map +1 -1
- package/dist/components/actions/buttons/IconButton.js +12 -16
- package/dist/components/actions/buttons/PrimaryButton.cjs +3 -4
- package/dist/components/actions/buttons/PrimaryButton.d.ts +1 -1
- package/dist/components/actions/buttons/PrimaryButton.d.ts.map +1 -1
- package/dist/components/actions/buttons/PrimaryButton.js +3 -4
- package/dist/components/actions/buttons/SecondaryButton.cjs +3 -4
- package/dist/components/actions/buttons/SecondaryButton.d.ts +1 -1
- package/dist/components/actions/buttons/SecondaryButton.d.ts.map +1 -1
- package/dist/components/actions/buttons/SecondaryButton.js +3 -4
- package/dist/components/actions/buttons/SuccessButton.cjs +3 -4
- package/dist/components/actions/buttons/SuccessButton.d.ts +1 -1
- package/dist/components/actions/buttons/SuccessButton.d.ts.map +1 -1
- package/dist/components/actions/buttons/SuccessButton.js +3 -4
- package/dist/components/actions/buttons/TextButton.cjs +2 -3
- package/dist/components/actions/buttons/TextButton.d.ts +3 -2
- package/dist/components/actions/buttons/TextButton.d.ts.map +1 -1
- package/dist/components/actions/buttons/TextButton.js +3 -4
- package/dist/components/actions/buttons/createButtonVariant.cjs +18 -21
- package/dist/components/actions/buttons/createButtonVariant.d.ts.map +1 -1
- package/dist/components/actions/buttons/createButtonVariant.js +18 -21
- package/dist/components/actions/chips/ActionChip.cjs +2 -2
- package/dist/components/actions/chips/ActionChip.js +2 -2
- package/dist/components/actions/chips/FilterChip.cjs +2 -2
- package/dist/components/actions/chips/FilterChip.js +2 -2
- package/dist/components/actions/selectionControls/Checkbox.cjs +1 -1
- package/dist/components/actions/selectionControls/Checkbox.js +1 -1
- package/dist/components/actions/selectionControls/RadioButton.cjs +2 -2
- package/dist/components/actions/selectionControls/RadioButton.js +2 -2
- package/dist/components/actions/selectionControls/shared.d.ts.map +1 -1
- package/dist/components/feedback/alerts/AlertBanner.cjs +9 -6
- package/dist/components/feedback/alerts/AlertBanner.d.ts.map +1 -1
- package/dist/components/feedback/alerts/AlertBanner.js +9 -6
- package/dist/components/feedback/loaders/LoadingSpinner.d.ts.map +1 -1
- package/dist/components/inputs/dropdowns/SelectBase.cjs +9 -16
- package/dist/components/inputs/dropdowns/SelectBase.js +9 -16
- package/dist/components/inputs/pickers/calendar.cjs +10 -12
- package/dist/components/inputs/pickers/calendar.js +10 -12
- package/dist/components/inputs/shared.cjs +1 -4
- package/dist/components/inputs/shared.js +1 -4
- package/dist/components/inputs/textFields/TextArea.cjs +4 -6
- package/dist/components/inputs/textFields/TextArea.d.ts.map +1 -1
- package/dist/components/inputs/textFields/TextArea.js +4 -6
- package/dist/components/inputs/textFields/TextField.cjs +6 -9
- package/dist/components/inputs/textFields/TextField.js +6 -9
- package/dist/components/surfaces/cards/internal/SelectionCard.d.ts.map +1 -1
- package/dist/components/surfaces/modal/Modal.cjs +19 -15
- package/dist/components/surfaces/modal/Modal.js +19 -15
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/utilities/forms/formContext.cjs +2 -2
- package/dist/utilities/forms/formContext.js +2 -2
- package/dist/utilities/forms/formHelpers.cjs +12 -16
- package/dist/utilities/forms/formHelpers.d.ts.map +1 -1
- package/dist/utilities/forms/formHelpers.js +12 -16
- package/dist/utilities/forms/internal/components.cjs +2 -4
- package/dist/utilities/forms/internal/components.js +2 -4
- package/dist/utilities/forms/useFormProps.cjs +2 -4
- package/dist/utilities/forms/useFormProps.js +2 -4
- package/dist/utilities/html/index.d.ts.map +1 -1
- package/dist/utilities/time/date.d.ts.map +1 -1
- package/dist/utilities/tokens/tokens.cjs +1 -2
- package/dist/utilities/tokens/tokens.d.ts.map +1 -1
- package/dist/utilities/tokens/tokens.js +1 -2
- package/dist/utilities/validation/validation.cjs +1 -1
- package/dist/utilities/validation/validation.d.ts.map +1 -1
- package/dist/utilities/validation/validation.js +1 -1
- package/dist/utilities/validation/validationSteps.d.ts.map +1 -1
- package/dist/utilities/validation/validators.d.ts.map +1 -1
- 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
|
|
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,
|
|
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
|
-
|
|
7
|
-
return jsx(BoxedButtonBase, {
|
|
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
|
-
|
|
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
|
|
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,
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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,
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
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
|
|
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) && !
|
|
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
|
|
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) && !
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
15
|
+
validity: validity?.type
|
|
16
16
|
}), "aria-hidden": true, children: jsx("span", { className: CheckedCircleRecipe({
|
|
17
17
|
checked: value,
|
|
18
18
|
disabled,
|
|
19
|
-
validity: validity
|
|
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,
|
|
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("
|
|
14
|
-
require("
|
|
15
|
-
require("
|
|
16
|
-
require("
|
|
17
|
-
require("
|
|
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, {
|
|
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,
|
|
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 "
|
|
12
|
-
import "
|
|
13
|
-
import "
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
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, {
|
|
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,
|
|
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("
|
|
23
|
-
require("
|
|
24
|
-
require("../../
|
|
25
|
-
require("../../actions/buttons/
|
|
26
|
-
require("
|
|
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:
|
|
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
|
-
|
|
61
|
-
|
|
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:
|
|
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 "
|
|
21
|
-
import "
|
|
22
|
-
import "../../
|
|
23
|
-
import "../../actions/buttons/
|
|
24
|
-
import "
|
|
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:
|
|
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
|
-
|
|
57
|
-
|
|
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:
|
|
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("
|
|
26
|
-
require("
|
|
27
|
-
require("../../
|
|
28
|
-
require("../../actions/buttons/
|
|
29
|
-
require("
|
|
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:
|
|
70
|
-
}), role: "gridcell", "aria-selected": selected ? date.isSameDate(d, selected) : false, disabled: !isDateWithinRange(d), "aria-disabled":
|
|
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
|
|
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
|
|
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
|
-
|
|
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);
|