@gnist/design-system 7.3.1 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/actions/chips/StatusIndicator.cjs +48 -0
  3. package/dist/components/actions/chips/StatusIndicator.d.ts +21 -0
  4. package/dist/components/actions/chips/StatusIndicator.d.ts.map +1 -0
  5. package/dist/components/actions/chips/StatusIndicator.js +46 -0
  6. package/dist/components/actions/chips/index.cjs +2 -0
  7. package/dist/components/actions/chips/index.d.ts +3 -0
  8. package/dist/components/actions/chips/index.d.ts.map +1 -1
  9. package/dist/components/actions/chips/index.js +2 -1
  10. package/dist/components/actions/chips/statusIndicator.css.cjs +85 -0
  11. package/dist/components/actions/chips/statusIndicator.css.d.ts +44 -0
  12. package/dist/components/actions/chips/statusIndicator.css.d.ts.map +1 -0
  13. package/dist/components/actions/chips/statusIndicator.css.js +82 -0
  14. package/dist/components/actions/index.cjs +2 -0
  15. package/dist/components/actions/index.js +2 -1
  16. package/dist/components/feedback/feedbackInput/FeedbackInput.cjs +72 -0
  17. package/dist/components/feedback/feedbackInput/FeedbackInput.css.cjs +28 -0
  18. package/dist/components/feedback/feedbackInput/FeedbackInput.css.d.ts +5 -0
  19. package/dist/components/feedback/feedbackInput/FeedbackInput.css.d.ts.map +1 -0
  20. package/dist/components/feedback/feedbackInput/FeedbackInput.css.js +25 -0
  21. package/dist/components/feedback/feedbackInput/FeedbackInput.d.ts +39 -0
  22. package/dist/components/feedback/feedbackInput/FeedbackInput.d.ts.map +1 -0
  23. package/dist/components/feedback/feedbackInput/FeedbackInput.js +70 -0
  24. package/dist/components/feedback/feedbackInput/index.cjs +4 -0
  25. package/dist/components/feedback/feedbackInput/index.d.ts +4 -0
  26. package/dist/components/feedback/feedbackInput/index.d.ts.map +1 -0
  27. package/dist/components/feedback/feedbackInput/index.js +3 -0
  28. package/dist/components/feedback/feedbackInput/internal/RatingScale.cjs +59 -0
  29. package/dist/components/feedback/feedbackInput/internal/RatingScale.css.cjs +64 -0
  30. package/dist/components/feedback/feedbackInput/internal/RatingScale.css.d.ts +7 -0
  31. package/dist/components/feedback/feedbackInput/internal/RatingScale.css.d.ts.map +1 -0
  32. package/dist/components/feedback/feedbackInput/internal/RatingScale.css.js +59 -0
  33. package/dist/components/feedback/feedbackInput/internal/RatingScale.d.ts +9 -0
  34. package/dist/components/feedback/feedbackInput/internal/RatingScale.d.ts.map +1 -0
  35. package/dist/components/feedback/feedbackInput/internal/RatingScale.js +57 -0
  36. package/dist/components/feedback/feedbackInput/package.json +7 -0
  37. package/dist/components/feedback/feedbackInput/types.d.ts +7 -0
  38. package/dist/components/feedback/feedbackInput/types.d.ts.map +1 -0
  39. package/dist/components/feedback/index.cjs +3 -0
  40. package/dist/components/feedback/index.d.ts +1 -0
  41. package/dist/components/feedback/index.d.ts.map +1 -1
  42. package/dist/components/feedback/index.js +3 -1
  43. package/dist/components/index.cjs +5 -1
  44. package/dist/components/index.js +4 -2
  45. package/dist/components/inputs/dropdowns/SelectBase.cjs +2 -2
  46. package/dist/components/inputs/dropdowns/SelectBase.js +2 -2
  47. package/dist/components/inputs/index.cjs +1 -1
  48. package/dist/components/inputs/index.js +1 -1
  49. package/dist/components/inputs/textFields/TextArea.cjs +2 -2
  50. package/dist/components/inputs/textFields/TextArea.js +2 -2
  51. package/dist/components/inputs/textFields/TextField.cjs +2 -2
  52. package/dist/components/inputs/textFields/TextField.js +2 -2
  53. package/dist/index.cjs +5 -1
  54. package/dist/index.js +4 -2
  55. package/dist/utilities/forms/internal/components.cjs +1 -1
  56. package/dist/utilities/forms/internal/components.js +1 -1
  57. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [7.5.0](https://github.com/mollerdigital/design-system-design-system/compare/@gnist/design-system@7.4.0...@gnist/design-system@7.5.0) (2026-08-31)
7
+
8
+ ### Features
9
+
10
+ * add feedback component ([1042a91](https://github.com/mollerdigital/design-system-design-system/commit/1042a9189cd0ee489e8f70e141d4aa127f201c7a))
11
+
12
+ ## [7.4.0](https://github.com/mollerdigital/design-system-design-system/compare/@gnist/design-system@7.3.1...@gnist/design-system@7.4.0) (2026-08-24)
13
+
14
+ ### Features
15
+
16
+ * status indicator component ([54375be](https://github.com/mollerdigital/design-system-design-system/commit/54375be112849c841dab2177a491cf250eee3ddb))
17
+
6
18
  ## [7.3.1](https://github.com/mollerdigital/design-system-design-system/compare/@gnist/design-system@7.3.0...@gnist/design-system@7.3.1) (2026-08-14)
7
19
 
8
20
  ### Bug Fixes
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
3
+ const require_Icon = require("../../../foundation/iconography/Icon.cjs");
4
+ require("../../../foundation/index.cjs");
5
+ const require_statusIndicator_css = require("./statusIndicator.css.cjs");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ let classnames = require("classnames");
8
+ classnames = require_runtime.__toESM(classnames, 1);
9
+ //#region src/components/actions/chips/StatusIndicator.tsx
10
+ var iconFor = (type) => {
11
+ switch (type) {
12
+ case "success": return "success";
13
+ case "warning": return "warning";
14
+ case "error": return "error";
15
+ case "info": return "info";
16
+ case "neutral": return "info";
17
+ default: return "info";
18
+ }
19
+ };
20
+ /**
21
+ * A Status Indicator visually represents the state or condition of an item, process, or system. It provides users with quick, at-a-glance feedback — often using color, iconography, and text — to communicate whether something is active, in progress, completed, warning, or error.
22
+ *
23
+ * Status indicators help users understand system health, task progress, or connectivity without needing to read detailed information.
24
+ *
25
+ * Documentation: [StatusIndicator](https://gnist.moller.no/developers/components/latest/?path=/docs/components-actions-chips-statusindicator--docs)
26
+ */
27
+ var StatusIndicator = ({ type, label, showIcon = true, className, "aria-label": ariaLabel }) => {
28
+ const iconOnly = !label;
29
+ const accessibleLabel = label ? void 0 : ariaLabel ?? type;
30
+ return (0, react_jsx_runtime.jsxs)("span", {
31
+ className: (0, classnames.default)(className, require_statusIndicator_css.statusIndicatorRecipe()),
32
+ "aria-label": accessibleLabel,
33
+ role: iconOnly ? "img" : void 0,
34
+ children: [showIcon ? (0, react_jsx_runtime.jsx)("span", {
35
+ className: require_statusIndicator_css.iconContainerRecipe({ type }),
36
+ children: (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
37
+ icon: iconFor(type),
38
+ size: "m"
39
+ })
40
+ }) : (0, react_jsx_runtime.jsx)("span", {
41
+ className: require_statusIndicator_css.dotRecipe({ type }),
42
+ "aria-hidden": true,
43
+ children: (0, react_jsx_runtime.jsx)("span", { className: require_statusIndicator_css.dotInnerRecipe({ type }) })
44
+ }), label && (0, react_jsx_runtime.jsx)("span", { children: label })]
45
+ });
46
+ };
47
+ //#endregion
48
+ exports.StatusIndicator = StatusIndicator;
@@ -0,0 +1,21 @@
1
+ import { StatusIndicatorType } from "./statusIndicator.css.js";
2
+ export interface StatusIndicatorProps {
3
+ /** Semantic status — drives color and default icon */
4
+ type: StatusIndicatorType;
5
+ /** Optional label. When omitted, renders an icon-only (or dot-only) chip. */
6
+ label?: string;
7
+ /** Show the status icon glyph. When false, renders a filled colored dot instead. Default: true */
8
+ showIcon?: boolean;
9
+ /** Accessible label used when no visible label is provided */
10
+ "aria-label"?: string;
11
+ className?: string;
12
+ }
13
+ /**
14
+ * A Status Indicator visually represents the state or condition of an item, process, or system. It provides users with quick, at-a-glance feedback — often using color, iconography, and text — to communicate whether something is active, in progress, completed, warning, or error.
15
+ *
16
+ * Status indicators help users understand system health, task progress, or connectivity without needing to read detailed information.
17
+ *
18
+ * Documentation: [StatusIndicator](https://gnist.moller.no/developers/components/latest/?path=/docs/components-actions-chips-statusindicator--docs)
19
+ */
20
+ export declare const StatusIndicator: ({ type, label, showIcon, className, "aria-label": ariaLabel, }: StatusIndicatorProps) => import("react/jsx-runtime").JSX.Element;
21
+ //# sourceMappingURL=StatusIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusIndicator.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/chips/StatusIndicator.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKH,mBAAmB,EACtB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,oBAAoB;IACjC,sDAAsD;IACtD,IAAI,EAAE,mBAAmB,CAAC;IAC1B,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kGAAkG;IAClG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAmBD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,mEAMzB,oBAAoB,4CAsBtB,CAAC"}
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { Icon } from "../../../foundation/iconography/Icon.js";
3
+ import "../../../foundation/index.js";
4
+ import { dotInnerRecipe, dotRecipe, iconContainerRecipe, statusIndicatorRecipe } from "./statusIndicator.css.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import classNames from "classnames";
7
+ //#region src/components/actions/chips/StatusIndicator.tsx
8
+ var iconFor = (type) => {
9
+ switch (type) {
10
+ case "success": return "success";
11
+ case "warning": return "warning";
12
+ case "error": return "error";
13
+ case "info": return "info";
14
+ case "neutral": return "info";
15
+ default: return "info";
16
+ }
17
+ };
18
+ /**
19
+ * A Status Indicator visually represents the state or condition of an item, process, or system. It provides users with quick, at-a-glance feedback — often using color, iconography, and text — to communicate whether something is active, in progress, completed, warning, or error.
20
+ *
21
+ * Status indicators help users understand system health, task progress, or connectivity without needing to read detailed information.
22
+ *
23
+ * Documentation: [StatusIndicator](https://gnist.moller.no/developers/components/latest/?path=/docs/components-actions-chips-statusindicator--docs)
24
+ */
25
+ var StatusIndicator = ({ type, label, showIcon = true, className, "aria-label": ariaLabel }) => {
26
+ const iconOnly = !label;
27
+ const accessibleLabel = label ? void 0 : ariaLabel ?? type;
28
+ return jsxs("span", {
29
+ className: classNames(className, statusIndicatorRecipe()),
30
+ "aria-label": accessibleLabel,
31
+ role: iconOnly ? "img" : void 0,
32
+ children: [showIcon ? jsx("span", {
33
+ className: iconContainerRecipe({ type }),
34
+ children: jsx(Icon, {
35
+ icon: iconFor(type),
36
+ size: "m"
37
+ })
38
+ }) : jsx("span", {
39
+ className: dotRecipe({ type }),
40
+ "aria-hidden": true,
41
+ children: jsx("span", { className: dotInnerRecipe({ type }) })
42
+ }), label && jsx("span", { children: label })]
43
+ });
44
+ };
45
+ //#endregion
46
+ export { StatusIndicator };
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_ActionChip = require("./ActionChip.cjs");
4
4
  const require_FilterChip = require("./FilterChip.cjs");
5
+ const require_StatusIndicator = require("./StatusIndicator.cjs");
5
6
  const require_TagChip = require("./TagChip.cjs");
6
7
  exports.ActionChip = require_ActionChip.ActionChip;
7
8
  exports.FilterChip = require_FilterChip.FilterChip;
9
+ exports.StatusIndicator = require_StatusIndicator.StatusIndicator;
8
10
  exports.TagChip = require_TagChip.TagChip;
@@ -1,4 +1,7 @@
1
1
  export { ActionChip } from "./ActionChip.js";
2
2
  export { FilterChip } from "./FilterChip.js";
3
+ export { StatusIndicator } from "./StatusIndicator.js";
4
+ export type { StatusIndicatorProps } from "./StatusIndicator.js";
5
+ export type { StatusIndicatorType } from "./statusIndicator.css.js";
3
6
  export { TagChip } from "./TagChip.js";
4
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/chips/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/chips/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { ActionChip } from "./ActionChip.js";
3
3
  import { FilterChip } from "./FilterChip.js";
4
+ import { StatusIndicator } from "./StatusIndicator.js";
4
5
  import { TagChip } from "./TagChip.js";
5
- export { ActionChip, FilterChip, TagChip };
6
+ export { ActionChip, FilterChip, StatusIndicator, TagChip };
@@ -0,0 +1,85 @@
1
+ "use client";
2
+ let _gnist_themes_atoms_css_js = require("@gnist/themes/atoms.css.js");
3
+ let _gnist_themes_layers_css_js = require("@gnist/themes/layers.css.js");
4
+ let _gnist_themes_tokens_css_js = require("@gnist/themes/tokens.css.js");
5
+ //#region src/components/actions/chips/statusIndicator.css.ts
6
+ var typeColors = (type) => {
7
+ if (type === "neutral") return (0, _gnist_themes_atoms_css_js.atoms)({
8
+ backgroundColor: "background",
9
+ color: "on-background",
10
+ borderColor: "on-background"
11
+ });
12
+ return (0, _gnist_themes_atoms_css_js.atoms)({
13
+ backgroundColor: `${type}-container`,
14
+ color: `on-${type}-container`,
15
+ borderColor: `on-${type}-container`
16
+ });
17
+ };
18
+ var statusIndicatorRecipe = (0, _gnist_themes_layers_css_js.gnistRecipe)({ base: [(0, _gnist_themes_atoms_css_js.atoms)({
19
+ display: "inline-flex",
20
+ alignItems: "center",
21
+ gap: "xxs"
22
+ }), {
23
+ textWrap: "nowrap",
24
+ fontFamily: _gnist_themes_tokens_css_js.tokens.type.medium.body.fontFamily,
25
+ fontWeight: _gnist_themes_tokens_css_js.tokens.type.medium.body.fontWeight,
26
+ lineHeight: _gnist_themes_tokens_css_js.tokens.type.medium.body.lineHeight,
27
+ letterSpacing: _gnist_themes_tokens_css_js.tokens.type.medium.body.letterSpacing,
28
+ fontSize: _gnist_themes_tokens_css_js.tokens.type.medium.body.fontSize
29
+ }] });
30
+ var iconContainerRecipe = (0, _gnist_themes_layers_css_js.gnistRecipe)({
31
+ base: [(0, _gnist_themes_atoms_css_js.atoms)({
32
+ display: "inline-flex",
33
+ alignItems: "center",
34
+ justifyContent: "center",
35
+ borderRadius: "medium",
36
+ borderWidth: "small"
37
+ }), { borderStyle: "solid" }],
38
+ variants: { type: {
39
+ neutral: typeColors("neutral"),
40
+ info: typeColors("info"),
41
+ success: typeColors("success"),
42
+ warning: typeColors("warning"),
43
+ error: typeColors("error")
44
+ } },
45
+ defaultVariants: { type: "neutral" }
46
+ });
47
+ var dotRecipe = (0, _gnist_themes_layers_css_js.gnistRecipe)({
48
+ base: [(0, _gnist_themes_atoms_css_js.atoms)({
49
+ borderRadius: "full",
50
+ display: "inline-flex",
51
+ alignItems: "center",
52
+ justifyContent: "center"
53
+ }), {
54
+ width: _gnist_themes_tokens_css_js.tokens.size.s,
55
+ height: _gnist_themes_tokens_css_js.tokens.size.s
56
+ }],
57
+ variants: { type: {
58
+ neutral: typeColors("neutral"),
59
+ info: typeColors("info"),
60
+ success: typeColors("success"),
61
+ warning: typeColors("warning"),
62
+ error: typeColors("error")
63
+ } }
64
+ });
65
+ var dotInnerRecipe = (0, _gnist_themes_layers_css_js.gnistRecipe)({
66
+ base: [(0, _gnist_themes_atoms_css_js.atoms)({
67
+ borderRadius: "full",
68
+ display: "inline-flex"
69
+ }), {
70
+ width: _gnist_themes_tokens_css_js.tokens.size.xxs,
71
+ height: _gnist_themes_tokens_css_js.tokens.size.xxs
72
+ }],
73
+ variants: { type: {
74
+ neutral: { background: _gnist_themes_tokens_css_js.tokens.palette.neutral["10"] },
75
+ info: { background: _gnist_themes_tokens_css_js.tokens.palette.info["10"] },
76
+ success: { background: _gnist_themes_tokens_css_js.tokens.palette.success["10"] },
77
+ warning: { background: _gnist_themes_tokens_css_js.tokens.palette.warning["10"] },
78
+ error: { background: _gnist_themes_tokens_css_js.tokens.palette.error["10"] }
79
+ } }
80
+ });
81
+ //#endregion
82
+ exports.dotInnerRecipe = dotInnerRecipe;
83
+ exports.dotRecipe = dotRecipe;
84
+ exports.iconContainerRecipe = iconContainerRecipe;
85
+ exports.statusIndicatorRecipe = statusIndicatorRecipe;
@@ -0,0 +1,44 @@
1
+ export type StatusIndicatorType = "neutral" | "info" | "success" | "warning" | "error";
2
+ export declare const statusIndicatorRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
3
+ [x: string]: {
4
+ [x: string]: string | import("@vanilla-extract/css").ComplexStyleRule;
5
+ };
6
+ }>;
7
+ export declare const iconContainerRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
8
+ type: {
9
+ neutral: string;
10
+ info: string;
11
+ success: string;
12
+ warning: string;
13
+ error: string;
14
+ };
15
+ }>;
16
+ export declare const dotRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
17
+ type: {
18
+ neutral: string;
19
+ info: string;
20
+ success: string;
21
+ warning: string;
22
+ error: string;
23
+ };
24
+ }>;
25
+ export declare const dotInnerRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
26
+ type: {
27
+ neutral: {
28
+ background: `var(--${string})`;
29
+ };
30
+ info: {
31
+ background: `var(--${string})`;
32
+ };
33
+ success: {
34
+ background: `var(--${string})`;
35
+ };
36
+ warning: {
37
+ background: `var(--${string})`;
38
+ };
39
+ error: {
40
+ background: `var(--${string})`;
41
+ };
42
+ };
43
+ }>;
44
+ //# sourceMappingURL=statusIndicator.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusIndicator.css.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/chips/statusIndicator.css.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GACzB,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO,CAAC;AAiBd,eAAO,MAAM,qBAAqB;;;;EAgBhC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;EAuB9B,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;EAsBpB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;EAiBzB,CAAC"}
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ import { atoms } from "@gnist/themes/atoms.css.js";
3
+ import { gnistRecipe } from "@gnist/themes/layers.css.js";
4
+ import { tokens } from "@gnist/themes/tokens.css.js";
5
+ //#region src/components/actions/chips/statusIndicator.css.ts
6
+ var typeColors = (type) => {
7
+ if (type === "neutral") return atoms({
8
+ backgroundColor: "background",
9
+ color: "on-background",
10
+ borderColor: "on-background"
11
+ });
12
+ return atoms({
13
+ backgroundColor: `${type}-container`,
14
+ color: `on-${type}-container`,
15
+ borderColor: `on-${type}-container`
16
+ });
17
+ };
18
+ var statusIndicatorRecipe = gnistRecipe({ base: [atoms({
19
+ display: "inline-flex",
20
+ alignItems: "center",
21
+ gap: "xxs"
22
+ }), {
23
+ textWrap: "nowrap",
24
+ fontFamily: tokens.type.medium.body.fontFamily,
25
+ fontWeight: tokens.type.medium.body.fontWeight,
26
+ lineHeight: tokens.type.medium.body.lineHeight,
27
+ letterSpacing: tokens.type.medium.body.letterSpacing,
28
+ fontSize: tokens.type.medium.body.fontSize
29
+ }] });
30
+ var iconContainerRecipe = gnistRecipe({
31
+ base: [atoms({
32
+ display: "inline-flex",
33
+ alignItems: "center",
34
+ justifyContent: "center",
35
+ borderRadius: "medium",
36
+ borderWidth: "small"
37
+ }), { borderStyle: "solid" }],
38
+ variants: { type: {
39
+ neutral: typeColors("neutral"),
40
+ info: typeColors("info"),
41
+ success: typeColors("success"),
42
+ warning: typeColors("warning"),
43
+ error: typeColors("error")
44
+ } },
45
+ defaultVariants: { type: "neutral" }
46
+ });
47
+ var dotRecipe = gnistRecipe({
48
+ base: [atoms({
49
+ borderRadius: "full",
50
+ display: "inline-flex",
51
+ alignItems: "center",
52
+ justifyContent: "center"
53
+ }), {
54
+ width: tokens.size.s,
55
+ height: tokens.size.s
56
+ }],
57
+ variants: { type: {
58
+ neutral: typeColors("neutral"),
59
+ info: typeColors("info"),
60
+ success: typeColors("success"),
61
+ warning: typeColors("warning"),
62
+ error: typeColors("error")
63
+ } }
64
+ });
65
+ var dotInnerRecipe = gnistRecipe({
66
+ base: [atoms({
67
+ borderRadius: "full",
68
+ display: "inline-flex"
69
+ }), {
70
+ width: tokens.size.xxs,
71
+ height: tokens.size.xxs
72
+ }],
73
+ variants: { type: {
74
+ neutral: { background: tokens.palette.neutral["10"] },
75
+ info: { background: tokens.palette.info["10"] },
76
+ success: { background: tokens.palette.success["10"] },
77
+ warning: { background: tokens.palette.warning["10"] },
78
+ error: { background: tokens.palette.error["10"] }
79
+ } }
80
+ });
81
+ //#endregion
82
+ export { dotInnerRecipe, dotRecipe, iconContainerRecipe, statusIndicatorRecipe };
@@ -15,6 +15,7 @@ const require_Switch = require("./selectionControls/Switch.cjs");
15
15
  require("./selectionControls/index.cjs");
16
16
  const require_ActionChip = require("./chips/ActionChip.cjs");
17
17
  const require_FilterChip = require("./chips/FilterChip.cjs");
18
+ const require_StatusIndicator = require("./chips/StatusIndicator.cjs");
18
19
  const require_TagChip = require("./chips/TagChip.cjs");
19
20
  require("./chips/index.cjs");
20
21
  exports.ActionChip = require_ActionChip.ActionChip;
@@ -27,6 +28,7 @@ exports.PrimaryButton = require_PrimaryButton.PrimaryButton;
27
28
  exports.RadioButton = require_RadioButton.RadioButton;
28
29
  exports.RadioGroup = require_RadioGroup.RadioGroup;
29
30
  exports.SecondaryButton = require_SecondaryButton.SecondaryButton;
31
+ exports.StatusIndicator = require_StatusIndicator.StatusIndicator;
30
32
  exports.SuccessButton = require_SuccessButton.SuccessButton;
31
33
  exports.Switch = require_Switch.Switch;
32
34
  exports.TagChip = require_TagChip.TagChip;
@@ -14,6 +14,7 @@ import { Switch } from "./selectionControls/Switch.js";
14
14
  import "./selectionControls/index.js";
15
15
  import { ActionChip } from "./chips/ActionChip.js";
16
16
  import { FilterChip } from "./chips/FilterChip.js";
17
+ import { StatusIndicator } from "./chips/StatusIndicator.js";
17
18
  import { TagChip } from "./chips/TagChip.js";
18
19
  import "./chips/index.js";
19
- export { ActionChip, Checkbox, DangerButton, FilterChip, GhostButton, IconButton, PrimaryButton, RadioButton, RadioGroup, SecondaryButton, SuccessButton, Switch, TagChip, TextButton };
20
+ export { ActionChip, Checkbox, DangerButton, FilterChip, GhostButton, IconButton, PrimaryButton, RadioButton, RadioGroup, SecondaryButton, StatusIndicator, SuccessButton, Switch, TagChip, TextButton };
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
3
+ const require_index = require("../../../foundation/typography/index.cjs");
4
+ const require_visuallyHidden_css = require("../../../utilities/accessibility/visuallyHidden.css.cjs");
5
+ require("../../../utilities/accessibility/index.cjs");
6
+ const require_PrimaryButton = require("../../actions/buttons/PrimaryButton.cjs");
7
+ const require_TextArea = require("../../inputs/textFields/TextArea.cjs");
8
+ const require_FeedbackInput_css = require("./FeedbackInput.css.cjs");
9
+ const require_RatingScale = require("./internal/RatingScale.cjs");
10
+ let react_jsx_runtime = require("react/jsx-runtime");
11
+ let react = require("react");
12
+ let classnames = require("classnames");
13
+ classnames = require_runtime.__toESM(classnames, 1);
14
+ //#region src/components/feedback/feedbackInput/FeedbackInput.tsx
15
+ /**
16
+ * FeedbackInput renders a controlled score prompt with optional free-text feedback and a submit action.
17
+ *
18
+ * Documentation: [FeedbackInput](https://gnist.moller.no/developers/components/latest/?path=/docs/components-feedback-feedbackinput--docs)
19
+ */
20
+ function FeedbackInput({ questionLabel, selectedScore, onSelectScore, getScoreButtonLabel, feedbackDescriptionLabel, feedbackLabel, feedbackHelperTextLabel, feedbackValue, onFeedbackChange, maxLength, getCharacterCountLabel, getMaxLengthDescription, getMaxLengthExceededMessage, submitLabel, loadingLabel, onSubmit, submitButtonDisabled = false, status, afterSubmitLabel, className }) {
21
+ const textAreaId = (0, react.useId)();
22
+ const hasMaxLength = maxLength !== void 0;
23
+ const isMaxLengthExceeded = hasMaxLength && feedbackValue.length > maxLength;
24
+ return (0, react_jsx_runtime.jsxs)("div", {
25
+ className: (0, classnames.default)(className, require_FeedbackInput_css.feedbackInputRoot),
26
+ children: [(0, react_jsx_runtime.jsx)("div", {
27
+ role: "status",
28
+ "aria-live": "polite",
29
+ "aria-atomic": "true",
30
+ className: (0, classnames.default)(status !== "done" && require_visuallyHidden_css.visuallyHidden),
31
+ children: (0, react_jsx_runtime.jsx)(require_index.BodyText, { children: status === "done" ? afterSubmitLabel : null })
32
+ }), status !== "done" && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(require_RatingScale.RatingScale, {
33
+ label: questionLabel,
34
+ selectedScore,
35
+ onSelectScore,
36
+ getScoreButtonLabel
37
+ }), selectedScore !== null && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(require_index.BodyText, {
38
+ "$as": "p",
39
+ className: (0, classnames.default)(require_FeedbackInput_css.feedbackDescription),
40
+ children: feedbackDescriptionLabel
41
+ }), (0, react_jsx_runtime.jsxs)("div", {
42
+ className: require_FeedbackInput_css.feedbackInputFeedback,
43
+ children: [(0, react_jsx_runtime.jsx)(require_TextArea.TextArea, {
44
+ id: textAreaId,
45
+ label: feedbackLabel,
46
+ value: feedbackValue,
47
+ onChange: (event) => onFeedbackChange(event.target.value),
48
+ helperText: hasMaxLength ? `${feedbackHelperTextLabel} ${getMaxLengthDescription(maxLength)}` : feedbackHelperTextLabel,
49
+ counterText: hasMaxLength ? getCharacterCountLabel(feedbackValue.length, maxLength) : void 0,
50
+ validity: isMaxLengthExceeded ? {
51
+ type: "error",
52
+ message: getMaxLengthExceededMessage(maxLength)
53
+ } : { type: "none" }
54
+ }), (0, react_jsx_runtime.jsx)(require_PrimaryButton.PrimaryButton, {
55
+ className: (0, classnames.default)(require_FeedbackInput_css.submitButton),
56
+ type: "button",
57
+ disabled: submitButtonDisabled || isMaxLengthExceeded,
58
+ onClick: () => onSubmit({
59
+ score: selectedScore,
60
+ feedback: feedbackValue
61
+ }),
62
+ loading: {
63
+ isLoading: status === "pending",
64
+ loadingText: loadingLabel
65
+ },
66
+ children: submitLabel
67
+ })]
68
+ })] })] })]
69
+ });
70
+ }
71
+ //#endregion
72
+ exports.FeedbackInput = FeedbackInput;
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ let _gnist_themes_atoms_css_js = require("@gnist/themes/atoms.css.js");
3
+ let _gnist_themes_layers_css_js = require("@gnist/themes/layers.css.js");
4
+ let _gnist_themes_tokens_css_js = require("@gnist/themes/tokens.css.js");
5
+ //#region src/components/feedback/feedbackInput/FeedbackInput.css.ts
6
+ var feedbackInputRoot = (0, _gnist_themes_layers_css_js.gnistStyle)({
7
+ display: "flex",
8
+ width: "fit-content",
9
+ flexDirection: "column",
10
+ gap: _gnist_themes_tokens_css_js.tokens.spacing.base,
11
+ marginBlock: _gnist_themes_tokens_css_js.tokens.spacing.base,
12
+ marginInline: "auto"
13
+ });
14
+ var feedbackDescription = (0, _gnist_themes_layers_css_js.gnistStyle)([(0, _gnist_themes_atoms_css_js.atoms)({ margin: "none" }), {
15
+ marginTop: _gnist_themes_tokens_css_js.tokens.spacing.xl,
16
+ marginBottom: _gnist_themes_tokens_css_js.tokens.spacing.xxs
17
+ }]);
18
+ var feedbackInputFeedback = (0, _gnist_themes_layers_css_js.gnistStyle)({
19
+ display: "flex",
20
+ flexDirection: "column",
21
+ gap: _gnist_themes_tokens_css_js.tokens.spacing.s
22
+ });
23
+ var submitButton = (0, _gnist_themes_layers_css_js.gnistStyle)({ marginLeft: "auto" });
24
+ //#endregion
25
+ exports.feedbackDescription = feedbackDescription;
26
+ exports.feedbackInputFeedback = feedbackInputFeedback;
27
+ exports.feedbackInputRoot = feedbackInputRoot;
28
+ exports.submitButton = submitButton;
@@ -0,0 +1,5 @@
1
+ export declare const feedbackInputRoot: string;
2
+ export declare const feedbackDescription: string;
3
+ export declare const feedbackInputFeedback: string;
4
+ export declare const submitButton: string;
5
+ //# sourceMappingURL=FeedbackInput.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedbackInput.css.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/feedbackInput/FeedbackInput.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,QAU5B,CAAC;AAEH,eAAO,MAAM,mBAAmB,QAM9B,CAAC;AAEH,eAAO,MAAM,qBAAqB,QAIhC,CAAC;AAEH,eAAO,MAAM,YAAY,QAEvB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { atoms } from "@gnist/themes/atoms.css.js";
3
+ import { gnistStyle } from "@gnist/themes/layers.css.js";
4
+ import { tokens } from "@gnist/themes/tokens.css.js";
5
+ //#region src/components/feedback/feedbackInput/FeedbackInput.css.ts
6
+ var feedbackInputRoot = gnistStyle({
7
+ display: "flex",
8
+ width: "fit-content",
9
+ flexDirection: "column",
10
+ gap: tokens.spacing.base,
11
+ marginBlock: tokens.spacing.base,
12
+ marginInline: "auto"
13
+ });
14
+ var feedbackDescription = gnistStyle([atoms({ margin: "none" }), {
15
+ marginTop: tokens.spacing.xl,
16
+ marginBottom: tokens.spacing.xxs
17
+ }]);
18
+ var feedbackInputFeedback = gnistStyle({
19
+ display: "flex",
20
+ flexDirection: "column",
21
+ gap: tokens.spacing.s
22
+ });
23
+ var submitButton = gnistStyle({ marginLeft: "auto" });
24
+ //#endregion
25
+ export { feedbackDescription, feedbackInputFeedback, feedbackInputRoot, submitButton };
@@ -0,0 +1,39 @@
1
+ import type { FeedbackInputStatus, FeedbackScore, FeedbackSubmission } from "./types.js";
2
+ interface FeedbackInputBaseProps {
3
+ questionLabel: string;
4
+ selectedScore: FeedbackScore | null;
5
+ onSelectScore: (score: FeedbackScore) => void;
6
+ getScoreButtonLabel: (score: FeedbackScore) => string;
7
+ feedbackDescriptionLabel: string;
8
+ feedbackLabel: string;
9
+ feedbackHelperTextLabel: string;
10
+ feedbackValue: string;
11
+ onFeedbackChange: (feedback: string) => void;
12
+ submitLabel: string;
13
+ loadingLabel: string;
14
+ onSubmit: (submission: FeedbackSubmission) => void;
15
+ submitButtonDisabled?: boolean;
16
+ status: FeedbackInputStatus;
17
+ afterSubmitLabel: string;
18
+ className?: string;
19
+ }
20
+ type FeedbackLengthProps = {
21
+ maxLength: number;
22
+ getCharacterCountLabel: (characterCount: number, maxLength: number) => string;
23
+ getMaxLengthDescription: (maxLength: number) => string;
24
+ getMaxLengthExceededMessage: (maxLength: number) => string;
25
+ } | {
26
+ maxLength?: undefined;
27
+ getCharacterCountLabel?: never;
28
+ getMaxLengthDescription?: never;
29
+ getMaxLengthExceededMessage?: never;
30
+ };
31
+ export type FeedbackInputProps = FeedbackInputBaseProps & FeedbackLengthProps;
32
+ /**
33
+ * FeedbackInput renders a controlled score prompt with optional free-text feedback and a submit action.
34
+ *
35
+ * Documentation: [FeedbackInput](https://gnist.moller.no/developers/components/latest/?path=/docs/components-feedback-feedbackinput--docs)
36
+ */
37
+ export declare function FeedbackInput({ questionLabel, selectedScore, onSelectScore, getScoreButtonLabel, feedbackDescriptionLabel, feedbackLabel, feedbackHelperTextLabel, feedbackValue, onFeedbackChange, maxLength, getCharacterCountLabel, getMaxLengthDescription, getMaxLengthExceededMessage, submitLabel, loadingLabel, onSubmit, submitButtonDisabled, status, afterSubmitLabel, className, }: FeedbackInputProps): import("react/jsx-runtime").JSX.Element;
38
+ export {};
39
+ //# sourceMappingURL=FeedbackInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedbackInput.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/feedbackInput/FeedbackInput.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACR,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EACrB,MAAM,YAAY,CAAC;AAEpB,UAAU,sBAAsB;IAE5B,aAAa,EAAE,MAAM,CAAC;IAEtB,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,aAAa,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,mBAAmB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC;IAEtD,wBAAwB,EAAE,MAAM,CAAC;IAEjC,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,EAAE,MAAM,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,UAAU,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACnD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,KAAK,mBAAmB,GAClB;IACI,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,CACpB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,KAChB,MAAM,CAAC;IACZ,uBAAuB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACvD,2BAA2B,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC9D,GACD;IACI,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,sBAAsB,CAAC,EAAE,KAAK,CAAC;IAC/B,uBAAuB,CAAC,EAAE,KAAK,CAAC;IAChC,2BAA2B,CAAC,EAAE,KAAK,CAAC;CACvC,CAAC;AAER,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,mBAAmB,CAAC;AAE9E;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC1B,aAAa,EACb,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,aAAa,EACb,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,oBAA4B,EAC5B,MAAM,EACN,gBAAgB,EAChB,SAAS,GACZ,EAAE,kBAAkB,2CAkGpB"}