@norges-domstoler/dds-components 0.0.0-dev-20260317093703 → 0.0.0-dev-20260319072103

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/dist/index.mjs CHANGED
@@ -14799,7 +14799,8 @@ import { useId as useId30, useState as useState35 } from "react";
14799
14799
  // src/components/ToggleBar/ToggleBar.context.tsx
14800
14800
  import { createContext as createContext20, useContext as useContext28 } from "react";
14801
14801
  var ToggleBarContext = createContext20({
14802
- size: "medium"
14802
+ size: "medium",
14803
+ purpose: "primary"
14803
14804
  });
14804
14805
  var useToggleBarContext = () => useContext28(ToggleBarContext);
14805
14806
 
@@ -14807,7 +14808,9 @@ var useToggleBarContext = () => useContext28(ToggleBarContext);
14807
14808
  var ToggleBar_default = {
14808
14809
  bar: "ToggleBar_bar",
14809
14810
  content: "ToggleBar_content",
14810
- label: "ToggleBar_label"
14811
+ label: "ToggleBar_label",
14812
+ "label--primary": "ToggleBar_label--primary",
14813
+ "label--secondary": "ToggleBar_label--secondary"
14811
14814
  };
14812
14815
 
14813
14816
  // src/components/ToggleBar/ToggleBar.tsx
@@ -14816,6 +14819,7 @@ var ToggleBar = (props) => {
14816
14819
  const {
14817
14820
  children,
14818
14821
  size: size2 = "medium",
14822
+ purpose = "primary",
14819
14823
  label,
14820
14824
  onChange,
14821
14825
  value,
@@ -14839,6 +14843,7 @@ var ToggleBar = (props) => {
14839
14843
  ToggleBarContext,
14840
14844
  {
14841
14845
  value: {
14846
+ purpose,
14842
14847
  size: size2,
14843
14848
  onChange: handleChange,
14844
14849
  name,
@@ -14908,45 +14913,52 @@ var ToggleRadio = ({
14908
14913
  const hasLabel = !!label;
14909
14914
  const hasIcon = !!icon;
14910
14915
  const contentTypeCn = !hasLabel ? "just-icon" : !hasIcon ? "just-text" : "with-text-and-icon";
14911
- return /* @__PURE__ */ jsxs134("label", { htmlFor: uniqueId, className: ToggleBar_default.label, children: [
14912
- /* @__PURE__ */ jsx341(
14913
- HiddenInput,
14914
- {
14915
- ...getBaseHTMLProps(
14916
- uniqueId,
14917
- cn(className, focus_default["focusable-sibling"]),
14918
- style,
14919
- htmlProps,
14920
- rest
14921
- ),
14922
- type: "radio",
14923
- name: name != null ? name : group.name,
14924
- onChange: handleChange,
14925
- value,
14926
- checked: calculateChecked(value, group, checked),
14927
- "aria-label": ariaLabel,
14928
- "aria-labelledby": ariaLabelledBy
14929
- }
14930
- ),
14931
- /* @__PURE__ */ jsxs134(
14932
- Typography,
14933
- {
14934
- as: "span",
14935
- typographyType: typographyTypes[group.size],
14936
- className: cn(
14937
- ToggleBar_default.content,
14938
- Button_default[contentTypeCn],
14939
- hasLabel && hasIcon && Button_default["with-icon-left"],
14940
- Button_default[`button--${group.size}`],
14941
- focus_default["focus-styled-sibling"]
14916
+ return /* @__PURE__ */ jsxs134(
14917
+ "label",
14918
+ {
14919
+ htmlFor: uniqueId,
14920
+ className: cn(ToggleBar_default.label, ToggleBar_default[`label--${group.purpose}`]),
14921
+ children: [
14922
+ /* @__PURE__ */ jsx341(
14923
+ HiddenInput,
14924
+ {
14925
+ ...getBaseHTMLProps(
14926
+ uniqueId,
14927
+ cn(className, focus_default["focusable-sibling"]),
14928
+ style,
14929
+ htmlProps,
14930
+ rest
14931
+ ),
14932
+ type: "radio",
14933
+ name: name != null ? name : group.name,
14934
+ onChange: handleChange,
14935
+ value,
14936
+ checked: calculateChecked(value, group, checked),
14937
+ "aria-label": ariaLabel,
14938
+ "aria-labelledby": ariaLabelledBy
14939
+ }
14942
14940
  ),
14943
- children: [
14944
- icon && /* @__PURE__ */ jsx341(Icon, { icon, iconSize: "component" }),
14945
- label && /* @__PURE__ */ jsx341("span", { children: label })
14946
- ]
14947
- }
14948
- )
14949
- ] });
14941
+ /* @__PURE__ */ jsxs134(
14942
+ Typography,
14943
+ {
14944
+ as: "span",
14945
+ typographyType: typographyTypes[group.size],
14946
+ className: cn(
14947
+ ToggleBar_default.content,
14948
+ Button_default[contentTypeCn],
14949
+ hasLabel && hasIcon && Button_default["with-icon-left"],
14950
+ Button_default[`button--${group.size}`],
14951
+ focus_default["focus-styled-sibling"]
14952
+ ),
14953
+ children: [
14954
+ icon && /* @__PURE__ */ jsx341(Icon, { icon, iconSize: "component" }),
14955
+ label && /* @__PURE__ */ jsx341("span", { children: label })
14956
+ ]
14957
+ }
14958
+ )
14959
+ ]
14960
+ }
14961
+ );
14950
14962
  };
14951
14963
  ToggleRadio.displayName = "ToggleRadio";
14952
14964