@norges-domstoler/dds-components 0.0.0-dev-20260929100812 → 0.0.0-dev-20260929111123
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 +45 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +60 -79
- package/dist/index.d.cts +47 -13
- package/dist/index.d.mts +47 -13
- package/dist/index.mjs +45 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.css
CHANGED
|
@@ -4511,6 +4511,23 @@
|
|
|
4511
4511
|
--dds-spacing-sm-icon-text-gap: var(--dds-spacing-x0-25);
|
|
4512
4512
|
--dds-spacing-md-icon-text-gap: var(--dds-spacing-x0-5);
|
|
4513
4513
|
--dds-spacing-lg-icon-text-gap: var(--dds-spacing-x0-75);
|
|
4514
|
+
--dds-spacing-input-inline-xs: var(--dds-spacing-x0-5);
|
|
4515
|
+
--dds-spacing-input-inline-sm: var(--dds-spacing-x0-75);
|
|
4516
|
+
--dds-spacing-input-inline-md: var(--dds-spacing-x1);
|
|
4517
|
+
--dds-spacing-input-inline-lg: var(--dds-spacing-x1-5);
|
|
4518
|
+
--dds-spacing-input-block-xs: var(--dds-spacing-x0-125);
|
|
4519
|
+
--dds-spacing-input-block-sm: var(--dds-spacing-x0-25);
|
|
4520
|
+
--dds-spacing-input-block-md: var(--dds-spacing-x0-5);
|
|
4521
|
+
--dds-spacing-input-block-lg: var(--dds-spacing-x0-75);
|
|
4522
|
+
|
|
4523
|
+
--dds-spacing-compact-inline-sm: var(--dds-spacing-input-inline-xs);
|
|
4524
|
+
--dds-spacing-compact-inline-md: var(--dds-spacing-input-inline-sm);
|
|
4525
|
+
--dds-spacing-compact-block-sm: var(--dds-spacing-input-block-xs);
|
|
4526
|
+
--dds-spacing-compact-block-md: var(--dds-spacing-input-block-sm);
|
|
4527
|
+
--dds-spacing-compact-icon-left-sm: var(--dds-spacing-x0-25);
|
|
4528
|
+
--dds-spacing-compact-icon-left-md: var(--dds-spacing-x0-5);
|
|
4529
|
+
--dds-spacing-compact-icon-text-gap-sm: var(--dds-spacing-x0-25);
|
|
4530
|
+
--dds-spacing-compact-icon-text-gap-md: var(--dds-spacing-x0-25);
|
|
4514
4531
|
}
|
|
4515
4532
|
|
|
4516
4533
|
.dds-ThemeProvider-module__global-styles {
|
|
@@ -5664,6 +5681,26 @@ input[data-indeterminate='true'] ~ .dds-SelectionControl-module__selection-contr
|
|
|
5664
5681
|
min-height: var(--dds-size-height-input-xsmall);
|
|
5665
5682
|
}
|
|
5666
5683
|
|
|
5684
|
+
:where(.dds-Input-module__compact--medium) {
|
|
5685
|
+
padding: var(--dds-spacing-compact-block-md)
|
|
5686
|
+
var(--dds-spacing-compact-inline-md);
|
|
5687
|
+
}
|
|
5688
|
+
|
|
5689
|
+
:where(.dds-Input-module__compact--small) {
|
|
5690
|
+
padding: var(--dds-spacing-compact-block-sm)
|
|
5691
|
+
var(--dds-spacing-compact-inline-sm);
|
|
5692
|
+
}
|
|
5693
|
+
|
|
5694
|
+
:where(.dds-Input-module__compact-with-icon--medium) {
|
|
5695
|
+
padding-inline-start: var(--dds-spacing-compact-icon-left-md);
|
|
5696
|
+
gap: var(--dds-spacing-compact-icon-text-gap-md);
|
|
5697
|
+
}
|
|
5698
|
+
|
|
5699
|
+
:where(.dds-Input-module__compact-with-icon--small) {
|
|
5700
|
+
padding-inline-start: var(--dds-spacing-compact-icon-left-sm);
|
|
5701
|
+
gap: var(--dds-spacing-compact-icon-text-gap-sm);
|
|
5702
|
+
}
|
|
5703
|
+
|
|
5667
5704
|
:where(.dds-Input-module__input-with-icon--large) {
|
|
5668
5705
|
padding-left: calc(
|
|
5669
5706
|
var(--dds-input-absolute-el-left-large) + var(--dds-size-icon-component) +
|
|
@@ -7199,104 +7236,48 @@ input[data-indeterminate='true'] ~ .dds-SelectionControl-module__selection-contr
|
|
|
7199
7236
|
display: inline-flex;
|
|
7200
7237
|
align-items: center;
|
|
7201
7238
|
border-radius: var(--dds-border-radius-tag);
|
|
7202
|
-
padding: var(--dds-spacing-x0-125) var(--dds-spacing-x0-5);
|
|
7203
|
-
}
|
|
7204
|
-
|
|
7205
|
-
.dds-Tag-module__container--with-icon {
|
|
7206
|
-
padding: var(--dds-spacing-x0-125) var(--dds-spacing-x0-5)
|
|
7207
|
-
var(--dds-spacing-x0-125) var(--dds-spacing-x0-25);
|
|
7208
|
-
gap: var(--dds-spacing-x0-25);
|
|
7209
|
-
}
|
|
7210
|
-
|
|
7211
|
-
.dds-Tag-module__container--default--default {
|
|
7212
|
-
background-color: var(--dds-color-surface-subtle);
|
|
7213
|
-
border-color: var(--dds-color-border-subtle);
|
|
7214
|
-
}
|
|
7215
|
-
|
|
7216
|
-
.dds-Tag-module__container--default--strong {
|
|
7217
|
-
background-color: var(--dds-color-surface-inverse-default);
|
|
7218
|
-
border-color: var(--dds-color-surface-inverse-default);
|
|
7219
|
-
color: var(--dds-color-text-on-inverse);
|
|
7220
|
-
}
|
|
7221
|
-
|
|
7222
|
-
.dds-Tag-module__container--success--default {
|
|
7223
|
-
background-color: var(--dds-color-surface-success-default);
|
|
7224
|
-
border-color: var(--dds-color-border-success);
|
|
7225
7239
|
color: var(--dds-color-text-on-status-default);
|
|
7226
7240
|
|
|
7227
7241
|
svg {
|
|
7228
|
-
color: var(--dds-color-icon
|
|
7242
|
+
color: var(--dds-color-tag-icon);
|
|
7229
7243
|
}
|
|
7230
7244
|
}
|
|
7231
7245
|
|
|
7232
|
-
.dds-Tag-module__container--
|
|
7233
|
-
|
|
7234
|
-
border-color: var(--dds-color-surface-success-strong);
|
|
7235
|
-
color: var(--dds-color-text-on-status-strong);
|
|
7236
|
-
|
|
7237
|
-
svg {
|
|
7238
|
-
color: var(--dds-color-icon-on-success-strong);
|
|
7239
|
-
}
|
|
7246
|
+
.dds-Tag-module__container--small {
|
|
7247
|
+
--dds-spacing-tag-padding-inline-start-accent: var(--dds-spacing-x0-25);
|
|
7240
7248
|
}
|
|
7241
7249
|
|
|
7242
|
-
.dds-Tag-module__container--
|
|
7243
|
-
|
|
7244
|
-
border-color: var(--dds-color-border-danger);
|
|
7245
|
-
color: var(--dds-color-text-on-status-default);
|
|
7246
|
-
|
|
7247
|
-
svg {
|
|
7248
|
-
color: var(--dds-color-icon-on-danger-default);
|
|
7249
|
-
}
|
|
7250
|
+
.dds-Tag-module__container--medium {
|
|
7251
|
+
--dds-spacing-tag-padding-inline-start-accent: var(--dds-spacing-x0-5);
|
|
7250
7252
|
}
|
|
7251
7253
|
|
|
7252
|
-
.dds-Tag-module__container--
|
|
7253
|
-
background-color: var(--dds-color-
|
|
7254
|
-
border-color: var(--dds-color-
|
|
7255
|
-
color: var(--dds-color-text-on-status-strong);
|
|
7256
|
-
|
|
7257
|
-
svg {
|
|
7258
|
-
color: var(--dds-color-icon-on-danger-strong);
|
|
7259
|
-
}
|
|
7254
|
+
.dds-Tag-module__container--outline {
|
|
7255
|
+
background-color: var(--dds-color-tag-background-default);
|
|
7256
|
+
border-color: var(--dds-color-tag-border-outline);
|
|
7260
7257
|
}
|
|
7261
7258
|
|
|
7262
|
-
.dds-Tag-module__container--
|
|
7263
|
-
background-color: var(--dds-color-
|
|
7264
|
-
border-color: var(--dds-color-
|
|
7265
|
-
color: var(--dds-color-text-on-status-default);
|
|
7266
|
-
|
|
7267
|
-
svg {
|
|
7268
|
-
color: var(--dds-color-icon-on-warning-default);
|
|
7269
|
-
}
|
|
7259
|
+
.dds-Tag-module__container--subtle {
|
|
7260
|
+
background-color: var(--dds-color-tag-background-default);
|
|
7261
|
+
border-color: var(--dds-color-tag-background-default);
|
|
7270
7262
|
}
|
|
7271
7263
|
|
|
7272
|
-
.dds-Tag-module__container--
|
|
7273
|
-
background-color: var(--dds-color-
|
|
7274
|
-
border-color: var(--dds-color-
|
|
7275
|
-
color: var(--dds-color-text
|
|
7276
|
-
|
|
7277
|
-
svg {
|
|
7278
|
-
color: var(--dds-color-icon-on-warning-strong);
|
|
7279
|
-
}
|
|
7280
|
-
}
|
|
7281
|
-
|
|
7282
|
-
.dds-Tag-module__container--info--default {
|
|
7283
|
-
background-color: var(--dds-color-surface-info-default);
|
|
7284
|
-
border-color: var(--dds-color-border-info);
|
|
7285
|
-
color: var(--dds-color-text-on-status-default);
|
|
7264
|
+
.dds-Tag-module__container--strong {
|
|
7265
|
+
background-color: var(--dds-color-tag-background-strong);
|
|
7266
|
+
border-color: var(--dds-color-tag-background-strong);
|
|
7267
|
+
color: var(--dds-color-tag-text);
|
|
7286
7268
|
|
|
7287
7269
|
svg {
|
|
7288
|
-
color: var(--dds-color-
|
|
7270
|
+
color: var(--dds-color-text-on-status-strong);
|
|
7289
7271
|
}
|
|
7290
7272
|
}
|
|
7291
7273
|
|
|
7292
|
-
.dds-Tag-module__container--
|
|
7293
|
-
background-color: var(--dds-color-
|
|
7294
|
-
border-color: var(--dds-color-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
}
|
|
7274
|
+
.dds-Tag-module__container--accent-left {
|
|
7275
|
+
background-color: var(--dds-color-tag-background-default);
|
|
7276
|
+
border-color: var(--dds-color-tag-background-default);
|
|
7277
|
+
border-left: var(--dds-size-tag-accent-width) solid
|
|
7278
|
+
var(--dds-color-tag-border-outline);
|
|
7279
|
+
--dds-size-tag-accent-width: var(--dds-spacing-x0-5);
|
|
7280
|
+
padding-inline-start: var(--dds-spacing-tag-padding-inline-start-accent);
|
|
7300
7281
|
}
|
|
7301
7282
|
.dds-TextInput-module__container {
|
|
7302
7283
|
color: var(--dds-color-text-default);
|
package/dist/index.d.cts
CHANGED
|
@@ -277,7 +277,7 @@ type Size$1 = (typeof SIZES)[number];
|
|
|
277
277
|
export declare function createSizes<T extends Array<Size$1>>(...sizes: T): T;
|
|
278
278
|
//#endregion
|
|
279
279
|
//#region src/types/Purpose.d.ts
|
|
280
|
-
declare const PURPOSES: readonly ["primary", "secondary", "tertiary", "success", "info", "danger", "warning", "default", "tips"];
|
|
280
|
+
declare const PURPOSES: readonly ["primary", "secondary", "tertiary", "success", "info", "danger", "warning", "default", "neutral", "tips"];
|
|
281
281
|
type Purpose = (typeof PURPOSES)[number];
|
|
282
282
|
export declare function createPurposes<T extends Array<Purpose>>(...sizes: T): T;
|
|
283
283
|
//#endregion
|
|
@@ -27126,32 +27126,66 @@ export declare const TabPanels: {
|
|
|
27126
27126
|
};
|
|
27127
27127
|
//#endregion
|
|
27128
27128
|
//#region src/components/Tag/Tag.d.ts
|
|
27129
|
-
declare const TAG_PURPOSES: ["success", "info", "danger", "warning", "
|
|
27129
|
+
declare const TAG_PURPOSES: ["success", "info", "danger", "warning", "neutral"];
|
|
27130
|
+
declare const TAG_SIZES: ["small", "medium"];
|
|
27131
|
+
declare const TAG_COLORS: readonly ["teal", "blue", "red", "green", "magenta", "olive", "gray", "brown", "deepblue"];
|
|
27132
|
+
declare const TAG_APPEARANCES: readonly ["outline", "strong", "subtle", "accent-left"];
|
|
27130
27133
|
type TagPurpose = (typeof TAG_PURPOSES)[number];
|
|
27131
|
-
type
|
|
27134
|
+
type TagSize = (typeof TAG_SIZES)[number];
|
|
27135
|
+
type TagAppearance = (typeof TAG_APPEARANCES)[number];
|
|
27136
|
+
type TagColor = (typeof TAG_COLORS)[number];
|
|
27132
27137
|
type TagProps = BaseComponentProps<HTMLSpanElement, {
|
|
27133
27138
|
/**
|
|
27134
27139
|
* Innholdet til `<Tag>.`
|
|
27135
27140
|
*/
|
|
27136
27141
|
children?: string;
|
|
27137
|
-
/**
|
|
27138
|
-
* Formål med status eller kategorisering. Påvirker styling.
|
|
27139
|
-
* @default "default"
|
|
27140
|
-
*/
|
|
27141
|
-
purpose?: TagPurpose;
|
|
27142
27142
|
/**
|
|
27143
27143
|
* Det visuelle uttrykket til komponenten.
|
|
27144
|
-
* @default "
|
|
27144
|
+
* @default "outline"
|
|
27145
27145
|
*/
|
|
27146
27146
|
appearance?: TagAppearance;
|
|
27147
27147
|
/**
|
|
27148
|
-
*
|
|
27148
|
+
* Størrelsen på `<Tag>`.
|
|
27149
|
+
* @default "medium"
|
|
27150
|
+
*/
|
|
27151
|
+
size?: TagSize;
|
|
27152
|
+
} & ({
|
|
27153
|
+
/**
|
|
27154
|
+
* Formål med status eller kategorisering. Påvirker styling. Hvis denne propen er satt kan ikke `color` prop settes.
|
|
27155
|
+
* @default "neutral"
|
|
27156
|
+
*/
|
|
27157
|
+
purpose?: TagPurpose;
|
|
27158
|
+
/**
|
|
27159
|
+
* Om `<Tag>` skal ha et ikon til venstre for teksten. Tags med `purpose="neutral"` har aldri ikon.
|
|
27149
27160
|
* @default false
|
|
27150
27161
|
*/
|
|
27151
27162
|
withIcon?: boolean;
|
|
27152
|
-
|
|
27163
|
+
/**
|
|
27164
|
+
* Farge fra data-utvalget.
|
|
27165
|
+
* Hvis denne brukes bestemmer konsumenten selv formål eller kategorisering den brukes til.
|
|
27166
|
+
* Hvis denne propen er satt kan ikke `purpose` prop settes.
|
|
27167
|
+
*/
|
|
27168
|
+
color?: never;
|
|
27169
|
+
} | {
|
|
27170
|
+
/**
|
|
27171
|
+
* Formål med status eller kategorisering. Påvirker styling. Hvis denne propen er satt kan ikke `color` prop settes.
|
|
27172
|
+
* @default "neutral"
|
|
27173
|
+
*/
|
|
27174
|
+
purpose?: never;
|
|
27175
|
+
/**
|
|
27176
|
+
* Om `<Tag>` skal ha et ikon til venstre for teksten. Tags med `purpose="neutral"` har aldri ikon.
|
|
27177
|
+
* @default false
|
|
27178
|
+
*/
|
|
27179
|
+
withIcon?: never;
|
|
27180
|
+
/**
|
|
27181
|
+
* Farge fra data-utvalget.
|
|
27182
|
+
* Hvis denne brukes bestemmer konsumenten selv formål eller kategorisering den brukes til.
|
|
27183
|
+
* Hvis denne propen er satt kan ikke `purpose` prop settes.
|
|
27184
|
+
*/
|
|
27185
|
+
color: TagColor;
|
|
27186
|
+
})>;
|
|
27153
27187
|
export declare const Tag: {
|
|
27154
|
-
({ purpose, appearance, id, className, style, children, htmlProps, withIcon, ...rest }: TagProps): import("react").JSX.Element;
|
|
27188
|
+
({ purpose, appearance, id, className, style, children, htmlProps, withIcon, size, color, ...rest }: TagProps): import("react").JSX.Element;
|
|
27155
27189
|
displayName: string;
|
|
27156
27190
|
};
|
|
27157
27191
|
//#endregion
|
|
@@ -27306,5 +27340,5 @@ export declare const VisuallyHidden: {
|
|
|
27306
27340
|
displayName: string;
|
|
27307
27341
|
};
|
|
27308
27342
|
//#endregion
|
|
27309
|
-
export { type BadgeInComponentProps, type BadgeProps, type BadgePurpose, type BadgeSize, Bleed$1 as Bleed, type BleedProps, type Breakpoint, type ButtonProps, type ButtonPurpose, type ButtonSize, type CalendarProps, type CardProps, type CardSelectableProps, type DatePickerProps, type DdsTheme, type DrawerPlacement, type DrawerProps, type DrawerSize, type ErrorSummaryItemProps, type ErrorSummaryProps, type FavStarProps, type GlobalMessageProps, type GlobalMessagePurpose, type IconPosition, type IconProps, type IconSize, type InlineEditInputProps, type InlineEditSelectProps, type InlineEditTextAreaProps, type NewsPopoverProps, type ParagraphProps, type PhoneInputProps, type ProgressBarProps, type ProgressBarSize, type Purpose, type RadioButtonProps, type RadioValue, type ResponsiveProps, type ResponsiveStackProps, Search, type SearchAutocompleteWrapperProps, type SearchData, type SearchProps, type SearchSuggestionsProps, type Size$1 as Size, type SortOrder, type SpacingScale, type SvgIcon, type SvgProps, type TabSize, Table, Body as TableBody, type TableBodyProps, Cell as TableCell, type TableCellLayout, type TableCellProps, type TableCellType, Foot as TableFoot, type TableFootProps, Head as TableHead, type TableHeadProps, type TableProps, Row as TableRow, type TableRowProps, type TableRowType, type TableSize, SortCell as TableSortCell, type TableSortCellProps, type TabsProps, type TagAppearance, type TagProps, type TagPurpose, type TimePickerProps, type ToggleBarProps, type ToggleBarSize, type ToggleBarValue, type ToggleButtonProps, type ToggleProps, type ToggleSize, type WeightedSearchData, type ZIndex, index_d_exports as icons };
|
|
27343
|
+
export { type BadgeInComponentProps, type BadgeProps, type BadgePurpose, type BadgeSize, Bleed$1 as Bleed, type BleedProps, type Breakpoint, type ButtonProps, type ButtonPurpose, type ButtonSize, type CalendarProps, type CardProps, type CardSelectableProps, type DatePickerProps, type DdsTheme, type DrawerPlacement, type DrawerProps, type DrawerSize, type ErrorSummaryItemProps, type ErrorSummaryProps, type FavStarProps, type GlobalMessageProps, type GlobalMessagePurpose, type IconPosition, type IconProps, type IconSize, type InlineEditInputProps, type InlineEditSelectProps, type InlineEditTextAreaProps, type NewsPopoverProps, type ParagraphProps, type PhoneInputProps, type ProgressBarProps, type ProgressBarSize, type Purpose, type RadioButtonProps, type RadioValue, type ResponsiveProps, type ResponsiveStackProps, Search, type SearchAutocompleteWrapperProps, type SearchData, type SearchProps, type SearchSuggestionsProps, type Size$1 as Size, type SortOrder, type SpacingScale, type SvgIcon, type SvgProps, type TabSize, Table, Body as TableBody, type TableBodyProps, Cell as TableCell, type TableCellLayout, type TableCellProps, type TableCellType, Foot as TableFoot, type TableFootProps, Head as TableHead, type TableHeadProps, type TableProps, Row as TableRow, type TableRowProps, type TableRowType, type TableSize, SortCell as TableSortCell, type TableSortCellProps, type TabsProps, type TagAppearance, type TagColor, type TagProps, type TagPurpose, type TagSize, type TimePickerProps, type ToggleBarProps, type ToggleBarSize, type ToggleBarValue, type ToggleButtonProps, type ToggleProps, type ToggleSize, type WeightedSearchData, type ZIndex, index_d_exports as icons };
|
|
27310
27344
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -276,7 +276,7 @@ type Size$1 = (typeof SIZES)[number];
|
|
|
276
276
|
export declare function createSizes<T extends Array<Size$1>>(...sizes: T): T;
|
|
277
277
|
//#endregion
|
|
278
278
|
//#region src/types/Purpose.d.ts
|
|
279
|
-
declare const PURPOSES: readonly ["primary", "secondary", "tertiary", "success", "info", "danger", "warning", "default", "tips"];
|
|
279
|
+
declare const PURPOSES: readonly ["primary", "secondary", "tertiary", "success", "info", "danger", "warning", "default", "neutral", "tips"];
|
|
280
280
|
type Purpose = (typeof PURPOSES)[number];
|
|
281
281
|
export declare function createPurposes<T extends Array<Purpose>>(...sizes: T): T;
|
|
282
282
|
//#endregion
|
|
@@ -27125,32 +27125,66 @@ export declare const TabPanels: {
|
|
|
27125
27125
|
};
|
|
27126
27126
|
//#endregion
|
|
27127
27127
|
//#region src/components/Tag/Tag.d.ts
|
|
27128
|
-
declare const TAG_PURPOSES: ["success", "info", "danger", "warning", "
|
|
27128
|
+
declare const TAG_PURPOSES: ["success", "info", "danger", "warning", "neutral"];
|
|
27129
|
+
declare const TAG_SIZES: ["small", "medium"];
|
|
27130
|
+
declare const TAG_COLORS: readonly ["teal", "blue", "red", "green", "magenta", "olive", "gray", "brown", "deepblue"];
|
|
27131
|
+
declare const TAG_APPEARANCES: readonly ["outline", "strong", "subtle", "accent-left"];
|
|
27129
27132
|
type TagPurpose = (typeof TAG_PURPOSES)[number];
|
|
27130
|
-
type
|
|
27133
|
+
type TagSize = (typeof TAG_SIZES)[number];
|
|
27134
|
+
type TagAppearance = (typeof TAG_APPEARANCES)[number];
|
|
27135
|
+
type TagColor = (typeof TAG_COLORS)[number];
|
|
27131
27136
|
type TagProps = BaseComponentProps<HTMLSpanElement, {
|
|
27132
27137
|
/**
|
|
27133
27138
|
* Innholdet til `<Tag>.`
|
|
27134
27139
|
*/
|
|
27135
27140
|
children?: string;
|
|
27136
|
-
/**
|
|
27137
|
-
* Formål med status eller kategorisering. Påvirker styling.
|
|
27138
|
-
* @default "default"
|
|
27139
|
-
*/
|
|
27140
|
-
purpose?: TagPurpose;
|
|
27141
27141
|
/**
|
|
27142
27142
|
* Det visuelle uttrykket til komponenten.
|
|
27143
|
-
* @default "
|
|
27143
|
+
* @default "outline"
|
|
27144
27144
|
*/
|
|
27145
27145
|
appearance?: TagAppearance;
|
|
27146
27146
|
/**
|
|
27147
|
-
*
|
|
27147
|
+
* Størrelsen på `<Tag>`.
|
|
27148
|
+
* @default "medium"
|
|
27149
|
+
*/
|
|
27150
|
+
size?: TagSize;
|
|
27151
|
+
} & ({
|
|
27152
|
+
/**
|
|
27153
|
+
* Formål med status eller kategorisering. Påvirker styling. Hvis denne propen er satt kan ikke `color` prop settes.
|
|
27154
|
+
* @default "neutral"
|
|
27155
|
+
*/
|
|
27156
|
+
purpose?: TagPurpose;
|
|
27157
|
+
/**
|
|
27158
|
+
* Om `<Tag>` skal ha et ikon til venstre for teksten. Tags med `purpose="neutral"` har aldri ikon.
|
|
27148
27159
|
* @default false
|
|
27149
27160
|
*/
|
|
27150
27161
|
withIcon?: boolean;
|
|
27151
|
-
|
|
27162
|
+
/**
|
|
27163
|
+
* Farge fra data-utvalget.
|
|
27164
|
+
* Hvis denne brukes bestemmer konsumenten selv formål eller kategorisering den brukes til.
|
|
27165
|
+
* Hvis denne propen er satt kan ikke `purpose` prop settes.
|
|
27166
|
+
*/
|
|
27167
|
+
color?: never;
|
|
27168
|
+
} | {
|
|
27169
|
+
/**
|
|
27170
|
+
* Formål med status eller kategorisering. Påvirker styling. Hvis denne propen er satt kan ikke `color` prop settes.
|
|
27171
|
+
* @default "neutral"
|
|
27172
|
+
*/
|
|
27173
|
+
purpose?: never;
|
|
27174
|
+
/**
|
|
27175
|
+
* Om `<Tag>` skal ha et ikon til venstre for teksten. Tags med `purpose="neutral"` har aldri ikon.
|
|
27176
|
+
* @default false
|
|
27177
|
+
*/
|
|
27178
|
+
withIcon?: never;
|
|
27179
|
+
/**
|
|
27180
|
+
* Farge fra data-utvalget.
|
|
27181
|
+
* Hvis denne brukes bestemmer konsumenten selv formål eller kategorisering den brukes til.
|
|
27182
|
+
* Hvis denne propen er satt kan ikke `purpose` prop settes.
|
|
27183
|
+
*/
|
|
27184
|
+
color: TagColor;
|
|
27185
|
+
})>;
|
|
27152
27186
|
export declare const Tag: {
|
|
27153
|
-
({ purpose, appearance, id, className, style, children, htmlProps, withIcon, ...rest }: TagProps): import("react").JSX.Element;
|
|
27187
|
+
({ purpose, appearance, id, className, style, children, htmlProps, withIcon, size, color, ...rest }: TagProps): import("react").JSX.Element;
|
|
27154
27188
|
displayName: string;
|
|
27155
27189
|
};
|
|
27156
27190
|
//#endregion
|
|
@@ -27305,5 +27339,5 @@ export declare const VisuallyHidden: {
|
|
|
27305
27339
|
displayName: string;
|
|
27306
27340
|
};
|
|
27307
27341
|
//#endregion
|
|
27308
|
-
export { type BadgeInComponentProps, type BadgeProps, type BadgePurpose, type BadgeSize, Bleed$1 as Bleed, type BleedProps, type Breakpoint, type ButtonProps, type ButtonPurpose, type ButtonSize, type CalendarProps, type CardProps, type CardSelectableProps, type DatePickerProps, type DdsTheme, type DrawerPlacement, type DrawerProps, type DrawerSize, type ErrorSummaryItemProps, type ErrorSummaryProps, type FavStarProps, type GlobalMessageProps, type GlobalMessagePurpose, type IconPosition, type IconProps, type IconSize, type InlineEditInputProps, type InlineEditSelectProps, type InlineEditTextAreaProps, type NewsPopoverProps, type ParagraphProps, type PhoneInputProps, type ProgressBarProps, type ProgressBarSize, type Purpose, type RadioButtonProps, type RadioValue, type ResponsiveProps, type ResponsiveStackProps, Search, type SearchAutocompleteWrapperProps, type SearchData, type SearchProps, type SearchSuggestionsProps, type Size$1 as Size, type SortOrder, type SpacingScale, type SvgIcon, type SvgProps, type TabSize, Table, Body as TableBody, type TableBodyProps, Cell as TableCell, type TableCellLayout, type TableCellProps, type TableCellType, Foot as TableFoot, type TableFootProps, Head as TableHead, type TableHeadProps, type TableProps, Row as TableRow, type TableRowProps, type TableRowType, type TableSize, SortCell as TableSortCell, type TableSortCellProps, type TabsProps, type TagAppearance, type TagProps, type TagPurpose, type TimePickerProps, type ToggleBarProps, type ToggleBarSize, type ToggleBarValue, type ToggleButtonProps, type ToggleProps, type ToggleSize, type WeightedSearchData, type ZIndex, index_d_exports as icons };
|
|
27342
|
+
export { type BadgeInComponentProps, type BadgeProps, type BadgePurpose, type BadgeSize, Bleed$1 as Bleed, type BleedProps, type Breakpoint, type ButtonProps, type ButtonPurpose, type ButtonSize, type CalendarProps, type CardProps, type CardSelectableProps, type DatePickerProps, type DdsTheme, type DrawerPlacement, type DrawerProps, type DrawerSize, type ErrorSummaryItemProps, type ErrorSummaryProps, type FavStarProps, type GlobalMessageProps, type GlobalMessagePurpose, type IconPosition, type IconProps, type IconSize, type InlineEditInputProps, type InlineEditSelectProps, type InlineEditTextAreaProps, type NewsPopoverProps, type ParagraphProps, type PhoneInputProps, type ProgressBarProps, type ProgressBarSize, type Purpose, type RadioButtonProps, type RadioValue, type ResponsiveProps, type ResponsiveStackProps, Search, type SearchAutocompleteWrapperProps, type SearchData, type SearchProps, type SearchSuggestionsProps, type Size$1 as Size, type SortOrder, type SpacingScale, type SvgIcon, type SvgProps, type TabSize, Table, Body as TableBody, type TableBodyProps, Cell as TableCell, type TableCellLayout, type TableCellProps, type TableCellType, Foot as TableFoot, type TableFootProps, Head as TableHead, type TableHeadProps, type TableProps, Row as TableRow, type TableRowProps, type TableRowType, type TableSize, SortCell as TableSortCell, type TableSortCellProps, type TabsProps, type TagAppearance, type TagColor, type TagProps, type TagPurpose, type TagSize, type TimePickerProps, type ToggleBarProps, type ToggleBarSize, type ToggleBarValue, type ToggleButtonProps, type ToggleProps, type ToggleSize, type WeightedSearchData, type ZIndex, index_d_exports as icons };
|
|
27309
27343
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -6511,6 +6511,10 @@ var Input_module_default = {
|
|
|
6511
6511
|
"input--medium": "dds-Input-module__input--medium",
|
|
6512
6512
|
"input--small": "dds-Input-module__input--small",
|
|
6513
6513
|
"input--xsmall": "dds-Input-module__input--xsmall",
|
|
6514
|
+
"compact--medium": "dds-Input-module__compact--medium",
|
|
6515
|
+
"compact--small": "dds-Input-module__compact--small",
|
|
6516
|
+
"compact-with-icon--medium": "dds-Input-module__compact-with-icon--medium",
|
|
6517
|
+
"compact-with-icon--small": "dds-Input-module__compact-with-icon--small",
|
|
6514
6518
|
"input-with-icon--large": "dds-Input-module__input-with-icon--large",
|
|
6515
6519
|
"input-with-icon--medium": "dds-Input-module__input-with-icon--medium",
|
|
6516
6520
|
"input-with-icon--small": "dds-Input-module__input-with-icon--small",
|
|
@@ -13050,17 +13054,12 @@ TabPanels.displayName = "TabPanels";
|
|
|
13050
13054
|
//#region src/components/Tag/Tag.module.css
|
|
13051
13055
|
var Tag_module_default = {
|
|
13052
13056
|
"container": "dds-Tag-module__container",
|
|
13053
|
-
"container--
|
|
13054
|
-
"container--
|
|
13055
|
-
"container--
|
|
13056
|
-
"container--
|
|
13057
|
-
"container--
|
|
13058
|
-
"container--
|
|
13059
|
-
"container--danger--strong": "dds-Tag-module__container--danger--strong",
|
|
13060
|
-
"container--warning--default": "dds-Tag-module__container--warning--default",
|
|
13061
|
-
"container--warning--strong": "dds-Tag-module__container--warning--strong",
|
|
13062
|
-
"container--info--default": "dds-Tag-module__container--info--default",
|
|
13063
|
-
"container--info--strong": "dds-Tag-module__container--info--strong"
|
|
13057
|
+
"container--small": "dds-Tag-module__container--small",
|
|
13058
|
+
"container--medium": "dds-Tag-module__container--medium",
|
|
13059
|
+
"container--outline": "dds-Tag-module__container--outline",
|
|
13060
|
+
"container--subtle": "dds-Tag-module__container--subtle",
|
|
13061
|
+
"container--strong": "dds-Tag-module__container--strong",
|
|
13062
|
+
"container--accent-left": "dds-Tag-module__container--accent-left"
|
|
13064
13063
|
};
|
|
13065
13064
|
//#endregion
|
|
13066
13065
|
//#region src/components/Tag/Tag.tsx
|
|
@@ -13069,12 +13068,42 @@ const icons = {
|
|
|
13069
13068
|
danger: ErrorIcon,
|
|
13070
13069
|
warning: WarningIcon,
|
|
13071
13070
|
success: CheckCircledIcon,
|
|
13072
|
-
|
|
13073
|
-
};
|
|
13074
|
-
const Tag = ({ purpose
|
|
13075
|
-
const
|
|
13071
|
+
neutral: void 0
|
|
13072
|
+
};
|
|
13073
|
+
const Tag = ({ purpose, appearance = "outline", id, className, style, children, htmlProps, withIcon, size = "medium", color, ...rest }) => {
|
|
13074
|
+
const hasColor = color !== void 0;
|
|
13075
|
+
const resolvedPurpose = !hasColor ? purpose ?? "neutral" : void 0;
|
|
13076
|
+
const hasResolvedPurpose = resolvedPurpose !== void 0;
|
|
13077
|
+
const isDefaultPurpose = resolvedPurpose === "neutral";
|
|
13078
|
+
const icon = hasResolvedPurpose ? icons[resolvedPurpose] : void 0;
|
|
13079
|
+
const purposeStyleVariables = {
|
|
13080
|
+
["--dds-color-tag-background-default"]: `var(--dds-color-surface-${purpose}-default)`,
|
|
13081
|
+
["--dds-color-tag-background-strong"]: `var(--dds-color-surface-${purpose}-strong)`,
|
|
13082
|
+
["--dds-color-tag-border-outline"]: `var(--dds-color-border-${purpose})`,
|
|
13083
|
+
["--dds-color-tag-text"]: "var(--dds-color-text-on-status-default)",
|
|
13084
|
+
["--dds-color-tag-icon"]: `var(--dds-color-icon-on-${purpose}-default)`
|
|
13085
|
+
};
|
|
13086
|
+
const defaultPurposeStyleVariables = {
|
|
13087
|
+
["--dds-color-tag-background-default"]: "var(--dds-color-surface-subtle)",
|
|
13088
|
+
["--dds-color-tag-background-strong"]: "var(--dds-color-surface-inverse-default)",
|
|
13089
|
+
["--dds-color-tag-border-outline"]: "var(--dds-color-border-subtle)",
|
|
13090
|
+
["--dds-color-tag-text"]: "var(--dds-color-text-on-inverse)"
|
|
13091
|
+
};
|
|
13092
|
+
const colorStyleVariables = {
|
|
13093
|
+
["--dds-color-tag-background-default"]: `var(--dds-color-data-${color}-100)`,
|
|
13094
|
+
["--dds-color-tag-background-strong"]: `var(--dds-color-data-${color}-300)`,
|
|
13095
|
+
["--dds-color-tag-border-outline"]: `var(--dds-color-data-${color}-300)`,
|
|
13096
|
+
["--dds-color-tag-text"]: `var(--dds-color-text-on-status-default)`
|
|
13097
|
+
};
|
|
13098
|
+
let styleVariables = {};
|
|
13099
|
+
if (isDefaultPurpose) styleVariables = defaultPurposeStyleVariables;
|
|
13100
|
+
else if (hasResolvedPurpose) styleVariables = purposeStyleVariables;
|
|
13101
|
+
else if (hasColor) styleVariables = colorStyleVariables;
|
|
13076
13102
|
return /* @__PURE__ */ jsxs(TextOverflowEllipsisWrapper, {
|
|
13077
|
-
...getBaseHTMLProps(id, cn(className, typographyStyles_module_default[
|
|
13103
|
+
...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}`]), {
|
|
13104
|
+
...style,
|
|
13105
|
+
...styleVariables
|
|
13106
|
+
}, htmlProps, rest),
|
|
13078
13107
|
children: [withIcon && icon && /* @__PURE__ */ jsx(Icon, {
|
|
13079
13108
|
icon,
|
|
13080
13109
|
iconSize: "component"
|