@altinn/altinn-components 0.18.0 → 0.18.1

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.
@@ -1 +1 @@
1
- ._label_cv7w3_1{padding-left:6px}._input_cv7w3_5{position:absolute;opacity:0}._icon_cv7w3_10{flex-shrink:0;font-size:1rem;display:flex;align-items:center;justify-content:center}._icon_cv7w3_10{color:var(--ds-color-base-default)}._icon_cv7w3_10 [data-hover=true]{opacity:0}._label_cv7w3_1:hover [data-hover=true]{opacity:1}
1
+ ._base_igy0i_1{padding-left:6px}._base_igy0i_1:hover [data-hover=true]{opacity:1}._label_igy0i_9{display:block;white-space:nowrap;text-overflow:ellipsis;width:max-content;overflow:hidden;max-width:240px}._input_igy0i_18{position:absolute;opacity:0}._icon_igy0i_23{flex-shrink:0;font-size:1rem;display:flex;align-items:center;justify-content:center}._icon_igy0i_23{color:var(--ds-color-base-default)}._icon_igy0i_23 [data-hover=true]{opacity:0}
@@ -1,18 +1,18 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
- import { c as s } from "../../index-L8X2o7IH.js";
3
- import '../../assets/DrawerBase.css';const o = "_drawer_vej3t_1", n = {
4
- drawer: o
5
- }, m = ({ placement: a = "inline", open: e = !1, className: r, children: t }) => /* @__PURE__ */ d(
2
+ import { c as o } from "../../index-L8X2o7IH.js";
3
+ import '../../assets/DrawerBase.css';const s = "_drawer_vej3t_1", c = {
4
+ drawer: s
5
+ }, l = ({ placement: a = "inline", open: e = !1, className: r, children: t }) => /* @__PURE__ */ d(
6
6
  "div",
7
7
  {
8
- className: s(n.drawer, r),
8
+ className: o(c.drawer, r),
9
9
  "data-placement": a,
10
10
  "data-theme": "default",
11
- "data-color": "neutral",
11
+ "data-color": "company",
12
12
  "data-expanded": e,
13
13
  children: t
14
14
  }
15
15
  );
16
16
  export {
17
- m as DrawerBase
17
+ l as DrawerBase
18
18
  };
@@ -9,8 +9,8 @@ import '../../assets/DropdownBase.css';const l = "_dropdown_1hh2v_1", u = "_draw
9
9
  }, x = ({
10
10
  placement: t = "left",
11
11
  padding: d = !0,
12
- open: r = !1,
13
- className: a,
12
+ open: a = !1,
13
+ className: r,
14
14
  children: e,
15
15
  onClose: n
16
16
  }) => {
@@ -19,14 +19,14 @@ import '../../assets/DropdownBase.css';const l = "_dropdown_1hh2v_1", u = "_draw
19
19
  "div",
20
20
  {
21
21
  ref: o,
22
- className: m(w.dropdown, a),
22
+ className: m(w.dropdown, r),
23
23
  "data-theme": "default",
24
- "data-color": "neutral",
24
+ "data-color": "company",
25
25
  "data-shadow": "md",
26
26
  "data-placement": t,
27
27
  "data-padding": d,
28
28
  role: "menu",
29
- "data-expanded": r,
29
+ "data-expanded": a,
30
30
  children: e
31
31
  }
32
32
  );
@@ -1,12 +1,13 @@
1
- import { jsx as t, jsxs as c, Fragment as r } from "react/jsx-runtime";
2
- import '../../assets/MenuItemLabel.css';const o = "_label_1ejxp_1", p = "_title_1ejxp_7", d = "_description_1ejxp_25", s = {
3
- label: o,
4
- title: p,
5
- description: d
6
- }, m = ({ size: e = "sm", label: l, title: n, description: i, children: a }) => /* @__PURE__ */ t("span", { className: s.label, "data-size": e, children: a || /* @__PURE__ */ c(r, { children: [
7
- /* @__PURE__ */ t("strong", { className: s.title, "data-size": e, children: n || l }),
8
- /* @__PURE__ */ t("span", { className: s.description, "data-size": e, children: i })
1
+ import { jsx as t, jsxs as r, Fragment as o } from "react/jsx-runtime";
2
+ import { c as p } from "../../index-L8X2o7IH.js";
3
+ import '../../assets/MenuItemLabel.css';const d = "_label_1ejxp_1", m = "_title_1ejxp_7", _ = "_description_1ejxp_25", s = {
4
+ label: d,
5
+ title: m,
6
+ description: _
7
+ }, j = ({ className: l, size: e = "sm", label: i, title: n, description: c, children: a }) => /* @__PURE__ */ t("span", { className: p(s.label, l), "data-size": e, children: a || /* @__PURE__ */ r(o, { children: [
8
+ /* @__PURE__ */ t("strong", { className: s.title, "data-size": e, children: n || i }),
9
+ /* @__PURE__ */ t("span", { className: s.description, "data-size": e, children: c })
9
10
  ] }) });
10
11
  export {
11
- m as MenuItemLabel
12
+ j as MenuItemLabel
12
13
  };
@@ -1,45 +1,46 @@
1
- import { jsxs as b, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
4
  import "../RootProvider/RootProvider.js";
5
5
  import { MenuItemBase as f } from "./MenuItemBase.js";
6
- import { MenuItemLabel as v } from "./MenuItemLabel.js";
6
+ import { MenuItemLabel as x } from "./MenuItemLabel.js";
7
7
  import "../Search/AutocompleteBase.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import { CheckboxIcon as x } from "../Icon/CheckboxIcon.js";
10
- import { RadioIcon as I } from "../Icon/RadioIcon.js";
11
- import '../../assets/MenuOption.css';const N = "_label_cv7w3_1", d = "_input_cv7w3_5", h = "_icon_cv7w3_10", r = {
12
- label: N,
13
- input: d,
14
- icon: h
9
+ import { CheckboxIcon as N } from "../Icon/CheckboxIcon.js";
10
+ import { RadioIcon as g } from "../Icon/RadioIcon.js";
11
+ import '../../assets/MenuOption.css';const I = "_base_igy0i_1", d = "_label_igy0i_9", h = "_input_igy0i_18", y = "_icon_igy0i_23", o = {
12
+ base: I,
13
+ label: d,
14
+ input: h,
15
+ icon: y
15
16
  }, A = ({
16
- size: n = "md",
17
- type: i,
18
- name: e,
19
- value: m,
20
- label: s,
21
- title: l,
22
- description: a,
17
+ size: e = "md",
18
+ type: t,
19
+ name: a,
20
+ value: n,
21
+ label: r,
22
+ title: m,
23
+ description: l,
23
24
  badge: c,
24
- checked: o = !1,
25
+ checked: i = !1,
25
26
  disabled: p,
26
- onChange: u,
27
+ onChange: b,
27
28
  ..._
28
- }) => /* @__PURE__ */ b(
29
+ }) => /* @__PURE__ */ u(
29
30
  f,
30
31
  {
31
- className: r.label,
32
+ className: o.base,
32
33
  disabled: p,
33
- selected: o,
34
- size: n,
34
+ selected: i,
35
+ size: e,
35
36
  badge: c,
36
37
  as: "label",
37
38
  ..._,
38
39
  children: [
39
- /* @__PURE__ */ t("input", { className: r.input, name: e, value: m, type: i, checked: o, onChange: u }),
40
- i === "checkbox" && /* @__PURE__ */ t(x, { checked: o, hover: !0, className: r.icon }),
41
- i === "radio" && /* @__PURE__ */ t(I, { checked: o, hover: !0, className: r.icon }),
42
- /* @__PURE__ */ t(v, { title: l, description: a, size: n, children: s })
40
+ /* @__PURE__ */ s("input", { className: o.input, name: a, value: n, type: t, checked: i, onChange: b }),
41
+ t === "checkbox" && /* @__PURE__ */ s(N, { checked: i, hover: !0, className: o.icon }),
42
+ t === "radio" && /* @__PURE__ */ s(g, { checked: i, hover: !0, className: o.icon }),
43
+ /* @__PURE__ */ s(x, { className: o.label, title: m, description: l, size: e, children: r })
43
44
  ]
44
45
  }
45
46
  );
@@ -8,5 +8,5 @@ declare const meta: {
8
8
  };
9
9
  export default meta;
10
10
  type Story = StoryObj<typeof meta>;
11
- export declare const Interactive: Story;
12
- export declare const NonIteractive: Story;
11
+ export declare const Default: Story;
12
+ export declare const NonInteractive: Story;
@@ -1,10 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { MenuItemSize } from './MenuItemBase';
3
3
  export interface MenuItemLabelProps {
4
+ className?: string;
4
5
  size?: MenuItemSize;
5
6
  label?: string;
6
7
  title?: string;
7
8
  description?: string;
8
9
  children?: ReactNode;
9
10
  }
10
- export declare const MenuItemLabel: ({ size, label, title, description, children }: MenuItemLabelProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const MenuItemLabel: ({ className, size, label, title, description, children }: MenuItemLabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -9,6 +9,9 @@ declare const meta: {
9
9
  options: {
10
10
  label: string;
11
11
  value: string;
12
+ badge: {
13
+ label: string;
14
+ };
12
15
  }[];
13
16
  };
14
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",