@synerise/ds-typography 1.1.25 → 1.1.27
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 +8 -0
- package/CLAUDE.md +199 -0
- package/dist/CommonElements.js +10 -10
- package/dist/Ellipsis.d.ts +3 -2
- package/dist/Ellipsis.js +3 -2
- package/dist/Paragraph.d.ts +6 -3
- package/dist/Paragraph.js +6 -2
- package/dist/Text.d.ts +5 -2
- package/dist/Text.js +12 -6
- package/dist/Title.d.ts +1 -1
- package/dist/Title.js +2 -2
- package/dist/Title.types.d.ts +3 -2
- package/dist/Typography.d.ts +24 -1
- package/dist/Typography.js +8 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/package.json +5 -4
- package/dist/assets/style/index-tn0RQdqM.css +0 -0
- package/dist/style/index.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [1.1.27](https://github.com/synerise/synerise-design/compare/@synerise/ds-typography@1.1.26...@synerise/ds-typography@1.1.27) (2026-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-typography
|
|
9
|
+
|
|
10
|
+
## [1.1.26](https://github.com/synerise/synerise-design/compare/@synerise/ds-typography@1.1.25...@synerise/ds-typography@1.1.26) (2026-06-17)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-typography
|
|
13
|
+
|
|
6
14
|
## [1.1.25](https://github.com/synerise/synerise-design/compare/@synerise/ds-typography@1.1.24...@synerise/ds-typography@1.1.25) (2026-06-11)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-typography
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Typography (`@synerise/ds-typography`)
|
|
2
|
+
|
|
3
|
+
> Collection of typography primitives: a custom `Title` (h1–h7), `Text` and `Paragraph` size variants, form-label helpers (`Description`, `ErrorText`, `Label`), an `Ellipsis` wrapper, and a `macro` namespace of reusable styled-components CSS snippets.
|
|
4
|
+
|
|
5
|
+
## Package structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
Title.tsx — DS Title component (h1–h7 levels, ellipsis support)
|
|
10
|
+
Title.types.ts — Title Props interface
|
|
11
|
+
Text.tsx — DS Text component (medium/small/xsmall spans) + Ellipsis
|
|
12
|
+
Paragraph.tsx — DS Paragraph component (medium/small/xsmall spans)
|
|
13
|
+
Ellipsis.tsx — Overflow-detection wrapper that shows a tooltip when truncated
|
|
14
|
+
CommonElements.ts — All styled-component primitives (H1–H7, Text variants, Description, ErrorText, Label, EllipsisText)
|
|
15
|
+
Typography.ts — DS-composed default export: `{ Title, Text, Paragraph }` (antd-free)
|
|
16
|
+
index.ts — Public exports
|
|
17
|
+
style/
|
|
18
|
+
macro-utils.ts — CSS snippet exports for use in consumer styled-components
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Public exports
|
|
22
|
+
|
|
23
|
+
### `default` (DS-composed `Typography` namespace)
|
|
24
|
+
|
|
25
|
+
A plain object `{ Title, Text, Paragraph }` whose members are the **DS-implemented** components below
|
|
26
|
+
(not antd). It exists so existing `import Typography from '@synerise/ds-typography'` +
|
|
27
|
+
`<Typography.Title>` / `<Typography.Text>` / `<Typography.Paragraph>` call sites keep working without
|
|
28
|
+
antd. antd-only members (`Typography.Link`, `copyable`, `editable`, `code`, `ellipsis`) are **dropped** —
|
|
29
|
+
a repo-wide audit (portal-ui-bridge, portal-next, universal-list) found zero usages.
|
|
30
|
+
|
|
31
|
+
### `Title`
|
|
32
|
+
|
|
33
|
+
DS-customised heading. Renders `<h1>`–`<h6>` elements (level 7 renders as `<h6>`). Accepts standard
|
|
34
|
+
heading HTML attributes (`HTMLAttributes<HTMLHeadingElement>`) plus the props below.
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Default | Description |
|
|
37
|
+
|------|------|---------|-------------|
|
|
38
|
+
| `level` | `1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7` | `1` | Heading level. Maps to DS type scale (h700–h100). Level 7 renders as `<h6>`. |
|
|
39
|
+
| `withoutMargin` | `boolean` | `undefined` | Removes the default `margin-bottom` (`0.5em`) from the heading element. |
|
|
40
|
+
| `ellipsis` | `EllipsisProps` | `undefined` | When provided, wraps the title in an `Ellipsis` component. |
|
|
41
|
+
| `className` | `string` | `undefined` | Merged with `'ds-title'`. |
|
|
42
|
+
| `data-*` | `string` | — | Any `data-*` attribute is forwarded onto the heading element (typed via `DataAttributes`). |
|
|
43
|
+
| `...rest` | `HTMLAttributes<HTMLHeadingElement>` | — | All remaining heading attributes pass through (e.g. `style`, `id`). |
|
|
44
|
+
|
|
45
|
+
Type scale mapping:
|
|
46
|
+
|
|
47
|
+
| level | macro | font-size |
|
|
48
|
+
|-------|-------|-----------|
|
|
49
|
+
| 1 | h700 | 24px |
|
|
50
|
+
| 2 | h600 | 21px |
|
|
51
|
+
| 3 | h500 | 18px |
|
|
52
|
+
| 4 | h400 | 16px |
|
|
53
|
+
| 5 | h300 | 14px |
|
|
54
|
+
| 6 | h200 | 13px |
|
|
55
|
+
| 7 | h100 | 10px |
|
|
56
|
+
|
|
57
|
+
### `Text`
|
|
58
|
+
|
|
59
|
+
Inline text span in three sizes. Renders a styled `<span>`.
|
|
60
|
+
|
|
61
|
+
| Prop | Type | Default | Description |
|
|
62
|
+
|------|------|---------|-------------|
|
|
63
|
+
| `size` | `'medium' \| 'small' \| 'xsmall'` | `'medium'` | Font size variant (14px / 13px / 11px). |
|
|
64
|
+
| `ellipsis` | `EllipsisProps` | `undefined` | When provided, wraps content in `Ellipsis`. |
|
|
65
|
+
| `className` | `string` | `undefined` | Applied to the `Ellipsis` wrapper when `ellipsis` is set; otherwise appended to the span (`'ds-text'`). |
|
|
66
|
+
| `style` | `CSSProperties` | `undefined` | Applied to the `Ellipsis` wrapper when `ellipsis` is set; otherwise applied to the span. |
|
|
67
|
+
| `data-*` | `string` | — | Forwarded onto the outer element — the `Ellipsis` wrapper when `ellipsis` is set, otherwise the span (typed via `DataAttributes`). |
|
|
68
|
+
| `children` | `ReactNode` | — | |
|
|
69
|
+
|
|
70
|
+
> When `ellipsis` is set, `style` / `className` / `data-*` are applied to the outer `Ellipsis`
|
|
71
|
+
> wrapper (so e.g. `style={{ maxWidth }}` still constrains the truncation box) — colocated with where
|
|
72
|
+
> truncation is measured.
|
|
73
|
+
|
|
74
|
+
### `TextSize`
|
|
75
|
+
|
|
76
|
+
Type alias exported from `Text.tsx`: `'medium' | 'small' | 'xsmall'`.
|
|
77
|
+
|
|
78
|
+
### `Paragraph`
|
|
79
|
+
|
|
80
|
+
Block text element in three sizes. Renders a styled `<span>` with class `ds-paragraph`.
|
|
81
|
+
|
|
82
|
+
| Prop | Type | Default | Description |
|
|
83
|
+
|------|------|---------|-------------|
|
|
84
|
+
| `size` | `'medium' \| 'small' \| 'xsmall'` | `'medium'` | Font size variant. |
|
|
85
|
+
| `className` | `string` | `undefined` | Merged with `'ds-paragraph'`. |
|
|
86
|
+
| `style` | `CSSProperties` | `undefined` | Applied to the paragraph span. |
|
|
87
|
+
| `data-*` | `string` | — | Any `data-*` attribute is forwarded onto the paragraph span (typed via `DataAttributes`). |
|
|
88
|
+
| `children` | `ReactNode` | — | |
|
|
89
|
+
|
|
90
|
+
> Note: `Paragraph` supports `className` / `style` / `data-*` but (unlike `Text`) has no `ellipsis` prop.
|
|
91
|
+
|
|
92
|
+
### `Ellipsis`
|
|
93
|
+
|
|
94
|
+
Overflow-detection wrapper that conditionally shows a tooltip when text is truncated.
|
|
95
|
+
|
|
96
|
+
| Prop | Type | Default | Description |
|
|
97
|
+
|------|------|---------|-------------|
|
|
98
|
+
| `tooltip` | `ReactNode` | `undefined` | Tooltip content — only shown when text is actually truncated. |
|
|
99
|
+
| `tooltipProps` | `TooltipProps` | `undefined` | Extra props forwarded to `@synerise/ds-tooltip` — only applied when truncated. |
|
|
100
|
+
| `className` | `string` | `undefined` | Applied to the outer `EllipsisText` div. |
|
|
101
|
+
| `style` | `CSSProperties` | `undefined` | Applied to the outer `EllipsisText` div. |
|
|
102
|
+
| `data-*` | `string` | — | Any `data-*` attribute is forwarded onto the outer `EllipsisText` div (typed via `DataAttributes`). |
|
|
103
|
+
| `children` | `ReactNode` | — | |
|
|
104
|
+
|
|
105
|
+
### `EllipsisProps`
|
|
106
|
+
|
|
107
|
+
Type exported from `Ellipsis.tsx` (re-exported via `export * from './Text'`).
|
|
108
|
+
|
|
109
|
+
### `Description`
|
|
110
|
+
|
|
111
|
+
Styled `<div>` for secondary/help text. Props: `disabled?: boolean` (reduces opacity to 0.4). Color: `grey-600`.
|
|
112
|
+
|
|
113
|
+
### `ErrorText`
|
|
114
|
+
|
|
115
|
+
Styled `<div>` for field error messages. Color: `red-600`, bottom margin 4px. No custom props.
|
|
116
|
+
|
|
117
|
+
### `Label`
|
|
118
|
+
|
|
119
|
+
Styled `<label>` for form field labels. Color: `grey-800`, font-weight 500, `display: block`, `cursor: pointer`. No custom props.
|
|
120
|
+
|
|
121
|
+
### `macro`
|
|
122
|
+
|
|
123
|
+
Namespace of reusable styled-components CSS snippets for typography styling in consumer components:
|
|
124
|
+
|
|
125
|
+
| Export | Description |
|
|
126
|
+
|--------|-------------|
|
|
127
|
+
| `h700`–`h100` | Heading scales (font-size, line-height, letter-spacing, grey-800 color) |
|
|
128
|
+
| `medium`, `small`, `xsmall` | Body text scales |
|
|
129
|
+
| `link` | Blue-600 link style with hover |
|
|
130
|
+
| `linkbutton` | Grey link variant |
|
|
131
|
+
| `heading`, `regular` | Base weight/color mixins used by heading/body macros |
|
|
132
|
+
| `tag`, `tooltip`, `xsAvatar`, `xlAvatar`, `xlAvatarIcon` | Specific UI element sizes |
|
|
133
|
+
| `flexCentered` | Flex centering utility |
|
|
134
|
+
|
|
135
|
+
## Usage patterns
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
import Typography, { Title, Text, Paragraph, Description, ErrorText, Label, macro } from '@synerise/ds-typography';
|
|
139
|
+
|
|
140
|
+
// DS Title (h1–h7)
|
|
141
|
+
<Title level={4} withoutMargin>Section heading</Title>
|
|
142
|
+
|
|
143
|
+
// DS Title with overflow tooltip
|
|
144
|
+
<Title level={3} ellipsis={{ tooltip: 'Full title text' }}>Long title that may truncate</Title>
|
|
145
|
+
|
|
146
|
+
// DS Text
|
|
147
|
+
<Text size="small">Helper text</Text>
|
|
148
|
+
|
|
149
|
+
// DS Text with ellipsis
|
|
150
|
+
<Text size="medium" ellipsis={{ tooltip: 'Full content' }} style={{ maxWidth: 200 }}>
|
|
151
|
+
Long inline text
|
|
152
|
+
</Text>
|
|
153
|
+
|
|
154
|
+
// DS Paragraph
|
|
155
|
+
<Paragraph size="medium">Body copy</Paragraph>
|
|
156
|
+
|
|
157
|
+
// Form helpers
|
|
158
|
+
<Label htmlFor="field">Field name</Label>
|
|
159
|
+
<Description>Secondary info</Description>
|
|
160
|
+
<Description disabled>Disabled info</Description>
|
|
161
|
+
<ErrorText>Validation error</ErrorText>
|
|
162
|
+
|
|
163
|
+
// Default export namespace — DS Title/Text/Paragraph (antd-free)
|
|
164
|
+
import Typography from '@synerise/ds-typography';
|
|
165
|
+
<Typography.Title level={4}>Heading</Typography.Title>
|
|
166
|
+
<Typography.Text strong>Bold</Typography.Text>
|
|
167
|
+
|
|
168
|
+
// macro — for use inside styled-components definitions
|
|
169
|
+
import styled from 'styled-components';
|
|
170
|
+
import { macro } from '@synerise/ds-typography';
|
|
171
|
+
|
|
172
|
+
const MyHeading = styled.div`
|
|
173
|
+
${macro.h400};
|
|
174
|
+
`;
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Styling
|
|
178
|
+
|
|
179
|
+
All styled primitives live in `CommonElements.ts`. Typography tokens come from `macro-utils.ts` (hardcoded scale values using `theme.palette` for colour). No variant prop on styled elements — size is selected by mapping to a different component.
|
|
180
|
+
|
|
181
|
+
`EllipsisText` sets `overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%` on a `<div>`, and makes inner heading/text elements `display: inline` or inherit parent styles.
|
|
182
|
+
|
|
183
|
+
## Key dependencies
|
|
184
|
+
|
|
185
|
+
- `@synerise/ds-tooltip` — used by `Ellipsis` to show the overflow tooltip (regular dependency, not peer)
|
|
186
|
+
- `lodash.debounce` — debounces the `ResizeObserver` callback in `Ellipsis` (100ms, leading + trailing)
|
|
187
|
+
- `classnames` — used in `Title`/`Text` to merge `'ds-title'`/`'ds-text'` with consumer `className`
|
|
188
|
+
- **No antd** — the package is antd-free. The default export is a DS-composed `{ Title, Text, Paragraph }`.
|
|
189
|
+
|
|
190
|
+
## Implementation notes
|
|
191
|
+
|
|
192
|
+
- **Default export is DS, not antd** — `import Typography from '@synerise/ds-typography'` now gives a DS-composed `{ Title, Text, Paragraph }` namespace (the same DS components as the named exports). antd-only members (`Link`, `copyable`, `editable`, `code`, antd `ellipsis`) were dropped after a repo-wide audit found zero usages.
|
|
193
|
+
- **`Text` `strong`** — `strong` renders the span at `font-weight: 500`. When `ellipsis` is unset, `style` / `className` / `data-*` are applied to the rendered span. When `ellipsis` is set, they are applied to the outer `Ellipsis` wrapper (the `EllipsisText` div that measures truncation), so `style={{ maxWidth }}` keeps constraining the truncation box.
|
|
194
|
+
- **`data-*` forwarding** — `Title`, `Text`, `Paragraph` and `Ellipsis` accept arbitrary `data-*` attributes (typed via the shared `DataAttributes` from `@synerise/ds-utils`) and forward them onto their outer element. For `Title` the heading carries `style`/`data-*` (via `...rest`); for `Text`/`Paragraph` the rendered span, or the `Ellipsis` wrapper when `ellipsis` is set.
|
|
195
|
+
- **`Title` default margin** — headings have `margin-bottom: 0.5em` by default (own styled-component value, no longer reliant on antd's global reset); `withoutMargin` sets it to `0`.
|
|
196
|
+
- **`Title` level 7 renders as `<h6>`** — there is no `<h7>` in HTML. `H7` in `CommonElements.ts` is `styled.h6`. Intentional for the h100 scale.
|
|
197
|
+
- **`Paragraph`** — renders block-level styled spans (`display: block`) in medium/small/xsmall; no `className`/`style`/`ellipsis` support (unlike `Text`).
|
|
198
|
+
- **`Ellipsis` uses `ResizeObserver`** — observes both the text element and `document.body` to detect layout changes. Cleans up observer and debounce on unmount.
|
|
199
|
+
- **Uses Vitest** — `"test": "vitest run"`.
|
package/dist/CommonElements.js
CHANGED
|
@@ -27,43 +27,43 @@ const XSmallText = /* @__PURE__ */ styled.span.withConfig({
|
|
|
27
27
|
const MediumParagraph = /* @__PURE__ */ styled.span.withConfig({
|
|
28
28
|
displayName: "CommonElements__MediumParagraph",
|
|
29
29
|
componentId: "sc-102d2aw-6"
|
|
30
|
-
})(["", ""], () => css(["", ";"], medium));
|
|
30
|
+
})(["display:block;", ""], () => css(["", ";"], medium));
|
|
31
31
|
const SmallParagraph = /* @__PURE__ */ styled.span.withConfig({
|
|
32
32
|
displayName: "CommonElements__SmallParagraph",
|
|
33
33
|
componentId: "sc-102d2aw-7"
|
|
34
|
-
})(["", ""], () => css(["", ";"], small));
|
|
34
|
+
})(["display:block;", ""], () => css(["", ";"], small));
|
|
35
35
|
const XSmallParagraph = /* @__PURE__ */ styled.span.withConfig({
|
|
36
36
|
displayName: "CommonElements__XSmallParagraph",
|
|
37
37
|
componentId: "sc-102d2aw-8"
|
|
38
|
-
})(["", ""], () => css(["", ";"], xsmall));
|
|
38
|
+
})(["display:block;", ""], () => css(["", ";"], xsmall));
|
|
39
39
|
const H1 = /* @__PURE__ */ styled.h1.withConfig({
|
|
40
40
|
displayName: "CommonElements__H1",
|
|
41
41
|
componentId: "sc-102d2aw-9"
|
|
42
|
-
})(["", " ", ""], () => css(["", ";"], h700), (props) => props.withoutMargin
|
|
42
|
+
})(["", " margin-bottom:", ";"], () => css(["", ";"], h700), (props) => props.withoutMargin ? "0" : "0.5em");
|
|
43
43
|
const H2 = /* @__PURE__ */ styled.h2.withConfig({
|
|
44
44
|
displayName: "CommonElements__H2",
|
|
45
45
|
componentId: "sc-102d2aw-10"
|
|
46
|
-
})(["", " ", ""], () => css(["", ";"], h600), (props) => props.withoutMargin
|
|
46
|
+
})(["", " margin-bottom:", ";"], () => css(["", ";"], h600), (props) => props.withoutMargin ? "0" : "0.5em");
|
|
47
47
|
const H3 = /* @__PURE__ */ styled.h3.withConfig({
|
|
48
48
|
displayName: "CommonElements__H3",
|
|
49
49
|
componentId: "sc-102d2aw-11"
|
|
50
|
-
})(["", " ", ""], () => css(["", ";"], h500), (props) => props.withoutMargin
|
|
50
|
+
})(["", " margin-bottom:", ";"], () => css(["", ";"], h500), (props) => props.withoutMargin ? "0" : "0.5em");
|
|
51
51
|
const H4 = /* @__PURE__ */ styled.h4.withConfig({
|
|
52
52
|
displayName: "CommonElements__H4",
|
|
53
53
|
componentId: "sc-102d2aw-12"
|
|
54
|
-
})(["", " ", ""], () => css(["", ";"], h400), (props) => props.withoutMargin
|
|
54
|
+
})(["", " margin-bottom:", ";"], () => css(["", ";"], h400), (props) => props.withoutMargin ? "0" : "0.5em");
|
|
55
55
|
const H5 = /* @__PURE__ */ styled.h5.withConfig({
|
|
56
56
|
displayName: "CommonElements__H5",
|
|
57
57
|
componentId: "sc-102d2aw-13"
|
|
58
|
-
})(["", " ", ""], () => css(["", ";"], h300), (props) => props.withoutMargin
|
|
58
|
+
})(["", " margin-bottom:", ";"], () => css(["", ";"], h300), (props) => props.withoutMargin ? "0" : "0.5em");
|
|
59
59
|
const H6 = /* @__PURE__ */ styled.h6.withConfig({
|
|
60
60
|
displayName: "CommonElements__H6",
|
|
61
61
|
componentId: "sc-102d2aw-14"
|
|
62
|
-
})(["", " ", ""], () => css(["", ";"], h200), (props) => props.withoutMargin
|
|
62
|
+
})(["", " margin-bottom:", ";"], () => css(["", ";"], h200), (props) => props.withoutMargin ? "0" : "0.5em");
|
|
63
63
|
const H7 = /* @__PURE__ */ styled.h6.withConfig({
|
|
64
64
|
displayName: "CommonElements__H7",
|
|
65
65
|
componentId: "sc-102d2aw-15"
|
|
66
|
-
})(["", " ", ""], () => css(["", ";"], h100), (props) => props.withoutMargin
|
|
66
|
+
})(["", " margin-bottom:", ";"], () => css(["", ";"], h100), (props) => props.withoutMargin ? "0" : "0.5em");
|
|
67
67
|
const EllipsisText = /* @__PURE__ */ styled.div.withConfig({
|
|
68
68
|
displayName: "CommonElements__EllipsisText",
|
|
69
69
|
componentId: "sc-102d2aw-16"
|
package/dist/Ellipsis.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { default as React, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { TooltipProps } from '@synerise/ds-tooltip';
|
|
3
|
-
|
|
3
|
+
import { DataAttributes } from '@synerise/ds-utils';
|
|
4
|
+
export type EllipsisProps = DataAttributes & {
|
|
4
5
|
tooltip?: ReactNode;
|
|
5
6
|
tooltipProps?: TooltipProps;
|
|
6
7
|
children?: ReactNode;
|
|
7
8
|
className?: string;
|
|
8
9
|
style?: CSSProperties;
|
|
9
10
|
};
|
|
10
|
-
export declare const Ellipsis: ({ tooltip, children, className, tooltipProps, style, }: EllipsisProps) => React.JSX.Element;
|
|
11
|
+
export declare const Ellipsis: ({ tooltip, children, className, tooltipProps, style, ...dataAttributes }: EllipsisProps) => React.JSX.Element;
|
package/dist/Ellipsis.js
CHANGED
|
@@ -8,7 +8,8 @@ const Ellipsis = ({
|
|
|
8
8
|
children,
|
|
9
9
|
className,
|
|
10
10
|
tooltipProps,
|
|
11
|
-
style
|
|
11
|
+
style,
|
|
12
|
+
...dataAttributes
|
|
12
13
|
}) => {
|
|
13
14
|
const textComponentRef = useRef(null);
|
|
14
15
|
const [truncated, setTruncated] = useState(false);
|
|
@@ -31,7 +32,7 @@ const Ellipsis = ({
|
|
|
31
32
|
debouncedResize.cancel();
|
|
32
33
|
};
|
|
33
34
|
}, [resizeObserver, debouncedResize]);
|
|
34
|
-
return /* @__PURE__ */ jsx(Tooltip, { title: truncated ? tooltip : void 0, ...truncated ? tooltipProps : {}, children: /* @__PURE__ */ jsx(EllipsisText, { style, className, ref: textComponentRef, children }) });
|
|
35
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: truncated ? tooltip : void 0, ...truncated ? tooltipProps : {}, children: /* @__PURE__ */ jsx(EllipsisText, { ...dataAttributes, style, className, ref: textComponentRef, children }) });
|
|
35
36
|
};
|
|
36
37
|
export {
|
|
37
38
|
Ellipsis
|
package/dist/Paragraph.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
2
|
-
|
|
1
|
+
import { default as React, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { DataAttributes } from '@synerise/ds-utils';
|
|
3
|
+
type ParagraphProps = DataAttributes & {
|
|
3
4
|
size?: 'medium' | 'small' | 'xsmall';
|
|
4
5
|
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
5
8
|
};
|
|
6
|
-
export declare const Paragraph: ({ size, children }:
|
|
9
|
+
export declare const Paragraph: ({ size, children, className, style, ...dataAttributes }: ParagraphProps) => React.JSX.Element;
|
|
7
10
|
export {};
|
package/dist/Paragraph.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
2
3
|
import { XSmallParagraph, SmallParagraph, MediumParagraph } from "./CommonElements.js";
|
|
3
4
|
const MapSizeToComponent = {
|
|
4
5
|
medium: MediumParagraph,
|
|
@@ -7,10 +8,13 @@ const MapSizeToComponent = {
|
|
|
7
8
|
};
|
|
8
9
|
const Paragraph = ({
|
|
9
10
|
size = "medium",
|
|
10
|
-
children
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
...dataAttributes
|
|
11
15
|
}) => {
|
|
12
16
|
const Component = MapSizeToComponent[size];
|
|
13
|
-
return /* @__PURE__ */ jsx(Component, { className: "ds-paragraph", children });
|
|
17
|
+
return /* @__PURE__ */ jsx(Component, { ...dataAttributes, className: classNames("ds-paragraph", className), style, children });
|
|
14
18
|
};
|
|
15
19
|
export {
|
|
16
20
|
Paragraph
|
package/dist/Text.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { default as React, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { DataAttributes } from '@synerise/ds-utils';
|
|
2
3
|
import { EllipsisProps } from './Ellipsis';
|
|
3
4
|
export type TextSize = 'medium' | 'small' | 'xsmall';
|
|
4
|
-
type TextProps = {
|
|
5
|
+
type TextProps = DataAttributes & {
|
|
5
6
|
size?: TextSize;
|
|
6
7
|
ellipsis?: EllipsisProps;
|
|
7
8
|
children?: ReactNode;
|
|
8
9
|
className?: string;
|
|
9
10
|
style?: CSSProperties;
|
|
11
|
+
/** Renders the text with a heavier (500) weight. */
|
|
12
|
+
strong?: boolean;
|
|
10
13
|
};
|
|
11
|
-
export declare const Text: ({ size, className, children, ellipsis, style, }: TextProps) => React.JSX.Element;
|
|
14
|
+
export declare const Text: ({ size, className, children, ellipsis, style, strong, ...dataAttributes }: TextProps) => React.JSX.Element;
|
|
12
15
|
export default Text;
|
package/dist/Text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
2
3
|
import { XSmallText, SmallText, MediumText } from "./CommonElements.js";
|
|
3
4
|
import { Ellipsis } from "./Ellipsis.js";
|
|
4
|
-
import "./style/index.css";
|
|
5
5
|
const MapSizeToComponent = {
|
|
6
6
|
medium: MediumText,
|
|
7
7
|
small: SmallText,
|
|
@@ -12,15 +12,21 @@ const Text = ({
|
|
|
12
12
|
className,
|
|
13
13
|
children,
|
|
14
14
|
ellipsis,
|
|
15
|
-
style
|
|
15
|
+
style,
|
|
16
|
+
strong,
|
|
17
|
+
...dataAttributes
|
|
16
18
|
}) => {
|
|
17
19
|
const Component = MapSizeToComponent[size];
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
+
const mergedStyle = strong ? {
|
|
21
|
+
fontWeight: 500,
|
|
22
|
+
...style
|
|
23
|
+
} : style;
|
|
20
24
|
if (ellipsis === void 0) {
|
|
21
|
-
return
|
|
25
|
+
return /* @__PURE__ */ jsx(Component, { ...dataAttributes, className: classNames("ds-text", className), style: mergedStyle, children });
|
|
22
26
|
}
|
|
23
|
-
return /* @__PURE__ */ jsx(Ellipsis, { className, style, ...ellipsis, children:
|
|
27
|
+
return /* @__PURE__ */ jsx(Ellipsis, { ...dataAttributes, className, style, ...ellipsis, children: /* @__PURE__ */ jsx(Component, { className: "ds-text", style: strong ? {
|
|
28
|
+
fontWeight: 500
|
|
29
|
+
} : void 0, children }) });
|
|
24
30
|
};
|
|
25
31
|
export {
|
|
26
32
|
Text,
|
package/dist/Title.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Props } from './Title.types';
|
|
3
|
-
declare const Title: ({ level, withoutMargin, children, className, ellipsis, ...
|
|
3
|
+
declare const Title: ({ level, withoutMargin, children, className, ellipsis, ...rest }: Props) => React.JSX.Element;
|
|
4
4
|
export default Title;
|
package/dist/Title.js
CHANGED
|
@@ -17,11 +17,11 @@ const Title = ({
|
|
|
17
17
|
children,
|
|
18
18
|
className,
|
|
19
19
|
ellipsis,
|
|
20
|
-
...
|
|
20
|
+
...rest
|
|
21
21
|
}) => {
|
|
22
22
|
const TitleElement = StyledElements[level];
|
|
23
23
|
const elementClassName = classNames("ds-title", className);
|
|
24
|
-
const content = /* @__PURE__ */ jsx(TitleElement, { ...
|
|
24
|
+
const content = /* @__PURE__ */ jsx(TitleElement, { ...rest, className: elementClassName, withoutMargin: Boolean(withoutMargin), children });
|
|
25
25
|
if (ellipsis === void 0) {
|
|
26
26
|
return content;
|
|
27
27
|
}
|
package/dist/Title.types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { DataAttributes } from '@synerise/ds-utils';
|
|
2
3
|
import { EllipsisProps } from './Ellipsis';
|
|
3
|
-
export type Props =
|
|
4
|
+
export type Props = HTMLAttributes<HTMLHeadingElement> & DataAttributes & {
|
|
4
5
|
level: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
5
6
|
withoutMargin?: boolean;
|
|
6
7
|
ellipsis?: EllipsisProps;
|
package/dist/Typography.d.ts
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* DS-native replacement for antd's `Typography` namespace (the former default export).
|
|
3
|
+
* `Title` / `Text` / `Paragraph` are the DS-implemented components — no antd, no duplication.
|
|
4
|
+
* antd-only members (`Link`, `copyable`, `editable`, …) are intentionally dropped: a repo-wide
|
|
5
|
+
* audit found zero usages across portal-ui-bridge, portal-next and universal-list.
|
|
6
|
+
*/
|
|
7
|
+
declare const Typography: {
|
|
8
|
+
Title: ({ level, withoutMargin, children, className, ellipsis, ...rest }: import('./Title.types').Props) => import("react").JSX.Element;
|
|
9
|
+
Text: ({ size, className, children, ellipsis, style, strong, ...dataAttributes }: import('@synerise/ds-utils').DataAttributes & {
|
|
10
|
+
size?: import('./Text').TextSize;
|
|
11
|
+
ellipsis?: import('./Ellipsis').EllipsisProps;
|
|
12
|
+
children?: import('react').ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: import('react').CSSProperties;
|
|
15
|
+
strong?: boolean;
|
|
16
|
+
}) => import("react").JSX.Element;
|
|
17
|
+
Paragraph: ({ size, children, className, style, ...dataAttributes }: import('@synerise/ds-utils').DataAttributes & {
|
|
18
|
+
size?: "medium" | "small" | "xsmall";
|
|
19
|
+
children?: import('react').ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
style?: import('react').CSSProperties;
|
|
22
|
+
}) => import("react").JSX.Element;
|
|
23
|
+
};
|
|
24
|
+
export default Typography;
|
package/dist/Typography.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as default2 } from "./Typography.js";
|
|
2
2
|
import { Description, ErrorText, Label } from "./CommonElements.js";
|
|
3
|
-
import { default as
|
|
3
|
+
import { default as default3 } from "./Title.js";
|
|
4
4
|
import { Text } from "./Text.js";
|
|
5
5
|
import { Paragraph } from "./Paragraph.js";
|
|
6
6
|
import * as style_macroUtils from "./style/macro-utils.js";
|
|
@@ -10,7 +10,7 @@ export {
|
|
|
10
10
|
Label,
|
|
11
11
|
Paragraph,
|
|
12
12
|
Text,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
default3 as Title,
|
|
14
|
+
default2 as default,
|
|
15
15
|
style_macroUtils as macro
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-typography",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.27",
|
|
4
4
|
"description": "Typography UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"/dist",
|
|
19
19
|
"CHANGELOG.md",
|
|
20
|
+
"CLAUDE.md",
|
|
20
21
|
"README.md",
|
|
21
22
|
"package.json",
|
|
22
23
|
"LICENSE.md"
|
|
@@ -41,7 +42,8 @@
|
|
|
41
42
|
],
|
|
42
43
|
"types": "dist/index.d.ts",
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@synerise/ds-tooltip": "^1.5.
|
|
45
|
+
"@synerise/ds-tooltip": "^1.5.4",
|
|
46
|
+
"@synerise/ds-utils": "^1.10.2",
|
|
45
47
|
"classnames": "^2.5.1",
|
|
46
48
|
"lodash.debounce": "^4.0.8"
|
|
47
49
|
},
|
|
@@ -50,10 +52,9 @@
|
|
|
50
52
|
},
|
|
51
53
|
"peerDependencies": {
|
|
52
54
|
"@synerise/ds-core": "*",
|
|
53
|
-
"antd": "4.24.16",
|
|
54
55
|
"react": ">=16.9.0 <= 18.3.1",
|
|
55
56
|
"styled-components": "^5.3.3",
|
|
56
57
|
"vitest": "4"
|
|
57
58
|
},
|
|
58
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "d0a43cc43d8528a36f105aceea52ab470edb71d9"
|
|
59
60
|
}
|
|
File without changes
|
package/dist/style/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.ant-typography{color:#6a7580;word-break:break-word}.ant-typography.ant-typography-secondary{color:#232936}.ant-typography.ant-typography-success{color:#54cb0b}.ant-typography.ant-typography-warning{color:#fab700}.ant-typography.ant-typography-danger{color:#f52922}a.ant-typography.ant-typography-danger:active,a.ant-typography.ant-typography-danger:focus{color:#cf1313}a.ant-typography.ant-typography-danger:hover{color:#ff584d}.ant-typography.ant-typography-disabled{color:#b5bdc3;cursor:not-allowed;user-select:none}.ant-typography p,div.ant-typography{margin-bottom:1em}.ant-typography h1,div.ant-typography-h1,div.ant-typography-h1>textarea,h1.ant-typography{margin-bottom:.5em;color:#384350;font-weight:500;font-size:24px;line-height:1.23}.ant-typography h2,div.ant-typography-h2,div.ant-typography-h2>textarea,h2.ant-typography{margin-bottom:.5em;color:#384350;font-weight:500;font-size:21px;line-height:1.35}.ant-typography h3,div.ant-typography-h3,div.ant-typography-h3>textarea,h3.ant-typography{margin-bottom:.5em;color:#384350;font-weight:500;font-size:18px;line-height:1.35}.ant-typography h4,div.ant-typography-h4,div.ant-typography-h4>textarea,h4.ant-typography{margin-bottom:.5em;color:#384350;font-weight:500;font-size:16px;line-height:1.4}.ant-typography h5,div.ant-typography-h5,div.ant-typography-h5>textarea,h5.ant-typography{margin-bottom:.5em;color:#384350;font-weight:500;font-size:15px;line-height:1.5}.ant-typography+h1.ant-typography,.ant-typography+h2.ant-typography,.ant-typography+h3.ant-typography,.ant-typography+h4.ant-typography,.ant-typography+h5.ant-typography{margin-top:1.2em}.ant-typography div+h1,.ant-typography div+h2,.ant-typography div+h3,.ant-typography div+h4,.ant-typography div+h5,.ant-typography h1+h1,.ant-typography h1+h2,.ant-typography h1+h3,.ant-typography h1+h4,.ant-typography h1+h5,.ant-typography h2+h1,.ant-typography h2+h2,.ant-typography h2+h3,.ant-typography h2+h4,.ant-typography h2+h5,.ant-typography h3+h1,.ant-typography h3+h2,.ant-typography h3+h3,.ant-typography h3+h4,.ant-typography h3+h5,.ant-typography h4+h1,.ant-typography h4+h2,.ant-typography h4+h3,.ant-typography h4+h4,.ant-typography h4+h5,.ant-typography h5+h1,.ant-typography h5+h2,.ant-typography h5+h3,.ant-typography h5+h4,.ant-typography h5+h5,.ant-typography li+h1,.ant-typography li+h2,.ant-typography li+h3,.ant-typography li+h4,.ant-typography li+h5,.ant-typography p+h1,.ant-typography p+h2,.ant-typography p+h3,.ant-typography p+h4,.ant-typography p+h5,.ant-typography ul+h1,.ant-typography ul+h2,.ant-typography ul+h3,.ant-typography ul+h4,.ant-typography ul+h5{margin-top:1.2em}a.ant-typography-ellipsis,span.ant-typography-ellipsis{display:inline-block;max-width:100%}.ant-typography a,a.ant-typography{color:#0b68ff;outline:0;cursor:pointer;transition:color .3s;text-decoration:none}.ant-typography a:focus-visible,.ant-typography a:hover,a.ant-typography:focus-visible,a.ant-typography:hover{color:#238afe}.ant-typography a:active,a.ant-typography:active{color:#0b68ff}.ant-typography a:active,.ant-typography a:hover,a.ant-typography:active,a.ant-typography:hover{text-decoration:underline}.ant-typography a.ant-typography-disabled,.ant-typography a[disabled],a.ant-typography.ant-typography-disabled,a.ant-typography[disabled]{color:#b5bdc3;cursor:not-allowed}.ant-typography a.ant-typography-disabled:active,.ant-typography a.ant-typography-disabled:hover,.ant-typography a[disabled]:active,.ant-typography a[disabled]:hover,a.ant-typography.ant-typography-disabled:active,a.ant-typography.ant-typography-disabled:hover,a.ant-typography[disabled]:active,a.ant-typography[disabled]:hover{color:#b5bdc3}.ant-typography a.ant-typography-disabled:active,.ant-typography a[disabled]:active,a.ant-typography.ant-typography-disabled:active,a.ant-typography[disabled]:active{pointer-events:none}.ant-typography code{margin:0 .2em;padding:.2em .4em .1em;font-size:85%;background:rgba(150,150,150,.1);border:1px solid rgba(100,100,100,.2);border-radius:3px}.ant-typography kbd{margin:0 .2em;padding:.15em .4em .1em;font-size:90%;background:rgba(150,150,150,.06);border:1px solid rgba(100,100,100,.2);border-bottom-width:2px;border-radius:3px}.ant-typography mark{padding:0;background-color:#ffe58f}.ant-typography ins,.ant-typography u{text-decoration:underline;text-decoration-skip-ink:auto}.ant-typography del,.ant-typography s{text-decoration:line-through}.ant-typography strong{font-weight:600}.ant-typography-copy,.ant-typography-edit,.ant-typography-expand{color:#0b68ff;outline:0;cursor:pointer;transition:color .3s;margin-left:4px}.ant-typography-copy:focus-visible,.ant-typography-copy:hover,.ant-typography-edit:focus-visible,.ant-typography-edit:hover,.ant-typography-expand:focus-visible,.ant-typography-expand:hover{color:#238afe}.ant-typography-copy:active,.ant-typography-edit:active,.ant-typography-expand:active{color:#0b68ff}.ant-typography-copy-success,.ant-typography-copy-success:focus,.ant-typography-copy-success:hover{color:#54cb0b}.ant-typography-edit-content{position:relative}div.ant-typography-edit-content{left:-16px;margin-top:-5px;margin-bottom:calc(1em - 4px - 1px)}.ant-typography-edit-content-confirm{position:absolute;right:10px;bottom:8px;color:#232936;font-weight:400;font-size:13px;font-style:normal;pointer-events:none}.ant-typography-edit-content textarea{height:1em;margin:0!important;-moz-transition:none}.ant-typography ol,.ant-typography ul{margin:0 0 1em;padding:0}.ant-typography ol li,.ant-typography ul li{margin:0 0 0 20px;padding:0 0 0 4px}.ant-typography ul{list-style-type:circle}.ant-typography ul ul{list-style-type:disc}.ant-typography ol{list-style-type:decimal}.ant-typography blockquote,.ant-typography pre{margin:1em 0}.ant-typography pre{padding:.4em .6em;white-space:pre-wrap;word-wrap:break-word;background:rgba(150,150,150,.1);border:1px solid rgba(100,100,100,.2);border-radius:3px}.ant-typography pre code{display:inline;margin:0;padding:0;font-size:inherit;font-family:inherit;background:0 0;border:0}.ant-typography blockquote{padding:0 0 0 .6em;border-left:4px solid rgba(100,100,100,.2);opacity:.85}.ant-typography-single-line{white-space:nowrap}.ant-typography-ellipsis-single-line{overflow:hidden;text-overflow:ellipsis}a.ant-typography-ellipsis-single-line,span.ant-typography-ellipsis-single-line{vertical-align:bottom}.ant-typography-ellipsis-multiple-line{display:-webkit-box;overflow:hidden;-webkit-line-clamp:3;/*! autoprefixer: ignore next */-webkit-box-orient:vertical}.ant-typography-rtl{direction:rtl}.ant-typography-rtl .ant-typography-copy,.ant-typography-rtl .ant-typography-edit,.ant-typography-rtl .ant-typography-expand{margin-right:4px;margin-left:0}.ant-typography-rtl .ant-typography-expand{float:left}div.ant-typography-edit-content.ant-typography-rtl{right:-16px;left:auto}.ant-typography-rtl .ant-typography-edit-content-confirm{right:auto;left:10px}.ant-typography-rtl.ant-typography ol li,.ant-typography-rtl.ant-typography ul li{margin:0 20px 0 0;padding:0 4px 0 0}
|