@norges-domstoler/dds-components 0.0.0-dev-20260928125918 → 0.0.0-dev-20260929103619
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.cjs +48 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +69 -88
- package/dist/index.d.cts +60 -26
- package/dist/index.d.mts +60 -26
- package/dist/index.mjs +48 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1189,7 +1189,7 @@ const BORDER_RADII = [
|
|
|
1189
1189
|
"button",
|
|
1190
1190
|
"input",
|
|
1191
1191
|
"surface",
|
|
1192
|
-
"
|
|
1192
|
+
"tag",
|
|
1193
1193
|
"rounded",
|
|
1194
1194
|
"0"
|
|
1195
1195
|
];
|
|
@@ -1621,7 +1621,7 @@ var Paper_module_default = {
|
|
|
1621
1621
|
var surface_module_default = {
|
|
1622
1622
|
"border-radius--button": "dds-surface-module__border-radius--button",
|
|
1623
1623
|
"border-radius--surface": "dds-surface-module__border-radius--surface",
|
|
1624
|
-
"border-radius--
|
|
1624
|
+
"border-radius--tag": "dds-surface-module__border-radius--tag",
|
|
1625
1625
|
"border-radius--input": "dds-surface-module__border-radius--input",
|
|
1626
1626
|
"border-radius--rounded": "dds-surface-module__border-radius--rounded",
|
|
1627
1627
|
"border-radius--0": "dds-surface-module__border-radius--0"
|
|
@@ -5891,7 +5891,7 @@ const Chip = ({ children, onClose, id, className, style, htmlProps = {}, ...rest
|
|
|
5891
5891
|
maxWidth: "100%",
|
|
5892
5892
|
gap: "x0.125",
|
|
5893
5893
|
padding: "x0.25 0 x0.25 x0.5",
|
|
5894
|
-
borderRadius: "
|
|
5894
|
+
borderRadius: "rounded",
|
|
5895
5895
|
border: "border-subtle",
|
|
5896
5896
|
background: "surface-subtle",
|
|
5897
5897
|
...getBaseHTMLProps(id, cn(className, typographyStyles_module_default["body-short-medium"]), style, restHTMLprops, rest),
|
|
@@ -6544,6 +6544,10 @@ var Input_module_default = {
|
|
|
6544
6544
|
"input--medium": "dds-Input-module__input--medium",
|
|
6545
6545
|
"input--small": "dds-Input-module__input--small",
|
|
6546
6546
|
"input--xsmall": "dds-Input-module__input--xsmall",
|
|
6547
|
+
"compact--medium": "dds-Input-module__compact--medium",
|
|
6548
|
+
"compact--small": "dds-Input-module__compact--small",
|
|
6549
|
+
"compact-with-icon--medium": "dds-Input-module__compact-with-icon--medium",
|
|
6550
|
+
"compact-with-icon--small": "dds-Input-module__compact-with-icon--small",
|
|
6547
6551
|
"input-with-icon--large": "dds-Input-module__input-with-icon--large",
|
|
6548
6552
|
"input-with-icon--medium": "dds-Input-module__input-with-icon--medium",
|
|
6549
6553
|
"input-with-icon--small": "dds-Input-module__input-with-icon--small",
|
|
@@ -13083,17 +13087,12 @@ TabPanels.displayName = "TabPanels";
|
|
|
13083
13087
|
//#region src/components/Tag/Tag.module.css
|
|
13084
13088
|
var Tag_module_default = {
|
|
13085
13089
|
"container": "dds-Tag-module__container",
|
|
13086
|
-
"container--
|
|
13087
|
-
"container--
|
|
13088
|
-
"container--
|
|
13089
|
-
"container--
|
|
13090
|
-
"container--
|
|
13091
|
-
"container--
|
|
13092
|
-
"container--danger--strong": "dds-Tag-module__container--danger--strong",
|
|
13093
|
-
"container--warning--default": "dds-Tag-module__container--warning--default",
|
|
13094
|
-
"container--warning--strong": "dds-Tag-module__container--warning--strong",
|
|
13095
|
-
"container--info--default": "dds-Tag-module__container--info--default",
|
|
13096
|
-
"container--info--strong": "dds-Tag-module__container--info--strong"
|
|
13090
|
+
"container--small": "dds-Tag-module__container--small",
|
|
13091
|
+
"container--medium": "dds-Tag-module__container--medium",
|
|
13092
|
+
"container--outline": "dds-Tag-module__container--outline",
|
|
13093
|
+
"container--subtle": "dds-Tag-module__container--subtle",
|
|
13094
|
+
"container--strong": "dds-Tag-module__container--strong",
|
|
13095
|
+
"container--accent-left": "dds-Tag-module__container--accent-left"
|
|
13097
13096
|
};
|
|
13098
13097
|
//#endregion
|
|
13099
13098
|
//#region src/components/Tag/Tag.tsx
|
|
@@ -13102,12 +13101,42 @@ const icons = {
|
|
|
13102
13101
|
danger: ErrorIcon,
|
|
13103
13102
|
warning: WarningIcon,
|
|
13104
13103
|
success: CheckCircledIcon,
|
|
13105
|
-
|
|
13106
|
-
};
|
|
13107
|
-
const Tag = ({ purpose
|
|
13108
|
-
const
|
|
13104
|
+
neutral: void 0
|
|
13105
|
+
};
|
|
13106
|
+
const Tag = ({ purpose, appearance = "outline", id, className, style, children, htmlProps, withIcon, size = "medium", color, ...rest }) => {
|
|
13107
|
+
const hasColor = color !== void 0;
|
|
13108
|
+
const resolvedPurpose = !hasColor ? purpose ?? "neutral" : void 0;
|
|
13109
|
+
const hasResolvedPurpose = resolvedPurpose !== void 0;
|
|
13110
|
+
const isDefaultPurpose = resolvedPurpose === "neutral";
|
|
13111
|
+
const icon = hasResolvedPurpose ? icons[resolvedPurpose] : void 0;
|
|
13112
|
+
const purposeStyleVariables = {
|
|
13113
|
+
["--dds-color-tag-background-default"]: `var(--dds-color-surface-${purpose}-default)`,
|
|
13114
|
+
["--dds-color-tag-background-strong"]: `var(--dds-color-surface-${purpose}-strong)`,
|
|
13115
|
+
["--dds-color-tag-border-outline"]: `var(--dds-color-border-${purpose})`,
|
|
13116
|
+
["--dds-color-tag-text"]: "var(--dds-color-text-on-status-default)",
|
|
13117
|
+
["--dds-color-tag-icon"]: `var(--dds-color-icon-on-${purpose}-default)`
|
|
13118
|
+
};
|
|
13119
|
+
const defaultPurposeStyleVariables = {
|
|
13120
|
+
["--dds-color-tag-background-default"]: "var(--dds-color-surface-subtle)",
|
|
13121
|
+
["--dds-color-tag-background-strong"]: "var(--dds-color-surface-inverse-default)",
|
|
13122
|
+
["--dds-color-tag-border-outline"]: "var(--dds-color-border-subtle)",
|
|
13123
|
+
["--dds-color-tag-text"]: "var(--dds-color-text-on-inverse)"
|
|
13124
|
+
};
|
|
13125
|
+
const colorStyleVariables = {
|
|
13126
|
+
["--dds-color-tag-background-default"]: `var(--dds-color-data-${color}-100)`,
|
|
13127
|
+
["--dds-color-tag-background-strong"]: `var(--dds-color-data-${color}-300)`,
|
|
13128
|
+
["--dds-color-tag-border-outline"]: `var(--dds-color-data-${color}-300)`,
|
|
13129
|
+
["--dds-color-tag-text"]: `var(--dds-color-text-on-status-default)`
|
|
13130
|
+
};
|
|
13131
|
+
let styleVariables = {};
|
|
13132
|
+
if (isDefaultPurpose) styleVariables = defaultPurposeStyleVariables;
|
|
13133
|
+
else if (hasResolvedPurpose) styleVariables = purposeStyleVariables;
|
|
13134
|
+
else if (hasColor) styleVariables = colorStyleVariables;
|
|
13109
13135
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TextOverflowEllipsisWrapper, {
|
|
13110
|
-
...getBaseHTMLProps(id, cn(className, typographyStyles_module_default[
|
|
13136
|
+
...getBaseHTMLProps(id, cn(className, typographyStyles_module_default[`body-short-${size}`], Tag_module_default.container, Input_module_default[`compact--${size}`], withIcon && Input_module_default[`compact-with-icon--${size}`], Tag_module_default[`container--${appearance}`], Tag_module_default[`container--${size}`]), {
|
|
13137
|
+
...style,
|
|
13138
|
+
...styleVariables
|
|
13139
|
+
}, htmlProps, rest),
|
|
13111
13140
|
children: [withIcon && icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
13112
13141
|
icon,
|
|
13113
13142
|
iconSize: "component"
|