@neovici/cosmoz-tokens 3.1.1 → 3.2.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/package.json +5 -1
- package/src/truncate.css.d.ts +16 -0
- package/src/truncate.css.js +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neovici/cosmoz-tokens",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Design tokens for Cosmoz web components based on Untitled UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-tokens",
|
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
"./skeumorphic": {
|
|
35
35
|
"types": "./src/skeumorphic.css.d.ts",
|
|
36
36
|
"default": "./src/skeumorphic.css.js"
|
|
37
|
+
},
|
|
38
|
+
"./truncate": {
|
|
39
|
+
"types": "./src/truncate.css.d.ts",
|
|
40
|
+
"default": "./src/truncate.css.js"
|
|
37
41
|
}
|
|
38
42
|
},
|
|
39
43
|
"files": [
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Truncate text with ellipsis.
|
|
3
|
+
* Prevents text from wrapping and adds an ellipsis (...) when text overflows.
|
|
4
|
+
*
|
|
5
|
+
* Equivalent to Tailwind's `truncate` utility.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import { truncate } from '@neovici/cosmoz-tokens/truncate';
|
|
9
|
+
*
|
|
10
|
+
* export const styles = css`
|
|
11
|
+
* .label {
|
|
12
|
+
* ${truncate}
|
|
13
|
+
* }
|
|
14
|
+
* `;
|
|
15
|
+
*/
|
|
16
|
+
export const truncate: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { css } from '@pionjs/pion';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Truncate text with ellipsis.
|
|
5
|
+
* Prevents text from wrapping and adds an ellipsis (...) when text overflows.
|
|
6
|
+
*
|
|
7
|
+
* Equivalent to Tailwind's `truncate` utility.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { truncate } from '@neovici/cosmoz-tokens/truncate';
|
|
11
|
+
*
|
|
12
|
+
* export const styles = css`
|
|
13
|
+
* .label {
|
|
14
|
+
* ${truncate}
|
|
15
|
+
* }
|
|
16
|
+
* `;
|
|
17
|
+
*/
|
|
18
|
+
export const truncate = css`
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
text-overflow: ellipsis;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
`;
|