@synerise/ds-tag 2.0.11 → 2.1.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.
- package/CHANGELOG.md +11 -0
- package/CLAUDE.md +11 -10
- package/README.md +1 -1
- package/dist/Tag.js +2 -2
- package/dist/Tag.styles.d.ts +2 -2
- package/dist/Tag.styles.js +52 -38
- package/dist/Tag.types.d.ts +5 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
# [2.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tag@2.0.11...@synerise/ds-tag@2.1.0) (2026-10-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* integrate Token Studio design tokens across the design system ([aabb447](https://github.com/Synerise/synerise-design/commit/aabb447edfb2d0c85e3de1f07e809ef84083453b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.0.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tag@2.0.10...@synerise/ds-tag@2.0.11) (2026-10-28)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-tag
|
package/CLAUDE.md
CHANGED
|
@@ -30,8 +30,8 @@ export { useDefaultTexts } from './hooks/useDefaultTexts';
|
|
|
30
30
|
|------|------|---------|-------------|
|
|
31
31
|
| `id` | `string \| number` | — | Used as the argument passed to `onRemove`; also sets `data-testid="tag-{id}"` (falls back to `"tag"` when absent) |
|
|
32
32
|
| `name` | `string` | — | Display text of the tag, rendered inside a `<span>` with text-overflow ellipsis |
|
|
33
|
-
| `color` | `string` | — | Background color for non-status shapes
|
|
34
|
-
| `textColor` | `string` | — |
|
|
33
|
+
| `color` | `string` | — | Background color for non-status shapes. Unset → grey variant tokens for background and text |
|
|
34
|
+
| `textColor` | `string` | — | Text color; on default/single-character/medium shapes it applies only when `color` is set (else the grey variant text token wins) |
|
|
35
35
|
| `shape` | `TagShape` | `TagShape.DEFAULT_SQUARE` (see note) | Controls size, border-radius, and status styling |
|
|
36
36
|
| `image` | `string` | — | `src` for an `<img>` rendered before content; only shown for `DEFAULT_ROUND`/`DEFAULT_SQUARE` shapes |
|
|
37
37
|
| `removable` | `boolean` | — | Shows remove button on hover; only functional for `DEFAULT_ROUND` and `DEFAULT_SQUARE` |
|
|
@@ -41,8 +41,8 @@ export { useDefaultTexts } from './hooks/useDefaultTexts';
|
|
|
41
41
|
| `prefixel` | `ReactNode` | — | Leading slot; strings/numbers get badge-style addonStyles wrapper, nodes get plain wrapper |
|
|
42
42
|
| `suffixel` | `ReactNode` | — | Trailing slot; hidden on remove-button hover; strings/numbers get addonStyles wrapper |
|
|
43
43
|
| `texts` | `Partial<TagTexts>` | — | Override any i18n string (see `TagTexts`) |
|
|
44
|
-
| `asPill` | `boolean` | — | Disables hover
|
|
45
|
-
| `dashed` | `boolean` | — |
|
|
44
|
+
| `asPill` | `boolean` | — | Disables the hover effect (cursor stays default) |
|
|
45
|
+
| `dashed` | `boolean` | — | **@deprecated** — no-op on `Tag` (no CSS rule; filtered from the DOM). The dashed-border status variant is applied by `ds-status`'s `styled(Tag)` wrapper, not `Tag`. |
|
|
46
46
|
| `tooltipProps` | `TooltipProps` | — | Wraps the entire rendered tag in `<Tooltip>` when provided |
|
|
47
47
|
| `className` | `string` | — | Appended to the `ds-tag` className on the root element |
|
|
48
48
|
| `ref` | `React.Ref<HTMLDivElement>` | — | Forwarded to the root `<div>` |
|
|
@@ -126,19 +126,20 @@ import Tag, { TagShape } from '@synerise/ds-tag';
|
|
|
126
126
|
## Styling
|
|
127
127
|
|
|
128
128
|
- Uses `styled-components` throughout; all styles are in `Tag.styles.ts`.
|
|
129
|
-
- Background is rendered via a `::before` pseudo-element (non-status shapes), with `filter: brightness()`
|
|
130
|
-
- `getColorText(
|
|
131
|
-
- When `asPill` is `true`, the hover
|
|
129
|
+
- Background is rendered via a `::before` pseudo-element (non-status shapes). On hover, a tag without `color` (grey variant, not a small pill shape) switches to `--ds-tag-variant-gray-bg-hover`; a tag with a custom `color` and the small pill shapes get `filter: brightness()` instead.
|
|
130
|
+
- `getColorText(color, textColor, theme?)` is exported from `Tag.styles` (stories deep-import it). No `color` → `--ds-tag-variant-gray-text`; `color` set → `textColor`, else `--ds-tag-variant-color-text`, except on a light-grey `color` (the grey-200 custom colour, or its hex via `theme`) → `--ds-color-text-base-muted`. The background pairs with it: `color`, else `--ds-tag-variant-gray-bg-default`.
|
|
131
|
+
- When `asPill` is `true`, the hover effect is suppressed and cursor stays `default`.
|
|
132
132
|
- Remove button is hidden via `display: none` by default and set to `display: inline-block` on `:hover` via the isActionable CSS block.
|
|
133
133
|
- Suffix is hidden (`display: none`) while the remove button is visible on hover.
|
|
134
|
-
-
|
|
134
|
+
- **`dashed` is deprecated and a no-op on `Tag`** — it has no CSS rule in `Tag.styles.ts` and is filtered from the DOM via `shouldForwardProp`. The dashed-border status variant is applied by `ds-status`'s `styled(Tag)` wrapper (`Status.styles.ts`), which reads its own `dashed` prop.
|
|
135
|
+
- **DOM prop leak guard** — `Tag`/`Content`/`PrefixWrapper`/`DefaultPrefixWrapper` use `.withConfig({ shouldForwardProp })` (denylist `dsProps`) so styling props (`shape`, `color`, `iconHover`, …) don't reach the DOM element.
|
|
135
136
|
|
|
136
137
|
## Key dependencies
|
|
137
138
|
|
|
138
139
|
- `@synerise/ds-icon` — close icon (`CloseS`) and custom prefix icons
|
|
139
140
|
- `@synerise/ds-tooltip` — delete tooltip on remove button and optional whole-tag tooltip
|
|
140
|
-
- `@synerise/ds-core` — `useTheme()` for
|
|
141
|
-
- `@synerise/ds-utils` — `WithHTMLAttributes` wrapper type
|
|
141
|
+
- `@synerise/ds-core` — `useTheme()` for the `zindex-tooltip` value (`theme.variables`), `ThemeProps` typing
|
|
142
|
+
- `@synerise/ds-utils` — `WithHTMLAttributes` wrapper type, `resolveCustomColor` for the light-grey text check
|
|
142
143
|
- `react-intl` — i18n for default texts (requires `IntlProvider` in the tree)
|
|
143
144
|
|
|
144
145
|
## Implementation notes
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ import Tag from '@synerise/ds-tag'
|
|
|
47
47
|
| suffixel | trailing slot content (hidden on remove hover) | ReactNode | - |
|
|
48
48
|
| texts | i18n overrides for internal labels | Partial<TagTexts> | - |
|
|
49
49
|
| asPill | disable hover brightness effect | boolean | - |
|
|
50
|
-
| dashed |
|
|
50
|
+
| dashed | **@deprecated** no-op on Tag; dashed border is applied by ds-status | boolean | - |
|
|
51
51
|
| tooltipProps | tooltip to show over entire tag. see ds-tooltip | TooltipProps | - |
|
|
52
52
|
|
|
53
53
|
## TagShape Enum
|
package/dist/Tag.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useTheme } from "@synerise/ds-core";
|
|
|
4
4
|
import Icon, { CloseS } from "@synerise/ds-icon";
|
|
5
5
|
import Tooltip from "@synerise/ds-tooltip";
|
|
6
6
|
import { useDefaultTexts } from "./hooks/useDefaultTexts.js";
|
|
7
|
-
import { Tag as Tag$1, Content, TagName, RemoveButton,
|
|
7
|
+
import { Tag as Tag$1, Content, TagName, RemoveButton, PrefixWrapper, DefaultPrefixWrapper, SuffixWrapper, DefaultSuffixWrapper } from "./Tag.styles.js";
|
|
8
8
|
import { TagShape } from "./Tag.types.js";
|
|
9
9
|
const Tag = forwardRef(({
|
|
10
10
|
id,
|
|
@@ -61,7 +61,7 @@ const Tag = forwardRef(({
|
|
|
61
61
|
!!prefixel && renderPrefixel(),
|
|
62
62
|
/* @__PURE__ */ jsx(TagName, { children: name }),
|
|
63
63
|
!!suffixel && renderSuffixel(),
|
|
64
|
-
isRemovable && /* @__PURE__ */ jsx(Tooltip, { title: allTexts.deleteTooltip, open: isIconHovered, zIndex: parseInt(theme.variables["
|
|
64
|
+
isRemovable && /* @__PURE__ */ jsx(Tooltip, { title: allTexts.deleteTooltip, open: isIconHovered, zIndex: parseInt(theme.variables["zindex-tooltip"], 10) + 1, children: /* @__PURE__ */ jsx(RemoveButton, { onClick: onRemoveCall, onMouseOver: handleMouseOver, onMouseLeave: handleMouseLeave, "data-testid": "remove-btn", children: /* @__PURE__ */ jsx(Icon, { className: "icon", component: /* @__PURE__ */ jsx(CloseS, {}), size: 24 }) }) })
|
|
65
65
|
] }) });
|
|
66
66
|
return tooltipProps ? /* @__PURE__ */ jsx(Tooltip, { ...tooltipProps, children: renderedTag }) : renderedTag;
|
|
67
67
|
});
|
package/dist/Tag.styles.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ThemeProps
|
|
1
|
+
import { ThemeProps } from '@synerise/ds-core';
|
|
2
2
|
import { TagShape } from './Tag.types';
|
|
3
|
-
export declare const getColorText: (
|
|
3
|
+
export declare const getColorText: (color?: string, textColor?: string, theme?: ThemeProps["theme"]) => string;
|
|
4
4
|
export declare const TagName: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
5
5
|
export declare const RemoveButton: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
6
6
|
type TagProps = {
|
package/dist/Tag.styles.js
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
+
import { resolveCustomColor } from "@synerise/ds-utils";
|
|
2
3
|
import { TagShape } from "./Tag.types.js";
|
|
4
|
+
const dsProps = /* @__PURE__ */ new Set(["isStatusShape", "shape", "color", "textColor", "removable", "disabled", "isActionable", "suffixel", "preffixel", "hasImage", "iconHover", "asPill", "dashed"]);
|
|
3
5
|
const defaultStatusStyles = /* @__PURE__ */ css(["border-radius:9px;font-size:10px;height:18px;font-weight:500;line-height:18px;text-transform:uppercase;letter-spacing:0.1px;padding:0 8px;line-height:18px;"]);
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
+
const LIGHT_GREY = resolveCustomColor("grey-200");
|
|
7
|
+
const isLightGrey = (color, theme) => !!color && (color === LIGHT_GREY || color === theme?.tokens["--ds-color-grey-200"]);
|
|
8
|
+
const getColorText = (color, textColor, theme) => {
|
|
9
|
+
if (!color) {
|
|
10
|
+
return "var(--ds-tag-variant-gray-text)";
|
|
11
|
+
}
|
|
12
|
+
if (textColor) {
|
|
13
|
+
return textColor;
|
|
14
|
+
}
|
|
15
|
+
return isLightGrey(color, theme) ? "var(--ds-color-text-base-muted)" : "var(--ds-tag-variant-color-text)";
|
|
6
16
|
};
|
|
7
17
|
const getWidthOnHover = (props) => {
|
|
8
18
|
if (props.suffixel && props.preffixel || props.hasImage) {
|
|
@@ -17,23 +27,22 @@ const getWidthOnHover = (props) => {
|
|
|
17
27
|
return "calc(100% - 10px)";
|
|
18
28
|
};
|
|
19
29
|
const getFilterColor = (props) => {
|
|
20
|
-
if (props.iconHover
|
|
30
|
+
if (props.iconHover) {
|
|
21
31
|
return "brightness(100%)";
|
|
22
32
|
}
|
|
23
|
-
if (props.color
|
|
33
|
+
if (isLightGrey(props.color, props.theme)) {
|
|
24
34
|
return "brightness(90%)";
|
|
25
35
|
}
|
|
26
|
-
if (props.iconHover) {
|
|
27
|
-
return "brightness(100%)";
|
|
28
|
-
}
|
|
29
36
|
return "brightness(110%)";
|
|
30
37
|
};
|
|
31
|
-
const
|
|
38
|
+
const usesGrayVariant = (props) => !props.color && props.shape !== TagShape.SMALL_SQUARE && props.shape !== TagShape.SMALL_ROUND;
|
|
39
|
+
const getHoverStyles = (props) => usesGrayVariant(props) ? "background-color: var(--ds-tag-variant-gray-bg-hover);" : `filter: ${getFilterColor(props)};`;
|
|
40
|
+
const addonStyles = () => `
|
|
32
41
|
border: 1px solid;
|
|
33
42
|
border-radius: 10px;
|
|
34
43
|
height: 50%;
|
|
35
44
|
padding: 0 3px;
|
|
36
|
-
border-color:
|
|
45
|
+
border-color: var(--ds-color-background-base-default);
|
|
37
46
|
font-size: 9px;
|
|
38
47
|
line-height: 10px;
|
|
39
48
|
text-align: center;
|
|
@@ -45,82 +54,87 @@ const TagName = /* @__PURE__ */ styled.span.withConfig({
|
|
|
45
54
|
const RemoveButton = /* @__PURE__ */ styled.div.withConfig({
|
|
46
55
|
displayName: "Tagstyles__RemoveButton",
|
|
47
56
|
componentId: "sc-1xw3den-1"
|
|
48
|
-
})(["color:
|
|
49
|
-
color,
|
|
50
|
-
theme
|
|
51
|
-
}) => getColorText(theme, color), (props) => props.color || props.theme.palette["red-600"], (props) => props.theme.palette["red-600"]);
|
|
57
|
+
})(["color:inherit;height:18px;width:18px;border-radius:10px;padding:0;border:none;outline:none;margin:3px 3px 3px 5px;text-align:center;cursor:pointer;position:relative;overflow:hidden;display:none;opacity:var(--ds-tag-remove-opacity);&&&:hover{.ds-icon{color:var(--ds-tag-remove-icon);}}.icon{&&{transform:translate(1px,-3px);}}"]);
|
|
52
58
|
const insertShapeStyles = (props) => {
|
|
53
59
|
switch (props.shape) {
|
|
54
60
|
case TagShape.SMALL_SQUARE:
|
|
55
|
-
return css(["color:", ";border-radius:3px;font-size:10px;height:14px;line-height:14px;text-transform:uppercase;font-weight:500;letter-spacing:0.1px;padding:0 4px;"], props.textColor || "
|
|
61
|
+
return css(["color:", ";border-radius:3px;font-size:10px;height:14px;line-height:14px;text-transform:uppercase;font-weight:500;letter-spacing:0.1px;padding:0 4px;"], props.textColor || "var(--ds-tag-pill-text)");
|
|
56
62
|
case TagShape.SMALL_ROUND:
|
|
57
|
-
return css(["color:", ";border-radius:8px;font-size:10px;height:14px;line-height:14px;text-transform:uppercase;letter-spacing:0.1px;padding:0 4px;"], props.textColor || "
|
|
63
|
+
return css(["color:", ";border-radius:8px;font-size:10px;height:14px;line-height:14px;text-transform:uppercase;letter-spacing:0.1px;padding:0 4px;"], props.textColor || "var(--ds-tag-pill-text)");
|
|
58
64
|
case TagShape.MEDIUM_ROUND:
|
|
59
|
-
return css(["color:", ";", ""], props.
|
|
65
|
+
return css(["color:", ";", ""], getColorText(props.color, props.textColor, props.theme), defaultStatusStyles);
|
|
60
66
|
case TagShape.DEFAULT_ROUND:
|
|
61
|
-
return css(["color:", ";border-radius:12px;font-size:13px;height:24px;line-height:24px;padding:", ";", "{padding:", ";padding-left:", ";padding-right:", ";}", ""], props.
|
|
67
|
+
return css(["color:", ";border-radius:12px;font-size:13px;height:24px;line-height:24px;padding:", ";", "{padding:", ";padding-left:", ";padding-right:", ";}", ""], getColorText(props.color, props.textColor, props.theme), props.removable ? "0" : "0 12px", TagName, props.removable ? "0 12px" : "0", props.removable && props.preffixel && "4px", props.removable && props.suffixel && "4px", props.isActionable && css(["&:hover{padding:", ";", "{display:inline-block;padding:", ";padding-left:", ";padding-right:", ";width:", ";}padding-right:", ";", "{margin-left:0px;margin-right:", ";.icon{position:absolute;left:-3px;top:-3px;}}}"], props.removable && props.suffixel && "0 15px 0 0px", TagName, props.removable ? "0 7px 0 12px" : "0", props.removable && props.preffixel && "4px", props.removable && props.suffixel && "10px", getWidthOnHover(props), !props.suffixel && "5px", RemoveButton, props.suffixel ? "2px" : "-2px"));
|
|
62
68
|
case TagShape.DEFAULT_SQUARE:
|
|
63
|
-
return css(["color:", ";border-radius:3px;font-size:13px;height:24px;line-height:24px;padding:", ";", "{padding:", ";padding-left:", ";padding-right:", ";}", ""], props.
|
|
69
|
+
return css(["color:", ";border-radius:3px;font-size:13px;height:24px;line-height:24px;padding:", ";", "{padding:", ";padding-left:", ";padding-right:", ";}", ""], getColorText(props.color, props.textColor, props.theme), props.removable ? "0" : "0 12px", TagName, props.removable ? "0 12px" : "0", props.removable && props.preffixel && "4px", props.removable && props.suffixel && "4px", props.isActionable && css(["&:hover{padding-right:", ";", "{display:inline-block;padding:", ";padding-left:", ";padding-right:", ";width:", ";}padding-right:", ";", "{margin-left:0px;margin-right:", ";.icon{position:absolute;left:-3px;top:-3px;}}}"], props.removable && props.suffixel && "15px", TagName, props.removable ? "0 7px 0 12px" : "0", props.removable && props.preffixel && "4px", props.removable && props.suffixel && "10px", getWidthOnHover(props), !props.suffixel && "5px", RemoveButton, props.suffixel ? "2px" : "-2px"));
|
|
64
70
|
case TagShape.SINGLE_CHARACTER_ROUND:
|
|
65
|
-
return css(["color:", ";border-radius:12px;font-size:13px;height:24px;width:24px;line-height:24px;justify-content:center;"], props.
|
|
71
|
+
return css(["color:", ";border-radius:12px;font-size:13px;height:24px;width:24px;line-height:24px;justify-content:center;"], getColorText(props.color, props.textColor, props.theme));
|
|
66
72
|
case TagShape.SINGLE_CHARACTER_SQUARE:
|
|
67
|
-
return css(["color:", ";border-radius:3px;font-size:13px;height:24px;width:24px;line-height:24px;justify-content:center;"], props.
|
|
73
|
+
return css(["color:", ";border-radius:3px;font-size:13px;height:24px;width:24px;line-height:24px;justify-content:center;"], getColorText(props.color, props.textColor, props.theme));
|
|
68
74
|
case TagShape.STATUS_NEUTRAL:
|
|
69
|
-
return css(["border:1px solid ", ";color:", ";", ""], props.color ||
|
|
75
|
+
return css(["border:1px solid ", ";color:", ";", ""], props.color || "var(--ds-status-pill-variant-neutral-border-solid)", props.textColor || props.color || "var(--ds-status-pill-variant-neutral-text)", defaultStatusStyles);
|
|
70
76
|
case TagShape.STATUS_SUCCESS:
|
|
71
|
-
return css(["border:1px solid
|
|
77
|
+
return css(["border:1px solid var(--ds-status-pill-variant-success-border-solid);color:var(--ds-status-pill-variant-success-text);", ""], defaultStatusStyles);
|
|
72
78
|
case TagShape.STATUS_ERROR:
|
|
73
|
-
return css(["border:1px solid
|
|
79
|
+
return css(["border:1px solid var(--ds-status-pill-variant-error-border-solid);color:var(--ds-status-pill-variant-error-text);", ""], defaultStatusStyles);
|
|
74
80
|
case TagShape.STATUS_WARNING:
|
|
75
|
-
return css(["border:1px solid
|
|
81
|
+
return css(["border:1px solid var(--ds-status-pill-variant-warning-border-solid);color:var(--ds-status-pill-variant-warning-text);", ""], defaultStatusStyles);
|
|
76
82
|
default:
|
|
77
83
|
return css([""]);
|
|
78
84
|
}
|
|
79
85
|
};
|
|
80
86
|
const Content = /* @__PURE__ */ styled.div.withConfig({
|
|
87
|
+
shouldForwardProp: (prop) => !dsProps.has(prop)
|
|
88
|
+
}).withConfig({
|
|
81
89
|
displayName: "Tagstyles__Content",
|
|
82
90
|
componentId: "sc-1xw3den-2"
|
|
83
91
|
})(["position:relative;display:flex;align-items:center;flex-grow:0;flex-shrink:1;max-width:100%;", ""], (props) => !!props.iconHover && `
|
|
84
92
|
&&& {
|
|
85
|
-
color
|
|
93
|
+
color: var(--ds-color-text-danger-default);
|
|
86
94
|
}
|
|
87
95
|
`);
|
|
88
96
|
const PrefixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
97
|
+
shouldForwardProp: (prop) => !dsProps.has(prop)
|
|
98
|
+
}).withConfig({
|
|
89
99
|
displayName: "Tagstyles__PrefixWrapper",
|
|
90
100
|
componentId: "sc-1xw3den-3"
|
|
91
|
-
})(["", ";", ""],
|
|
92
|
-
color:
|
|
93
|
-
box-shadow: 0 0 0 1px
|
|
101
|
+
})(["", ";", ""], addonStyles(), (props) => !!props.iconHover && `.ds-badge-scroll-number{
|
|
102
|
+
color: var(--ds-color-text-danger-default)!important;
|
|
103
|
+
box-shadow: 0 0 0 1px var(--ds-color-border-danger-default)!important;
|
|
94
104
|
}
|
|
95
|
-
.ds-icon
|
|
96
|
-
|
|
105
|
+
.ds-icon {
|
|
106
|
+
color: var(--ds-color-icon-danger-default);
|
|
97
107
|
}`);
|
|
98
108
|
const SuffixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
99
109
|
displayName: "Tagstyles__SuffixWrapper",
|
|
100
110
|
componentId: "sc-1xw3den-4"
|
|
101
|
-
})(["", ";"],
|
|
111
|
+
})(["", ";"], addonStyles());
|
|
102
112
|
const DefaultSuffixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
103
113
|
displayName: "Tagstyles__DefaultSuffixWrapper",
|
|
104
114
|
componentId: "sc-1xw3den-5"
|
|
105
115
|
})([""]);
|
|
106
116
|
const DefaultPrefixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
117
|
+
shouldForwardProp: (prop) => !dsProps.has(prop)
|
|
118
|
+
}).withConfig({
|
|
107
119
|
displayName: "Tagstyles__DefaultPrefixWrapper",
|
|
108
120
|
componentId: "sc-1xw3den-6"
|
|
109
121
|
})(["", ""], (props) => !!props.iconHover && `.ds-badge-scroll-number{
|
|
110
|
-
color:
|
|
111
|
-
box-shadow: 0 0 0 1px
|
|
122
|
+
color: var(--ds-color-text-danger-default)!important;
|
|
123
|
+
box-shadow: 0 0 0 1px var(--ds-color-border-danger-default)!important;
|
|
112
124
|
}
|
|
113
|
-
.ds-icon
|
|
114
|
-
|
|
125
|
+
.ds-icon {
|
|
126
|
+
color: var(--ds-color-icon-danger-default);
|
|
115
127
|
}`);
|
|
116
128
|
const Tag = /* @__PURE__ */ styled.div.withConfig({
|
|
129
|
+
shouldForwardProp: (prop) => !dsProps.has(prop)
|
|
130
|
+
}).withConfig({
|
|
117
131
|
displayName: "Tagstyles__Tag",
|
|
118
132
|
componentId: "sc-1xw3den-7"
|
|
119
|
-
})(["position:relative;margin:4px;display:inline-flex;font-weight:500;overflow:hidden;cursor:default;", " ", ";", " ", " ", " .icon1{margin:0 -2px 0 1px;}", ";", ",", "{margin:", ";}", ",", "{margin:", ";}"], (props) => !props.asPill && css(["cursor:pointer;&:hover:before{
|
|
133
|
+
})(["position:relative;margin:4px;display:inline-flex;font-weight:500;overflow:hidden;cursor:default;", " ", ";", " ", " ", " .icon1{margin:0 -2px 0 1px;}", ";", ",", "{margin:", ";}", ",", "{margin:", ";}"], (props) => !props.asPill && css(["cursor:pointer;&:hover:before{", "}"], getHoverStyles), (props) => insertShapeStyles(props), (props) => !!props.iconHover && `
|
|
120
134
|
&&&:before{
|
|
121
|
-
background-color
|
|
135
|
+
background-color: var(--ds-color-background-danger-subtle);
|
|
122
136
|
}
|
|
123
|
-
`, (props) => !!props.disabled && css(["opacity:
|
|
137
|
+
`, (props) => !!props.disabled && css(["opacity:var(--ds-tag-disabled-opacity);cursor:not-allowed;"]), (props) => !props.isStatusShape && css(["&:before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:", ";}", ";"], props.color || (props.shape === TagShape.SMALL_SQUARE || props.shape === TagShape.SMALL_ROUND ? "var(--ds-tag-pill-bg-gray)" : "var(--ds-tag-variant-gray-bg-default)"), props.isActionable && css(["&:hover:before{", "}"], getHoverStyles)), (props) => !!props.isActionable && css(["&:hover{", ",", "{display:none;}", "{position:absolute;top:0;right:", ";display:inline-block;}}"], SuffixWrapper, DefaultSuffixWrapper, RemoveButton, props.removable && props.suffixel ? "-15px" : "0"), SuffixWrapper, DefaultSuffixWrapper, (props) => !props.removable && props.suffixel ? "0px -8px 3px 5px" : "0 4px 3px 1px", PrefixWrapper, DefaultPrefixWrapper, (props) => !props.removable && props.preffixel ? "0px 5px 3px -8px" : "0 1px 3px 4px");
|
|
124
138
|
const DeleteButton = /* @__PURE__ */ styled.div.withConfig({
|
|
125
139
|
displayName: "Tagstyles__DeleteButton",
|
|
126
140
|
componentId: "sc-1xw3den-8"
|
package/dist/Tag.types.d.ts
CHANGED
|
@@ -27,6 +27,11 @@ export type TagProps = WithHTMLAttributes<HTMLDivElement, {
|
|
|
27
27
|
suffixel?: ReactNode;
|
|
28
28
|
texts?: TagTexts;
|
|
29
29
|
asPill?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated No-op on `Tag` — it has no CSS rule and is filtered from the DOM.
|
|
32
|
+
* The dashed-border status variant is applied by `ds-status`'s `styled(Tag)` wrapper,
|
|
33
|
+
* not by `Tag` itself. Kept only for backward compatibility.
|
|
34
|
+
*/
|
|
30
35
|
dashed?: boolean;
|
|
31
36
|
tooltipProps?: TooltipProps;
|
|
32
37
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-tag",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Tag UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
],
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@synerise/ds-icon": "^2.
|
|
46
|
-
"@synerise/ds-tooltip": "^2.0
|
|
47
|
-
"@synerise/ds-utils": "^2.
|
|
45
|
+
"@synerise/ds-icon": "^2.3.0",
|
|
46
|
+
"@synerise/ds-tooltip": "^2.1.0",
|
|
47
|
+
"@synerise/ds-utils": "^2.3.0",
|
|
48
48
|
"react-intl": "^6.8.7"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"react": ">=16.9.0 <= 18.3.1",
|
|
56
56
|
"styled-components": "^5.3.3"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "5c3d61e30289486d14c7d6becb682e2d4a08ce41"
|
|
59
59
|
}
|