@semcore/typography 17.0.1 → 17.0.2-prerelease.1
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 +6 -0
- package/lib/cjs/{Blockquote.js → components/Blockquote/Blockquote.js} +11 -10
- package/lib/cjs/components/Blockquote/Blockquote.js.map +1 -0
- package/lib/cjs/components/Blockquote/Blockquote.type.js +2 -0
- package/lib/cjs/components/Blockquote/Blockquote.type.js.map +1 -0
- package/lib/cjs/{List.js → components/List/List.js} +8 -9
- package/lib/cjs/components/List/List.js.map +1 -0
- package/lib/cjs/components/List/List.type.js +2 -0
- package/lib/cjs/components/List/List.type.js.map +1 -0
- package/lib/cjs/{Text.js → components/Text/Text.js} +44 -43
- package/lib/cjs/components/Text/Text.js.map +1 -0
- package/lib/cjs/components/Text/Text.type.js +2 -0
- package/lib/cjs/components/Text/Text.type.js.map +1 -0
- package/lib/cjs/index.js +44 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/es6/{Blockquote.js → components/Blockquote/Blockquote.js} +11 -10
- package/lib/es6/components/Blockquote/Blockquote.js.map +1 -0
- package/lib/es6/components/Blockquote/Blockquote.type.js +2 -0
- package/lib/es6/components/Blockquote/Blockquote.type.js.map +1 -0
- package/lib/es6/{List.js → components/List/List.js} +8 -9
- package/lib/es6/components/List/List.js.map +1 -0
- package/lib/es6/components/List/List.type.js +2 -0
- package/lib/es6/components/List/List.type.js.map +1 -0
- package/lib/es6/{Text.js → components/Text/Text.js} +44 -43
- package/lib/es6/components/Text/Text.js.map +1 -0
- package/lib/es6/components/Text/Text.type.js +2 -0
- package/lib/es6/components/Text/Text.type.js.map +1 -0
- package/lib/es6/index.js +6 -3
- package/lib/es6/index.js.map +1 -1
- package/lib/esm/{Blockquote.mjs → components/Blockquote/Blockquote.mjs} +12 -12
- package/lib/esm/components/Blockquote/Blockquote.type.mjs +1 -0
- package/lib/esm/{List.mjs → components/List/List.mjs} +9 -10
- package/lib/esm/components/List/List.type.mjs +1 -0
- package/lib/esm/components/Text/Text.mjs +163 -0
- package/lib/esm/components/Text/Text.type.mjs +1 -0
- package/lib/esm/index.mjs +6 -3
- package/lib/types/components/Blockquote/Blockquote.d.ts +3 -0
- package/lib/types/components/Blockquote/Blockquote.type.d.ts +12 -0
- package/lib/types/components/List/List.d.ts +3 -0
- package/lib/types/components/List/List.type.d.ts +34 -0
- package/lib/types/components/Text/Text.d.ts +3 -0
- package/lib/types/components/Text/Text.type.d.ts +82 -0
- package/lib/types/index.d.ts +6 -117
- package/package.json +6 -6
- package/vite.config.ts +1 -1
- package/lib/cjs/Blockquote.js.map +0 -1
- package/lib/cjs/List.js.map +0 -1
- package/lib/cjs/Text.js.map +0 -1
- package/lib/cjs/index.d.js +0 -2
- package/lib/cjs/index.d.js.map +0 -1
- package/lib/es6/Blockquote.js.map +0 -1
- package/lib/es6/List.js.map +0 -1
- package/lib/es6/Text.js.map +0 -1
- package/lib/es6/index.d.js +0 -2
- package/lib/es6/index.d.js.map +0 -1
- package/lib/esm/Text.mjs +0 -163
- package/lib/types/Text.d.ts +0 -2
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { BoxProps, EllipsisSettings, SimpleHintPopperProps, Ellipsis as EllipsisInstance } from '@semcore/base-components';
|
|
2
|
+
import type { Intergalactic } from '@semcore/core';
|
|
3
|
+
import type { Property } from 'csstype';
|
|
4
|
+
declare namespace NSText {
|
|
5
|
+
type BaseProps = {
|
|
6
|
+
/** Font size and line-heights */
|
|
7
|
+
size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800;
|
|
8
|
+
/**
|
|
9
|
+
* The text will not be wrapped on a new line and will be cut off with ellipsis
|
|
10
|
+
* @deprecated use ellipsis prop instead
|
|
11
|
+
**/
|
|
12
|
+
noWrap?: boolean;
|
|
13
|
+
/** CSS property `font-weight: 700;` */
|
|
14
|
+
bold?: boolean;
|
|
15
|
+
/** CSS property `font-weight: 600;` */
|
|
16
|
+
semibold?: boolean;
|
|
17
|
+
/** CSS property `font-weight: 500;` */
|
|
18
|
+
medium?: boolean;
|
|
19
|
+
/** Italicized text */
|
|
20
|
+
italic?: boolean;
|
|
21
|
+
/** Underlined text */
|
|
22
|
+
underline?: boolean;
|
|
23
|
+
/** CSS property `font-family: monospace;` */
|
|
24
|
+
monospace?: boolean;
|
|
25
|
+
/** Strikethrough text */
|
|
26
|
+
lineThrough?: boolean;
|
|
27
|
+
/** Uppercase text */
|
|
28
|
+
uppercase?: boolean;
|
|
29
|
+
/** Lowercase text */
|
|
30
|
+
lowercase?: boolean;
|
|
31
|
+
/** Capitalized text */
|
|
32
|
+
capitalize?: boolean;
|
|
33
|
+
/** Text color **/
|
|
34
|
+
color?: string;
|
|
35
|
+
/** Custom `font-size` */
|
|
36
|
+
fontSize?: Property.FontSize<any>;
|
|
37
|
+
/** Custom `line-height` */
|
|
38
|
+
lineHeight?: Property.LineHeight<any>;
|
|
39
|
+
/** Custom `font-weight` */
|
|
40
|
+
fontWeight?: Property.FontWeight;
|
|
41
|
+
/** Text alignment */
|
|
42
|
+
textAlign?: Property.TextAlign;
|
|
43
|
+
/** Enforces text color */
|
|
44
|
+
use?: 'primary' | 'secondary';
|
|
45
|
+
/** Makes text semi-transparent to indicate disabled state */
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
};
|
|
48
|
+
type HintProps = {
|
|
49
|
+
/** Manually enabled/disabled Hint */
|
|
50
|
+
hint?: boolean;
|
|
51
|
+
} & {
|
|
52
|
+
[K in keyof SimpleHintPopperProps as `hint:${string & K}`]?: SimpleHintPopperProps[K];
|
|
53
|
+
};
|
|
54
|
+
type EllipsisProps = {
|
|
55
|
+
/** Manually enabled/disabled Ellipsis or provide an instance of it. */
|
|
56
|
+
ellipsis?: boolean | EllipsisInstance;
|
|
57
|
+
} & {
|
|
58
|
+
[K in keyof EllipsisSettings as `ellipsis:${string & K}`]?: EllipsisSettings[K];
|
|
59
|
+
};
|
|
60
|
+
type Props = BoxProps & NSText.BaseProps & ({
|
|
61
|
+
/** Enable formatting/styling for all nested HTML tags with our default styles for them */
|
|
62
|
+
formatTags?: boolean;
|
|
63
|
+
ellipsis?: never;
|
|
64
|
+
ellipsisProps?: never;
|
|
65
|
+
hint?: never;
|
|
66
|
+
hintProps?: never;
|
|
67
|
+
} | ({
|
|
68
|
+
formatTags?: never;
|
|
69
|
+
} & NSText.HintProps & NSText.EllipsisProps));
|
|
70
|
+
type Component = Intergalactic.Component<'span', Props>;
|
|
71
|
+
}
|
|
72
|
+
/** @deprecated It will be removed in v18. */
|
|
73
|
+
export type TextHintProps = NSText.HintProps;
|
|
74
|
+
/** @deprecated It will be removed in v18. */
|
|
75
|
+
export type TextEllipsisProps = NSText.EllipsisProps;
|
|
76
|
+
/** @deprecated It will be removed in v18. */
|
|
77
|
+
export type BaseTextProps = NSText.BaseProps;
|
|
78
|
+
/** @deprecated It will be removed in v18. */
|
|
79
|
+
export type TextProps = NSText.Props;
|
|
80
|
+
/** @deprecated It will be removed in v18. */
|
|
81
|
+
export type TextComponent = NSText.Component;
|
|
82
|
+
export type { NSText };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,117 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
/** Manually enabled/disabled Hint */
|
|
8
|
-
hint?: boolean;
|
|
9
|
-
} & {
|
|
10
|
-
/** Settings for a hint with full text (cropped by ellipsis) */
|
|
11
|
-
[K in keyof SimpleHintPopperProps as `hint:${string & K}`]?: SimpleHintPopperProps[K];
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** The text will not be wrapped on a new line and will be cut off with ellipsis. Also, it will show a hint with full text. */
|
|
15
|
-
export type TextEllipsisProps = {
|
|
16
|
-
/** Manually enabled/disabled Ellipsis or provide an instance of it. */
|
|
17
|
-
ellipsis?: (boolean | Ellipsis);
|
|
18
|
-
} & {
|
|
19
|
-
/** Settings for an Ellipsis */
|
|
20
|
-
[K in keyof EllipsisSettings as `ellipsis:${string & K}`]?: EllipsisSettings[K];
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type BaseTextProps = {
|
|
24
|
-
/** Font size and line-heights */
|
|
25
|
-
size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800;
|
|
26
|
-
/**
|
|
27
|
-
* The text will not be wrapped on a new line and will be cut off with ellipsis
|
|
28
|
-
* @deprecated use ellipsis prop instead
|
|
29
|
-
**/
|
|
30
|
-
noWrap?: boolean;
|
|
31
|
-
/** CSS property `font-weight: 700;` */
|
|
32
|
-
bold?: boolean;
|
|
33
|
-
/** CSS property `font-weight: 600;` */
|
|
34
|
-
semibold?: boolean;
|
|
35
|
-
/** CSS property `font-weight: 500;` */
|
|
36
|
-
medium?: boolean;
|
|
37
|
-
/** Italicized text */
|
|
38
|
-
italic?: boolean;
|
|
39
|
-
/** Underlined text */
|
|
40
|
-
underline?: boolean;
|
|
41
|
-
/** CSS property `font-family: monospace;` */
|
|
42
|
-
monospace?: boolean;
|
|
43
|
-
/** Strikethrough text */
|
|
44
|
-
lineThrough?: boolean;
|
|
45
|
-
/** Uppercase text */
|
|
46
|
-
uppercase?: boolean;
|
|
47
|
-
/** Lowercase text */
|
|
48
|
-
lowercase?: boolean;
|
|
49
|
-
/** Capitalized text */
|
|
50
|
-
capitalize?: boolean;
|
|
51
|
-
/** Text color **/
|
|
52
|
-
color?: string;
|
|
53
|
-
/** Custom `font-size` */
|
|
54
|
-
fontSize?: Property.FontSize<any>;
|
|
55
|
-
/** Custom `line-height` */
|
|
56
|
-
lineHeight?: Property.LineHeight<any>;
|
|
57
|
-
/** Custom `font-weight` */
|
|
58
|
-
fontWeight?: Property.FontWeight;
|
|
59
|
-
/** Text alignment */
|
|
60
|
-
textAlign?: Property.TextAlign;
|
|
61
|
-
/** Enforces text color */
|
|
62
|
-
use?: 'primary' | 'secondary';
|
|
63
|
-
/** Makes text semi-transparent to indicate disabled state */
|
|
64
|
-
disabled?: boolean;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export type TextProps = BoxProps & BaseTextProps & (
|
|
68
|
-
{
|
|
69
|
-
/** Enable formatting/styling for all nested HTML tags with our default styles for them */
|
|
70
|
-
formatTags?: boolean;
|
|
71
|
-
ellipsis?: never;
|
|
72
|
-
ellipsisProps?: never;
|
|
73
|
-
hint?: never;
|
|
74
|
-
hintProps?: never;
|
|
75
|
-
} |
|
|
76
|
-
({
|
|
77
|
-
formatTags?: never;
|
|
78
|
-
// /** Settings for a hint with full text (cropped by ellipsis) */
|
|
79
|
-
// hintProps?: Partial<Omit<SimpleHintPopperProps, 'children'>> | false;
|
|
80
|
-
} & TextHintProps & TextEllipsisProps)
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
export type ListProps = TextProps & {
|
|
84
|
-
/** Marker of the entire list
|
|
85
|
-
* @default • */
|
|
86
|
-
marker?: React.ReactNode;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export type ListItemProps = TextProps & {
|
|
90
|
-
/** Individual marker of a list item */
|
|
91
|
-
marker?: React.ReactNode;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export type ListItemContentProps = FlexProps;
|
|
95
|
-
|
|
96
|
-
export type ListContext = {
|
|
97
|
-
getItemProps: PropGetterFn;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export type BlockquoteProps = BoxProps & {
|
|
101
|
-
/** Source of the quote */
|
|
102
|
-
author?: React.ReactNode;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
declare const Item: Intergalactic.Component<'li', ListItemProps> & {
|
|
106
|
-
Content: Intergalactic.Component<typeof Flex, ListItemContentProps>;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
declare const List: Intergalactic.Component<'ul', ListProps> & {
|
|
110
|
-
Item: typeof Item;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
declare const Text: Intergalactic.Component<'span', TextProps>;
|
|
114
|
-
|
|
115
|
-
declare const Blockquote: Intergalactic.Component<'blockquote', BlockquoteProps>;
|
|
116
|
-
|
|
117
|
-
export { Text, List, Blockquote };
|
|
1
|
+
export { default as Text } from './components/Text/Text';
|
|
2
|
+
export { default as Blockquote } from './components/Blockquote/Blockquote';
|
|
3
|
+
export { default as List } from './components/List/List';
|
|
4
|
+
export * from './components/Text/Text.type';
|
|
5
|
+
export * from './components/Blockquote/Blockquote.type';
|
|
6
|
+
export * from './components/List/List.type';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/typography",
|
|
3
3
|
"description": "Semrush Typography Component",
|
|
4
|
-
"version": "17.0.1",
|
|
4
|
+
"version": "17.0.2-prerelease.1",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@semcore/base-components": "^17.0.
|
|
18
|
+
"@semcore/base-components": "^17.0.2",
|
|
19
19
|
"@semcore/icon": "^17.0.1"
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"csstype": "3.1.3",
|
|
28
|
+
"@semcore/testing-utils": "1.0.0",
|
|
29
|
+
"@semcore/base-components": "17.0.2-prerelease.1",
|
|
28
30
|
"@semcore/core": "17.0.1",
|
|
29
|
-
"@semcore/
|
|
30
|
-
"@semcore/icon": "17.0.1",
|
|
31
|
-
"@semcore/testing-utils": "1.0.0"
|
|
31
|
+
"@semcore/icon": "17.0.1-prerelease.1"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
|
-
"build": "pnpm semcore-builder
|
|
34
|
+
"build": "pnpm semcore-builder && pnpm vite build"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/vite.config.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Blockquote.js","names":["_core","require","_baseComponents","_isNode","_interopRequireDefault","_react","styles","sstyled","insert","Blockquote","props","ref","_ref","arguments[0]","_ref2","SBlockquote","Box","SDoubleQuotation","SAuthor","children","author","default","createElement","cn","assignProps","isNode","displayName","_default","exports","createBaseComponent"],"sources":["../../src/Blockquote.jsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport { createBaseComponent, Root, sstyled } from '@semcore/core';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport React from 'react';\n\nimport styles from './style/blockquote.shadow.css';\n\nfunction Blockquote(props, ref) {\n const SBlockquote = Root;\n const SDoubleQuotation = 'span';\n const SAuthor = 'cite';\n const { children, author } = props;\n\n return sstyled(styles)(\n <SBlockquote render={Box} tag='blockquote' ref={ref}>\n <SDoubleQuotation>“</SDoubleQuotation>\n <span>\n {children}\n {isNode(author) && <SAuthor>{author}</SAuthor>}\n </span>\n </SBlockquote>,\n );\n}\n\nBlockquote.displayName = 'Blockquote';\n\nexport default createBaseComponent(Blockquote);\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA0B;AAAA,MAAAK,MAAA,8BAAAN,KAAA,CAAAO,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;AAAA;AAI1B,SAASC,UAAUA,CAACC,KAAK,EAAEC,GAAG,EAAE;EAAA,IAAAC,IAAA,GAAAC,YAAA;IAAAC,KAAA;EAC9B,MAAMC,WAAW,GAMMC,mBAAG;EAL1B,MAAMC,gBAAgB,GAAG,MAAM;EAC/B,MAAMC,OAAO,GAAG,MAAM;EACtB,MAAM;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGV,KAAK;EAElC,OAAAI,KAAA,GAAO,IAAAP,aAAO,EAACD,MAAM,CAAC,eACpBD,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACP,WAAW,EAAAD,KAAA,CAAAS,EAAA;IAAA,OAAAvB,KAAA,CAAAwB,WAAA;MAAA,OAAkB,YAAY;MAAA,OAAMb;IAAG,GAAAC,IAAA;EAAA,iBACjDP,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACL,gBAAgB,EAAAH,KAAA,CAAAS,EAAA,0BAAC,QAAmB,CAAC,eACtClB,MAAA,CAAAgB,OAAA,CAAAC,aAAA,SAAAR,KAAA,CAAAS,EAAA,cACGJ,QAAQ,EACR,IAAAM,eAAM,EAACL,MAAM,CAAC,iBAAIf,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACJ,OAAO,EAAAJ,KAAA,CAAAS,EAAA,iBAAEH,MAAgB,CACzC,CACK,CAAC;AAElB;AAEAX,UAAU,CAACiB,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAEvB,IAAAQ,yBAAmB,EAACpB,UAAU,CAAC","ignoreList":[]}
|
package/lib/cjs/List.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","names":["_core","require","_baseComponents","_findComponent","_isNode","_interopRequireDefault","_react","_Text","style","sstyled","insert","ListRoot","Component","getItemProps","marker","asProps","render","_ref","_ref4","SList","Text","styles","default","createElement","cn","assignProps","_defineProperty2","ItemRoot","_ref2","_ref5","SItem","children","markerNode","Children","SMarker","SContent","isAdvancedMode","isAdvanceMode","List","Item","Content","displayName","isNode","props","_ref3","arguments[0]","_ref6","Flex","createComponent","_default","exports"],"sources":["../../src/List.jsx"],"sourcesContent":["import { Flex } from '@semcore/base-components';\nimport { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport { isAdvanceMode } from '@semcore/core/lib/utils/findComponent';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport React from 'react';\n\nimport style from './style/list.shadow.css';\nimport Text from './Text';\n\nclass ListRoot extends Component {\n static displayName = 'List';\n static style = style;\n static defaultProps = {\n marker: '•',\n };\n\n getItemProps() {\n const { marker } = this.asProps;\n return {\n marker,\n };\n }\n\n render() {\n const SList = Root;\n const { styles } = this.asProps;\n return sstyled(styles)(<SList render={Text} tag='ul' />);\n }\n}\n\nclass ItemRoot extends Component {\n static style = style;\n static displayName = 'Item';\n\n render() {\n const SItem = Root;\n const { styles, children, marker: markerNode, Children } = this.asProps;\n const SMarker = 'span';\n const SContent = 'div';\n\n const isAdvancedMode = isAdvanceMode(Children, [List.Item.Content.displayName]);\n\n return sstyled(styles)(\n <SItem render={Text} tag='li'>\n {isNode(markerNode) && <SMarker aria-hidden='true'>{markerNode}</SMarker>}\n {isAdvancedMode ? <Children /> : <SContent>{children}</SContent>}\n </SItem>,\n );\n }\n}\n\nfunction Content(props) {\n const { styles, children } = props;\n const SContent = Root;\n\n return sstyled(styles)(<SContent render={Flex}>{children}</SContent>);\n}\n\nContent.displayName = 'Content';\n\nconst Item = createComponent(ItemRoot, { Content });\n\nconst List = createComponent(ListRoot, { Item });\n\nexport default List;\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAGA,IAAAM,KAAA,GAAAF,sBAAA,CAAAJ,OAAA;AAA0B;AAAA,MAAAO,KAAA,8BAAAR,KAAA,CAAAS,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAE1B,MAAMC,QAAQ,SAASC,eAAS,CAAC;EAO/BC,YAAYA,CAAA,EAAG;IACb,MAAM;MAAEC;IAAO,CAAC,GAAG,IAAI,CAACC,OAAO;IAC/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CAAA5B,OAAA,GAElCgB,IAAI","ignoreList":[]}
|
package/lib/cjs/Text.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","names":["_core","require","_baseComponents","_resolveColorEnhance","_interopRequireDefault","_react","styles","sstyled","insert","TextRoot","Component","constructor","props","_defineProperty2","default","React","createRef","isEllipsized","handleEllipsized","bind","componentDidMount","initEllipsis","componentDidUpdate","prevProps","ellipsisKeys","hasChanges","some","key","asProps","ellipsis","cleanUpEllipsis","componentWillUnmount","render","_ref","_ref2","SText","Box","color","underline","lineThrough","hint","hintProps","children","ellipsisProps","resolveColor","state","cropPosition","withHint","maxLineValue","maxLine","undefined","createElement","Fragment","cn","assignProps","innerRef","getTextDecoration","Boolean","Hint","setState","shouldInit","current","Ellipsis","on","off","cleanUp","resolveColorEnhance","_default","exports","createComponent"],"sources":["../../src/Text.tsx"],"sourcesContent":["import { Ellipsis, Hint, Box, type EllipsisSettings } from '@semcore/base-components';\nimport { Root, sstyled, Component, createComponent } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport React from 'react';\n\nimport type { TextEllipsisProps, TextProps } from './index';\nimport styles from './style/text.shadow.css';\n\ntype State = {\n isEllipsized: boolean;\n};\n\nclass TextRoot extends Component<TextProps, typeof TextRoot.enhance, {}, {}, State> {\n private ellipsis: Ellipsis | null = null;\n private innerRef = React.createRef<HTMLElement | null>();\n\n static enhance = [resolveColorEnhance()] as const;\n static styles = styles;\n static displayName = 'Text';\n\n state = {\n isEllipsized: false,\n };\n\n constructor(props: TextProps) {\n super(props);\n\n this.handleEllipsized = this.handleEllipsized.bind(this);\n }\n\n componentDidMount(): void {\n this.initEllipsis();\n }\n\n componentDidUpdate(prevProps: TextEllipsisProps) {\n const ellipsisKeys: Array<keyof EllipsisSettings> = [\n 'cropPosition',\n 'maxLine',\n 'lastRequiredSymbols',\n 'containerElement',\n 'recalculateContainerWidth',\n 'observeChildrenMutations',\n ];\n\n const hasChanges = ellipsisKeys.some((key) => {\n return prevProps[`ellipsis:${key}`] !== this.asProps[`ellipsis:${key}`];\n });\n\n if (prevProps.ellipsis !== this.asProps.ellipsis || hasChanges) {\n this.cleanUpEllipsis();\n\n this.initEllipsis();\n }\n }\n\n componentWillUnmount() {\n this.cleanUpEllipsis();\n }\n\n render(): React.ReactNode {\n const SText = Root;\n const { color, underline, lineThrough, hint, hintProps, children, ellipsis, ellipsisProps, resolveColor } = this.asProps;\n const { isEllipsized } = this.state;\n\n const cropPosition = ellipsisProps?.cropPosition ?? 'end';\n let withHint = hint !== false;\n\n const maxLineValue = ellipsisProps?.maxLine;\n if (hint !== true && hintProps === undefined && maxLineValue !== undefined && maxLineValue > 1) {\n withHint = false;\n }\n\n return sstyled(styles)(\n <>\n <SText\n render={Box}\n tag='span'\n data-ui-name='Text'\n ref={this.innerRef}\n use:decoration={this.getTextDecoration(underline, lineThrough)}\n use:color={resolveColor(color)}\n use:ellipsis={ellipsis !== undefined ? ellipsis : Boolean(ellipsisProps)}\n isEllipsized={isEllipsized}\n maxLine={maxLineValue}\n trim={cropPosition}\n />\n {isEllipsized && withHint && <Hint triggerRef={this.innerRef} {...hintProps}>{children}</Hint>}\n </>,\n );\n }\n\n private handleEllipsized(isEllipsized: boolean) {\n this.setState({ isEllipsized: isEllipsized });\n }\n\n private initEllipsis() {\n const { ellipsis, ellipsisProps, hint } = this.asProps;\n const shouldInit = hint !== false || ellipsisProps?.cropPosition === 'middle';\n\n if (shouldInit && (ellipsis || ellipsisProps) && this.innerRef.current) {\n this.ellipsis = ellipsis instanceof Ellipsis ? ellipsis : new Ellipsis(this.innerRef.current, ellipsisProps ?? {});\n\n this.ellipsis.on('isEllipsized', this.handleEllipsized);\n }\n }\n\n private cleanUpEllipsis() {\n this.ellipsis?.off('isEllipsized', this.handleEllipsized);\n this.ellipsis?.cleanUp();\n this.setState({ isEllipsized: false });\n }\n\n private getTextDecoration(underline?: boolean, lineThrough?: boolean) {\n if (underline) {\n return 'underline';\n }\n\n if (lineThrough) {\n return 'line-through';\n }\n }\n}\n\nexport default createComponent(TextRoot);\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,oBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA0B;AAAA,MAAAK,MAAA,8BAAAN,KAAA,CAAAO,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAS1B,MAAMC,QAAQ,SAASC,eAAS,CAAoD;EAYlFC,WAAWA,CAACC,KAAgB,EAAE;IAC5B,KAAK,CAACA,KAAK,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA,oBAZqB,IAAI;IAAA,IAAAD,gBAAA,CAAAC,OAAA,iCACrBC,cAAK,CAACC,SAAS,CAAqB,CAAC;IAAA,IAAAH,gBAAA,CAAAC,OAAA,iBAMhD;MACNG,YAAY,EAAE;IAChB,CAAC;IAKC,IAAI,CAACC,gBAAgB,GAAG,IAAI,CAACA,gBAAgB,CAACC,IAAI,CAAC,IAAI,CAAC;EAC1D;EAEAC,iBAAiBA,CAAA,EAAS;IACxB,IAAI,CAACC,YAAY,CAAC,CAAC;EACrB;EAEAC,kBAAkBA,CAACC,SAA4B,EAAE;IAC/C,MAAMC,YAA2C,GAAG,CAClD,cAAc,EACd,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EAClB,2BAA2B,EAC3B,0BAA0B,CAC3B;IAED,MAAMC,UAAU,GAAGD,YAAY,CAACE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ACkC,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC7C,gBAAgB,CAAC;IACzD;EACF;EAEQY,eAAeA,CAAA,EAAG;IACxB,IAAI,CAACD,QAAQ,EAAEmC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC9C,gBAAgB,CAAC;IACzD,IAAI,CAACW,QAAQ,EAAEoC,OAAO,CAAC,CAAC;IACxB,IAAI,CAACN,QAAQ,CAAC;MAAE1C,YAAY,EAAE;IAAM,CAAC,CAAC;EACxC;EAEQuC,iBAAiBA,CAAClB,SAAmB,EAAEC,WAAqB,EAAE;IACpE,IAAID,SAAS,EAAE;MACb,OAAO,WAAW;IACpB;IAEA,IAAIC,WAAW,EAAE;MACf,OAAO,cAAc;IACvB;EACF;AACF;AAAC,IAAA1B,gBAAA,CAAAC,OAAA,EA7GKL,QAAQ,aAIK,CAAC,IAAAyD,4BAAmB,EAAC,CAAC,CAAC;AAAA,IAAArD,gBAAA,CAAAC,OAAA,EAJpCL,QAAQ,YAKIH,MAAM;AAAA,IAAAO,gBAAA,CAAAC,OAAA,EALlBL,QAAQ,iBAMS,MAAM;AAAA,IAAA0D,QAAA,GAAAC,OAAA,CAAAtD,OAAA,GAyGd,IAAAuD,qBAAe,EAAC5D,QAAQ,CAAC","ignoreList":[]}
|
package/lib/cjs/index.d.js
DELETED
package/lib/cjs/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { BoxProps, Flex, FlexProps, EllipsisSettings, SimpleHintPopperProps, Ellipsis } from '@semcore/base-components';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { Property } from 'csstype';\nimport type React from 'react';\n\nexport type TextHintProps = {\n /** Manually enabled/disabled Hint */\n hint?: boolean;\n} & {\n /** Settings for a hint with full text (cropped by ellipsis) */\n [K in keyof SimpleHintPopperProps as `hint:${string & K}`]?: SimpleHintPopperProps[K];\n};\n\n/** The text will not be wrapped on a new line and will be cut off with ellipsis. Also, it will show a hint with full text. */\nexport type TextEllipsisProps = {\n /** Manually enabled/disabled Ellipsis or provide an instance of it. */\n ellipsis?: (boolean | Ellipsis);\n} & {\n /** Settings for an Ellipsis */\n [K in keyof EllipsisSettings as `ellipsis:${string & K}`]?: EllipsisSettings[K];\n};\n\nexport type BaseTextProps = {\n /** Font size and line-heights */\n size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800;\n /**\n * The text will not be wrapped on a new line and will be cut off with ellipsis\n * @deprecated use ellipsis prop instead\n **/\n noWrap?: boolean;\n /** CSS property `font-weight: 700;` */\n bold?: boolean;\n /** CSS property `font-weight: 600;` */\n semibold?: boolean;\n /** CSS property `font-weight: 500;` */\n medium?: boolean;\n /** Italicized text */\n italic?: boolean;\n /** Underlined text */\n underline?: boolean;\n /** CSS property `font-family: monospace;` */\n monospace?: boolean;\n /** Strikethrough text */\n lineThrough?: boolean;\n /** Uppercase text */\n uppercase?: boolean;\n /** Lowercase text */\n lowercase?: boolean;\n /** Capitalized text */\n capitalize?: boolean;\n /** Text color **/\n color?: string;\n /** Custom `font-size` */\n fontSize?: Property.FontSize<any>;\n /** Custom `line-height` */\n lineHeight?: Property.LineHeight<any>;\n /** Custom `font-weight` */\n fontWeight?: Property.FontWeight;\n /** Text alignment */\n textAlign?: Property.TextAlign;\n /** Enforces text color */\n use?: 'primary' | 'secondary';\n /** Makes text semi-transparent to indicate disabled state */\n disabled?: boolean;\n};\n\nexport type TextProps = BoxProps & BaseTextProps & (\n {\n /** Enable formatting/styling for all nested HTML tags with our default styles for them */\n formatTags?: boolean;\n ellipsis?: never;\n ellipsisProps?: never;\n hint?: never;\n hintProps?: never;\n } |\n ({\n formatTags?: never;\n // /** Settings for a hint with full text (cropped by ellipsis) */\n // hintProps?: Partial<Omit<SimpleHintPopperProps, 'children'>> | false;\n } & TextHintProps & TextEllipsisProps)\n);\n\nexport type ListProps = TextProps & {\n /** Marker of the entire list\n * @default • */\n marker?: React.ReactNode;\n};\n\nexport type ListItemProps = TextProps & {\n /** Individual marker of a list item */\n marker?: React.ReactNode;\n};\n\nexport type ListItemContentProps = FlexProps;\n\nexport type ListContext = {\n getItemProps: PropGetterFn;\n};\n\nexport type BlockquoteProps = BoxProps & {\n /** Source of the quote */\n author?: React.ReactNode;\n};\n\ndeclare const Item: Intergalactic.Component<'li', ListItemProps> & {\n Content: Intergalactic.Component<typeof Flex, ListItemContentProps>;\n};\n\ndeclare const List: Intergalactic.Component<'ul', ListProps> & {\n Item: typeof Item;\n};\n\ndeclare const Text: Intergalactic.Component<'span', TextProps>;\n\ndeclare const Blockquote: Intergalactic.Component<'blockquote', BlockquoteProps>;\n\nexport { Text, List, Blockquote };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Blockquote.js","names":["Box","createBaseComponent","Root","sstyled","isNode","React","styles","_sstyled","insert","Blockquote","props","ref","_ref","arguments[0]","_ref2","SBlockquote","SDoubleQuotation","SAuthor","children","author","createElement","cn","_assignProps","displayName"],"sources":["../../src/Blockquote.jsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport { createBaseComponent, Root, sstyled } from '@semcore/core';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport React from 'react';\n\nimport styles from './style/blockquote.shadow.css';\n\nfunction Blockquote(props, ref) {\n const SBlockquote = Root;\n const SDoubleQuotation = 'span';\n const SAuthor = 'cite';\n const { children, author } = props;\n\n return sstyled(styles)(\n <SBlockquote render={Box} tag='blockquote' ref={ref}>\n <SDoubleQuotation>“</SDoubleQuotation>\n <span>\n {children}\n {isNode(author) && <SAuthor>{author}</SAuthor>}\n </span>\n </SBlockquote>,\n );\n}\n\nBlockquote.displayName = 'Blockquote';\n\nexport default createBaseComponent(Blockquote);\n"],"mappings":";;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,SAASC,mBAAmB,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAClE,OAAOC,MAAM,MAAM,gCAAgC;AACnD,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,MAAAC,MAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;AAAA;AAI1B,SAASC,UAAUA,CAACC,KAAK,EAAEC,GAAG,EAAE;EAAA,IAAAC,IAAA,GAAAC,YAAA;IAAAC,KAAA;EAC9B,MAAMC,WAAW,GAMMf,GAAG;EAL1B,MAAMgB,gBAAgB,GAAG,MAAM;EAC/B,MAAMC,OAAO,GAAG,MAAM;EACtB,MAAM;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGT,KAAK;EAElC,OAAAI,KAAA,GAAOX,OAAO,CAACG,MAAM,CAAC,eACpBD,KAAA,CAAAe,aAAA,CAACL,WAAW,EAAAD,KAAA,CAAAO,EAAA;IAAA,GAAAC,YAAA;MAAA,OAAkB,YAAY;MAAA,OAAMX;IAAG,GAAAC,IAAA;EAAA,iBACjDP,KAAA,CAAAe,aAAA,CAACJ,gBAAgB,EAAAF,KAAA,CAAAO,EAAA,0BAAC,QAAmB,CAAC,eACtChB,KAAA,CAAAe,aAAA,SAAAN,KAAA,CAAAO,EAAA,cACGH,QAAQ,EACRd,MAAM,CAACe,MAAM,CAAC,iBAAId,KAAA,CAAAe,aAAA,CAACH,OAAO,EAAAH,KAAA,CAAAO,EAAA,iBAAEF,MAAgB,CACzC,CACK,CAAC;AAElB;AAEAV,UAAU,CAACc,WAAW,GAAG,YAAY;AAErC,eAAetB,mBAAmB,CAACQ,UAAU,CAAC","ignoreList":[]}
|
package/lib/es6/List.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","names":["Flex","createComponent","Component","Root","sstyled","isAdvanceMode","isNode","React","style","_sstyled","insert","Text","ListRoot","getItemProps","marker","asProps","render","_ref","_ref4","SList","styles","createElement","cn","_assignProps","_defineProperty","ItemRoot","_ref2","_ref5","SItem","children","markerNode","Children","SMarker","SContent","isAdvancedMode","List","Item","Content","displayName","_assignProps2","props","_ref3","arguments[0]","_ref6","_assignProps3"],"sources":["../../src/List.jsx"],"sourcesContent":["import { Flex } from '@semcore/base-components';\nimport { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport { isAdvanceMode } from '@semcore/core/lib/utils/findComponent';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport React from 'react';\n\nimport style from './style/list.shadow.css';\nimport Text from './Text';\n\nclass ListRoot extends Component {\n static displayName = 'List';\n static style = style;\n static defaultProps = {\n marker: '•',\n };\n\n getItemProps() {\n const { marker } = this.asProps;\n return {\n marker,\n };\n }\n\n render() {\n const SList = Root;\n const { styles } = this.asProps;\n return sstyled(styles)(<SList render={Text} tag='ul' />);\n }\n}\n\nclass ItemRoot extends Component {\n static style = style;\n static displayName = 'Item';\n\n render() {\n const SItem = Root;\n const { styles, children, marker: markerNode, Children } = this.asProps;\n const SMarker = 'span';\n const SContent = 'div';\n\n const isAdvancedMode = isAdvanceMode(Children, [List.Item.Content.displayName]);\n\n return sstyled(styles)(\n <SItem render={Text} tag='li'>\n {isNode(markerNode) && <SMarker aria-hidden='true'>{markerNode}</SMarker>}\n {isAdvancedMode ? <Children /> : <SContent>{children}</SContent>}\n </SItem>,\n );\n }\n}\n\nfunction Content(props) {\n const { styles, children } = props;\n const SContent = Root;\n\n return sstyled(styles)(<SContent render={Flex}>{children}</SContent>);\n}\n\nContent.displayName = 'Content';\n\nconst Item = createComponent(ItemRoot, { Content });\n\nconst List = createComponent(ListRoot, { Item });\n\nexport default List;\n"],"mappings":";;;;;AAAA,SAASA,IAAI,QAAQ,0BAA0B;AAC/C,SAASC,eAAe,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACzE,SAASC,aAAa,QAAQ,uCAAuC;AACrE,OAAOC,MAAM,MAAM,gCAAgC;AACnD,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,MAAAC,KAAA,8BAAAC,QAAA,CAAAC,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"file":"Text.js","names":["Ellipsis","Hint","Box","Root","sstyled","Component","createComponent","resolveColorEnhance","React","styles","_sstyled","insert","TextRoot","constructor","props","_defineProperty","createRef","isEllipsized","handleEllipsized","bind","componentDidMount","initEllipsis","componentDidUpdate","prevProps","ellipsisKeys","hasChanges","some","key","asProps","ellipsis","cleanUpEllipsis","componentWillUnmount","render","_ref","_ref2","SText","color","underline","lineThrough","hint","hintProps","children","ellipsisProps","resolveColor","state","cropPosition","withHint","maxLineValue","maxLine","undefined","createElement","Fragment","cn","_assignProps","innerRef","getTextDecoration","Boolean","setState","shouldInit","current","on","off","cleanUp"],"sources":["../../src/Text.tsx"],"sourcesContent":["import { Ellipsis, Hint, Box, type EllipsisSettings } from '@semcore/base-components';\nimport { Root, sstyled, Component, createComponent } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport React from 'react';\n\nimport type { TextEllipsisProps, TextProps } from './index';\nimport styles from './style/text.shadow.css';\n\ntype State = {\n isEllipsized: boolean;\n};\n\nclass TextRoot extends Component<TextProps, typeof TextRoot.enhance, {}, {}, State> {\n private ellipsis: Ellipsis | null = null;\n private innerRef = React.createRef<HTMLElement | null>();\n\n static enhance = [resolveColorEnhance()] as const;\n static styles = styles;\n static displayName = 'Text';\n\n state = {\n isEllipsized: false,\n };\n\n constructor(props: TextProps) {\n super(props);\n\n this.handleEllipsized = this.handleEllipsized.bind(this);\n }\n\n componentDidMount(): void {\n this.initEllipsis();\n }\n\n componentDidUpdate(prevProps: TextEllipsisProps) {\n const ellipsisKeys: Array<keyof EllipsisSettings> = [\n 'cropPosition',\n 'maxLine',\n 'lastRequiredSymbols',\n 'containerElement',\n 'recalculateContainerWidth',\n 'observeChildrenMutations',\n ];\n\n const hasChanges = ellipsisKeys.some((key) => {\n return prevProps[`ellipsis:${key}`] !== this.asProps[`ellipsis:${key}`];\n });\n\n if (prevProps.ellipsis !== this.asProps.ellipsis || hasChanges) {\n this.cleanUpEllipsis();\n\n this.initEllipsis();\n }\n }\n\n componentWillUnmount() {\n this.cleanUpEllipsis();\n }\n\n render(): React.ReactNode {\n const SText = Root;\n const { color, underline, lineThrough, hint, hintProps, children, ellipsis, ellipsisProps, resolveColor } = this.asProps;\n const { isEllipsized } = this.state;\n\n const cropPosition = ellipsisProps?.cropPosition ?? 'end';\n let withHint = hint !== false;\n\n const maxLineValue = ellipsisProps?.maxLine;\n if (hint !== true && hintProps === undefined && maxLineValue !== undefined && maxLineValue > 1) {\n withHint = false;\n }\n\n return sstyled(styles)(\n <>\n <SText\n render={Box}\n tag='span'\n data-ui-name='Text'\n ref={this.innerRef}\n use:decoration={this.getTextDecoration(underline, lineThrough)}\n use:color={resolveColor(color)}\n use:ellipsis={ellipsis !== undefined ? ellipsis : Boolean(ellipsisProps)}\n isEllipsized={isEllipsized}\n maxLine={maxLineValue}\n trim={cropPosition}\n />\n {isEllipsized && withHint && <Hint triggerRef={this.innerRef} {...hintProps}>{children}</Hint>}\n </>,\n );\n }\n\n private handleEllipsized(isEllipsized: boolean) {\n this.setState({ isEllipsized: isEllipsized });\n }\n\n private initEllipsis() {\n const { ellipsis, ellipsisProps, hint } = this.asProps;\n const shouldInit = hint !== false || ellipsisProps?.cropPosition === 'middle';\n\n if (shouldInit && (ellipsis || ellipsisProps) && this.innerRef.current) {\n this.ellipsis = ellipsis instanceof Ellipsis ? ellipsis : new Ellipsis(this.innerRef.current, ellipsisProps ?? {});\n\n this.ellipsis.on('isEllipsized', this.handleEllipsized);\n }\n }\n\n private cleanUpEllipsis() {\n this.ellipsis?.off('isEllipsized', this.handleEllipsized);\n this.ellipsis?.cleanUp();\n this.setState({ isEllipsized: false });\n }\n\n private getTextDecoration(underline?: boolean, lineThrough?: boolean) {\n if (underline) {\n return 'underline';\n }\n\n if (lineThrough) {\n return 'line-through';\n }\n }\n}\n\nexport default createComponent(TextRoot);\n"],"mappings":";;;AAAA,SAASA,QAAQ,EAAEC,IAAI,EAAEC,GAAG,QAA+B,0BAA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,EAAE;IAAM,CAAC,CAAC;EACxC;EAEQsC,iBAAiBA,CAAClB,SAAmB,EAAEC,WAAqB,EAAE;IACpE,IAAID,SAAS,EAAE;MACb,OAAO,WAAW;IACpB;IAEA,IAAIC,WAAW,EAAE;MACf,OAAO,cAAc;IACvB;EACF;AACF;AAACvB,eAAA,CA7GKH,QAAQ,aAIK,CAACL,mBAAmB,CAAC,CAAC,CAAC;AAAAQ,eAAA,CAJpCH,QAAQ,YAKIH,MAAM;AAAAM,eAAA,CALlBH,QAAQ,iBAMS,MAAM;AAyG7B,eAAeN,eAAe,CAACM,QAAQ,CAAC","ignoreList":[]}
|
package/lib/es6/index.d.js
DELETED
package/lib/es6/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { BoxProps, Flex, FlexProps, EllipsisSettings, SimpleHintPopperProps, Ellipsis } from '@semcore/base-components';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { Property } from 'csstype';\nimport type React from 'react';\n\nexport type TextHintProps = {\n /** Manually enabled/disabled Hint */\n hint?: boolean;\n} & {\n /** Settings for a hint with full text (cropped by ellipsis) */\n [K in keyof SimpleHintPopperProps as `hint:${string & K}`]?: SimpleHintPopperProps[K];\n};\n\n/** The text will not be wrapped on a new line and will be cut off with ellipsis. Also, it will show a hint with full text. */\nexport type TextEllipsisProps = {\n /** Manually enabled/disabled Ellipsis or provide an instance of it. */\n ellipsis?: (boolean | Ellipsis);\n} & {\n /** Settings for an Ellipsis */\n [K in keyof EllipsisSettings as `ellipsis:${string & K}`]?: EllipsisSettings[K];\n};\n\nexport type BaseTextProps = {\n /** Font size and line-heights */\n size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800;\n /**\n * The text will not be wrapped on a new line and will be cut off with ellipsis\n * @deprecated use ellipsis prop instead\n **/\n noWrap?: boolean;\n /** CSS property `font-weight: 700;` */\n bold?: boolean;\n /** CSS property `font-weight: 600;` */\n semibold?: boolean;\n /** CSS property `font-weight: 500;` */\n medium?: boolean;\n /** Italicized text */\n italic?: boolean;\n /** Underlined text */\n underline?: boolean;\n /** CSS property `font-family: monospace;` */\n monospace?: boolean;\n /** Strikethrough text */\n lineThrough?: boolean;\n /** Uppercase text */\n uppercase?: boolean;\n /** Lowercase text */\n lowercase?: boolean;\n /** Capitalized text */\n capitalize?: boolean;\n /** Text color **/\n color?: string;\n /** Custom `font-size` */\n fontSize?: Property.FontSize<any>;\n /** Custom `line-height` */\n lineHeight?: Property.LineHeight<any>;\n /** Custom `font-weight` */\n fontWeight?: Property.FontWeight;\n /** Text alignment */\n textAlign?: Property.TextAlign;\n /** Enforces text color */\n use?: 'primary' | 'secondary';\n /** Makes text semi-transparent to indicate disabled state */\n disabled?: boolean;\n};\n\nexport type TextProps = BoxProps & BaseTextProps & (\n {\n /** Enable formatting/styling for all nested HTML tags with our default styles for them */\n formatTags?: boolean;\n ellipsis?: never;\n ellipsisProps?: never;\n hint?: never;\n hintProps?: never;\n } |\n ({\n formatTags?: never;\n // /** Settings for a hint with full text (cropped by ellipsis) */\n // hintProps?: Partial<Omit<SimpleHintPopperProps, 'children'>> | false;\n } & TextHintProps & TextEllipsisProps)\n);\n\nexport type ListProps = TextProps & {\n /** Marker of the entire list\n * @default • */\n marker?: React.ReactNode;\n};\n\nexport type ListItemProps = TextProps & {\n /** Individual marker of a list item */\n marker?: React.ReactNode;\n};\n\nexport type ListItemContentProps = FlexProps;\n\nexport type ListContext = {\n getItemProps: PropGetterFn;\n};\n\nexport type BlockquoteProps = BoxProps & {\n /** Source of the quote */\n author?: React.ReactNode;\n};\n\ndeclare const Item: Intergalactic.Component<'li', ListItemProps> & {\n Content: Intergalactic.Component<typeof Flex, ListItemContentProps>;\n};\n\ndeclare const List: Intergalactic.Component<'ul', ListProps> & {\n Item: typeof Item;\n};\n\ndeclare const Text: Intergalactic.Component<'span', TextProps>;\n\ndeclare const Blockquote: Intergalactic.Component<'blockquote', BlockquoteProps>;\n\nexport { Text, List, Blockquote };\n"],"mappings":"","ignoreList":[]}
|
package/lib/esm/Text.mjs
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import { sstyled, Component, assignProps, createComponent } from "@semcore/core";
|
|
3
|
-
import { Box, Hint, Ellipsis } from "@semcore/base-components";
|
|
4
|
-
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
5
|
-
import React from "react";
|
|
6
|
-
/*!__reshadow-styles__:"./style/text.shadow.css"*/
|
|
7
|
-
const styles = (
|
|
8
|
-
/*__reshadow_css_start__*/
|
|
9
|
-
(sstyled.insert(
|
|
10
|
-
/*__inner_css_start__*/
|
|
11
|
-
'.___SText_tywgj_gg_{padding:0;margin:0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ abbr{color:var(--intergalactic-text-secondary, #6c6e79);-webkit-text-decoration:underline dashed var(--intergalactic-text-secondary, #6c6e79);text-decoration:underline dashed var(--intergalactic-text-secondary, #6c6e79)}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ abbr:active,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ abbr:focus{outline:0;color:var(--intergalactic-text-hint-hover-active, #484a54);-webkit-text-decoration:underline dashed var(--intergalactic-text-hint-hover-active, #484a54);text-decoration:underline dashed var(--intergalactic-text-hint-hover-active, #484a54)}@media (hover:hover){.___SText_tywgj_gg_.__formatTags_tywgj_gg_ abbr:hover{outline:0;color:var(--intergalactic-text-hint-hover-active, #484a54);-webkit-text-decoration:underline dashed var(--intergalactic-text-hint-hover-active, #484a54);text-decoration:underline dashed var(--intergalactic-text-hint-hover-active, #484a54)}}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ a{display:inline;background:0 0;outline:0;-webkit-text-decoration:none;text-decoration:none;color:var(--intergalactic-text-link, #006dca);border-bottom-width:1px;border-bottom-style:solid;border-color:transparent}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ a:active{outline:0;-webkit-text-decoration:none;text-decoration:none;color:var(--intergalactic-text-link-hover-active, #044792);border-color:var(--intergalactic-text-link-hover-active, #044792)}@media (hover:hover){.___SText_tywgj_gg_.__formatTags_tywgj_gg_ a:hover{outline:0;-webkit-text-decoration:none;text-decoration:none;color:var(--intergalactic-text-link-hover-active, #044792);border-color:var(--intergalactic-text-link-hover-active, #044792)}}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ a:focus{outline-color:var(--intergalactic-keyboard-focus-outline, #008ff8);outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ code,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ pre{font-family:Consolas,"Roboto Mono",Menlo,Courier,monospace}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ blockquote{position:relative;padding-left:51px;font-size:var(--intergalactic-fs-400, 20px);line-height:var(--intergalactic-lh-400, 120%);font-style:italic}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ blockquote:before{content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNyIgaGVpZ2h0PSIxOSIgdmlld0JveD0iMCAwIDI3IDE5IiBmaWxsPSJub25lIj4KPHBhdGggZD0iTTguODI0MjIgMC45NDcyNjZWMi4zMDg1OUM2Ljg3NjMgMy4zMjY4MiA1LjQ4MTc3IDQuMzg5MzIgNC42NDA2MiA1LjQ5NjA5QzMuNzk5NDggNi42MDI4NiAzLjM3ODkxIDcuODA5MjQgMy4zNzg5MSA5LjExNTIzQzMuMzc4OTEgOS44ODk5NyAzLjQ4OTU4IDEwLjQyMTIgMy43MTA5NCAxMC43MDlDMy45MTAxNiAxMS4wMTg5IDQuMTUzNjUgMTEuMTczO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TAuNjc1OCAyMi44NjkxIDEwLjY3NThDMjMuNzc2NyAxMC42NzU4IDI0LjU2MjUgMTEuMDA3OCAyNS4yMjY2IDExLjY3MTlDMjUuOTEyOCAxMi4zMTM4IDI2LjI1NTkgMTMuMTEwNyAyNi4yNTU5IDE0LjA2MjVDMjYuMjU1OSAxNS4xNDcxIDI1LjgyNDIgMTYuMDg3OSAyNC45NjA5IDE2Ljg4NDhDMjQuMTE5OCAxNy42ODE2IDIzLjA3OTQgMTguMDgwMSAyMS44Mzk4IDE4LjA4MDFDMjAuMzc4OSAxOC4wODAxIDE5LjA2MTggMTcuNDQ5MiAxNy44ODg3IDE2LjE4NzVDMTYuNzE1NSAxNC45MjU4IDE2LjEyODkgMTMuMzU0MiAxNi4xMjg5IDExLjQ3MjdDMTYuMTI4OSA5LjE0ODQ0IDE2Ljg3MDQgNy4wMzQ1MSAxOC4zNTM1IDUuMTMwODZDMTkuODM2NiAzLjIwNTA4IDIxLjkzOTUgMS44NDM3NSAyNC42NjIxIDEuMDQ2ODhaIiBmaWxsPSIjQTlBQkI2Ii8+Cjwvc3ZnPg==);display:inline-block;position:absolute;left:0;color:var(--intergalactic-icon-secondary-neutral, #a9abb6);font-family:Georgia,Times,"Times New Roman",serif}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ blockquote cite{display:block;font-style:normal;margin-top:var(--intergalactic-spacing-4x, 16px);color:var(--intergalactic-text-secondary, #6c6e79);font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ol:not(ol[start]):not(ol[reversed]):not(ol[type]),.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ul:not(ul[start]):not(ul[reversed]):not(ul[type]){margin:var(--intergalactic-spacing-2x, 8px)0;padding:0;list-style:none;position:relative}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ol:not(ol[start]):not(ol[reversed]):not(ol[type]) li:not(.___SText_tywgj_gg_):before,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ul:not(ul[start]):not(ul[reversed]):not(ul[type]) li:not(.___SText_tywgj_gg_):before{position:absolute;left:0;color:var(--intergalactic-text-secondary, #6c6e79)}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ol:not(ol[start]):not(ol[reversed]):not(ol[type]) li:not(.___SText_tywgj_gg_)+li:not(.___SText_tywgj_gg_),.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ul:not(ul[start]):not(ul[reversed]):not(ul[type]) li:not(.___SText_tywgj_gg_)+li:not(.___SText_tywgj_gg_){margin:var(--intergalactic-spacing-2x, 8px)0 0 0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ol:not(ol[start]):not(ol[reversed]):not(ol[type]){counter-reset:item 0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ol:not(ol[start]):not(ol[reversed]):not(ol[type]) li:not(.___SText_tywgj_gg_):before{counter-increment:item;content:counters(item,".")}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ul:not(ul[start]):not(ul[reversed]):not(ul[type]) li:not(.___SText_tywgj_gg_):before{content:"";background-color:var(--intergalactic-icon-primary-neutral, #6c6e79)}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ol:not(ol[start]):not(ol[reversed]):not(ol[type]):has(+p),.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ul:not(ul[start]):not(ul[reversed]):not(ul[type]):has(+p){margin-bottom:var(--intergalactic-spacing-4x, 16px)}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h1{font-size:var(--intergalactic-fs-800, 48px);line-height:var(--intergalactic-lh-800, 117%);font-weight:var(--intergalactic-semi-bold, 600);margin:0 0 var(--intergalactic-spacing-6x, 24px)0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h1:only-child,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h2:only-child,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h3:only-child,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h4:only-child,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h5:only-child,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h6:only-child{margin-bottom:0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h2{font-size:var(--intergalactic-fs-700, 36px);line-height:var(--intergalactic-lh-700, 110%);font-weight:var(--intergalactic-semi-bold, 600)}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h3{font-size:var(--intergalactic-fs-600, 32px);line-height:var(--intergalactic-lh-600, 125%);font-weight:var(--intergalactic-semi-bold, 600)}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h4{font-size:var(--intergalactic-fs-500, 24px);line-height:var(--intergalactic-lh-500, 117%);font-weight:var(--intergalactic-semi-bold, 600);margin:0 0 var(--intergalactic-spacing-3x, 12px)0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h5{font-size:var(--intergalactic-fs-400, 20px);line-height:var(--intergalactic-lh-400, 120%);font-weight:var(--intergalactic-semi-bold, 600);margin:0 0 var(--intergalactic-spacing-2x, 8px)0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h6{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%);font-weight:var(--intergalactic-bold, 700);margin:0 0 var(--intergalactic-spacing-1x, 4px)0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h1 small,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h2 small,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h3 small,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h4 small,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h5 small,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h6 small{color:var(--intergalactic-text-secondary, #6c6e79);font-weight:300;font-size:100%}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ li,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ p{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h2,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ h3,.___SText_tywgj_gg_.__formatTags_tywgj_gg_ p{margin:0 0 var(--intergalactic-spacing-4x, 16px)0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ p:last-child,.___SText_tywgj_gg_._size_100_tywgj_gg_.__formatTags_tywgj_gg_ p:last-child,.___SText_tywgj_gg_._size_200_tywgj_gg_.__formatTags_tywgj_gg_ p:last-child,.___SText_tywgj_gg_._size_300_tywgj_gg_.__formatTags_tywgj_gg_ p:last-child{margin-bottom:0}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ li{padding-left:calc(var(--intergalactic-spacing-4x, 16px) + var(--intergalactic-spacing-05x, 2px))}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ol ol li,.___SText_tywgj_gg_._size_100_tywgj_gg_.__formatTags_tywgj_gg_ ol ol li{padding-left:calc(var(--intergalactic-spacing-6x, 24px) + var(--intergalactic-spacing-05x, 2px))}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ol ol ol li,.___SText_tywgj_gg_._size_100_tywgj_gg_.__formatTags_tywgj_gg_ ol ol ol li,.___SText_tywgj_gg_._size_200_tywgj_gg_.__formatTags_tywgj_gg_ ol ol ol li,.___SText_tywgj_gg_._size_300_tywgj_gg_.__formatTags_tywgj_gg_ ol ol ol li{padding-left:calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-1x, 4px) + var(--intergalactic-spacing-05x, 2px))}.___SText_tywgj_gg_.__formatTags_tywgj_gg_ ul li:before{width:4px;height:4px;border-radius:50%;margin-top:calc(var(--intergalactic-spacing-2x, 8px) - 1px);margin-left:var(--intergalactic-spacing-05x, 2px)}.___SText_tywgj_gg_.__ellipsis_tywgj_gg_{overflow:hidden;text-overflow:ellipsis;white-space:pre;display:inline-block;line-height:inherit;vertical-align:top}.___SText_tywgj_gg_.__ellipsis_tywgj_gg_._trim_end_tywgj_gg_.__isEllipsized_tywgj_gg_::after{content:"";display:block}.___SText_tywgj_gg_.__ellipsis_tywgj_gg_.__maxLine_tywgj_gg_{-webkit-line-clamp:var(--maxLine_tywgj);display:-webkit-box;-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}.___SText_tywgj_gg_.__ellipsis_tywgj_gg_._trim_middle_tywgj_gg_{text-overflow:initial}.___SText_tywgj_gg_._size_100_tywgj_gg_,.___SText_tywgj_gg_._size_100_tywgj_gg_.__formatTags_tywgj_gg_ li,.___SText_tywgj_gg_._size_100_tywgj_gg_.__formatTags_tywgj_gg_ p{font-size:var(--intergalactic-fs-100, 12px);line-height:var(--intergalactic-lh-100, 133%)}.___SText_tywgj_gg_._size_100_tywgj_gg_.__formatTags_tywgj_gg_ p{margin:0 0 calc(var(--intergalactic-spacing-4x, 16px) + var(--intergalactic-spacing-05x, 2px))}.___SText_tywgj_gg_._size_100_tywgj_gg_.__formatTags_tywgj_gg_ li{padding-left:calc(var(--intergalactic-spacing-4x, 16px) + var(--intergalactic-spacing-05x, 2px))}.___SText_tywgj_gg_._size_100_tywgj_gg_.__formatTags_tywgj_gg_ ul li:before{width:3px;height:3px;border-radius:50%;margin-top:var(--intergalactic-spacing-2x, 8px);margin-left:var(--intergalactic-spacing-05x, 2px)}.___SText_tywgj_gg_._size_200_tywgj_gg_,.___SText_tywgj_gg_._size_200_tywgj_gg_.__formatTags_tywgj_gg_ li,.___SText_tywgj_gg_._size_200_tywgj_gg_.__formatTags_tywgj_gg_ p{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_tywgj_gg_._size_200_tywgj_gg_.__formatTags_tywgj_gg_ p{margin:0 0 var(--intergalactic-spacing-3x, 12px)0}.___SText_tywgj_gg_._size_200_tywgj_gg_.__formatTags_tywgj_gg_ li{padding-left:calc(var(--intergalactic-spacing-4x, 16px) + var(--intergalactic-spacing-05x, 2px))}.___SText_tywgj_gg_._size_200_tywgj_gg_.__formatTags_tywgj_gg_ ol ol li{padding-left:calc(var(--intergalactic-spacing-6x, 24px) + var(--intergalactic-spacing-05x, 2px))}.___SText_tywgj_gg_._size_200_tywgj_gg_.__formatTags_tywgj_gg_ ul li:before{width:4px;height:4px;border-radius:50%;margin-top:calc(var(--intergalactic-spacing-2x, 8px) - 1px);margin-left:var(--intergalactic-spacing-05x, 2px)}.___SText_tywgj_gg_._size_300_tywgj_gg_,.___SText_tywgj_gg_._size_300_tywgj_gg_.__formatTags_tywgj_gg_ li,.___SText_tywgj_gg_._size_300_tywgj_gg_.__formatTags_tywgj_gg_ p{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SText_tywgj_gg_._size_300_tywgj_gg_.__formatTags_tywgj_gg_ p{margin:0 0 var(--intergalactic-spacing-4x, 16px)0}.___SText_tywgj_gg_._size_300_tywgj_gg_.__formatTags_tywgj_gg_ li{padding-left:calc(var(--intergalactic-spacing-4x, 16px) + var(--intergalactic-spacing-05x, 2px))}.___SText_tywgj_gg_._size_300_tywgj_gg_.__formatTags_tywgj_gg_ ol ol li{padding-left:calc(var(--intergalactic-spacing-6x, 24px) + var(--intergalactic-spacing-05x, 2px))}.___SText_tywgj_gg_._size_300_tywgj_gg_.__formatTags_tywgj_gg_ ul li:before{width:5px;height:5px;border-radius:50%;margin-top:calc(var(--intergalactic-spacing-2x, 8px) + var(--intergalactic-spacing-05x, 2px));margin-left:var(--intergalactic-spacing-05x, 2px)}.___SText_tywgj_gg_._size_400_tywgj_gg_{font-size:var(--intergalactic-fs-400, 20px);line-height:var(--intergalactic-lh-400, 120%)}.___SText_tywgj_gg_._size_500_tywgj_gg_{font-size:var(--intergalactic-fs-500, 24px);line-height:var(--intergalactic-lh-500, 117%)}.___SText_tywgj_gg_._size_600_tywgj_gg_{font-size:var(--intergalactic-fs-600, 32px);line-height:var(--intergalactic-lh-600, 125%)}.___SText_tywgj_gg_._size_700_tywgj_gg_{font-size:var(--intergalactic-fs-700, 36px);line-height:var(--intergalactic-lh-700, 110%)}.___SText_tywgj_gg_._size_800_tywgj_gg_{font-size:var(--intergalactic-fs-800, 48px);line-height:var(--intergalactic-lh-800, 117%)}.___SText_tywgj_gg_.__noWrap_tywgj_gg_{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SText_tywgj_gg_.__medium_tywgj_gg_{font-weight:var(--intergalactic-medium, 500)}.___SText_tywgj_gg_.__semibold_tywgj_gg_{font-weight:var(--intergalactic-semi-bold, 600)}.___SText_tywgj_gg_.__bold_tywgj_gg_{font-weight:var(--intergalactic-bold, 700)}.___SText_tywgj_gg_.__italic_tywgj_gg_{font-style:italic}.___SText_tywgj_gg_.__monospace_tywgj_gg_{font-family:Consolas,"Roboto Mono",Menlo,Courier,monospace}.___SText_tywgj_gg_.__uppercase_tywgj_gg_{text-transform:uppercase}.___SText_tywgj_gg_.__lowercase_tywgj_gg_{text-transform:lowercase}.___SText_tywgj_gg_.__capitalize_tywgj_gg_{text-transform:capitalize}.___SText_tywgj_gg_.__decoration_tywgj_gg_{-webkit-text-decoration:var(--decoration_tywgj);text-decoration:var(--decoration_tywgj)}.___SText_tywgj_gg_.__color_tywgj_gg_{color:var(--color_tywgj)}.___SText_tywgj_gg_.__fontSize_tywgj_gg_{font-size:var(--fontSize_tywgj)}.___SText_tywgj_gg_.__lineHeight_tywgj_gg_{line-height:var(--lineHeight_tywgj)}.___SText_tywgj_gg_.__fontWeight_tywgj_gg_{font-weight:var(--fontWeight_tywgj)}.___SText_tywgj_gg_.__textAlign_tywgj_gg_{text-align:var(--textAlign_tywgj)}.___SText_tywgj_gg_._use_primary_tywgj_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SText_tywgj_gg_._use_secondary_tywgj_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SText_tywgj_gg_.__disabled_tywgj_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}@media (prefers-reduced-motion){.___SText_tywgj_gg_ a{transition:none}}',
|
|
12
|
-
/*__inner_css_end__*/
|
|
13
|
-
"tywgj_gg_"
|
|
14
|
-
), /*__reshadow_css_end__*/
|
|
15
|
-
{
|
|
16
|
-
"__SText": "___SText_tywgj_gg_",
|
|
17
|
-
"_size_400": "_size_400_tywgj_gg_",
|
|
18
|
-
"_size_500": "_size_500_tywgj_gg_",
|
|
19
|
-
"_size_600": "_size_600_tywgj_gg_",
|
|
20
|
-
"_size_700": "_size_700_tywgj_gg_",
|
|
21
|
-
"_size_800": "_size_800_tywgj_gg_",
|
|
22
|
-
"_noWrap": "__noWrap_tywgj_gg_",
|
|
23
|
-
"_medium": "__medium_tywgj_gg_",
|
|
24
|
-
"_semibold": "__semibold_tywgj_gg_",
|
|
25
|
-
"_bold": "__bold_tywgj_gg_",
|
|
26
|
-
"_italic": "__italic_tywgj_gg_",
|
|
27
|
-
"_monospace": "__monospace_tywgj_gg_",
|
|
28
|
-
"_uppercase": "__uppercase_tywgj_gg_",
|
|
29
|
-
"_lowercase": "__lowercase_tywgj_gg_",
|
|
30
|
-
"_capitalize": "__capitalize_tywgj_gg_",
|
|
31
|
-
"_decoration": "__decoration_tywgj_gg_",
|
|
32
|
-
"--decoration": "--decoration_tywgj",
|
|
33
|
-
"_color": "__color_tywgj_gg_",
|
|
34
|
-
"--color": "--color_tywgj",
|
|
35
|
-
"_fontSize": "__fontSize_tywgj_gg_",
|
|
36
|
-
"--fontSize": "--fontSize_tywgj",
|
|
37
|
-
"_lineHeight": "__lineHeight_tywgj_gg_",
|
|
38
|
-
"--lineHeight": "--lineHeight_tywgj",
|
|
39
|
-
"_fontWeight": "__fontWeight_tywgj_gg_",
|
|
40
|
-
"--fontWeight": "--fontWeight_tywgj",
|
|
41
|
-
"_textAlign": "__textAlign_tywgj_gg_",
|
|
42
|
-
"--textAlign": "--textAlign_tywgj",
|
|
43
|
-
"_use_primary": "_use_primary_tywgj_gg_",
|
|
44
|
-
"_use_secondary": "_use_secondary_tywgj_gg_",
|
|
45
|
-
"_disabled": "__disabled_tywgj_gg_",
|
|
46
|
-
"_formatTags": "__formatTags_tywgj_gg_",
|
|
47
|
-
"_ellipsis": "__ellipsis_tywgj_gg_",
|
|
48
|
-
"_trim_end": "_trim_end_tywgj_gg_",
|
|
49
|
-
"_isEllipsized": "__isEllipsized_tywgj_gg_",
|
|
50
|
-
"_maxLine": "__maxLine_tywgj_gg_",
|
|
51
|
-
"--maxLine": "--maxLine_tywgj",
|
|
52
|
-
"_trim_middle": "_trim_middle_tywgj_gg_",
|
|
53
|
-
"_size_100": "_size_100_tywgj_gg_",
|
|
54
|
-
"_size_200": "_size_200_tywgj_gg_",
|
|
55
|
-
"_size_300": "_size_300_tywgj_gg_"
|
|
56
|
-
})
|
|
57
|
-
);
|
|
58
|
-
class TextRoot extends Component {
|
|
59
|
-
constructor(props) {
|
|
60
|
-
super(props);
|
|
61
|
-
_defineProperty(this, "ellipsis", null);
|
|
62
|
-
_defineProperty(this, "innerRef", /* @__PURE__ */ React.createRef());
|
|
63
|
-
_defineProperty(this, "state", {
|
|
64
|
-
isEllipsized: false
|
|
65
|
-
});
|
|
66
|
-
this.handleEllipsized = this.handleEllipsized.bind(this);
|
|
67
|
-
}
|
|
68
|
-
componentDidMount() {
|
|
69
|
-
this.initEllipsis();
|
|
70
|
-
}
|
|
71
|
-
componentDidUpdate(prevProps) {
|
|
72
|
-
const ellipsisKeys = ["cropPosition", "maxLine", "lastRequiredSymbols", "containerElement", "recalculateContainerWidth", "observeChildrenMutations"];
|
|
73
|
-
const hasChanges = ellipsisKeys.some((key) => {
|
|
74
|
-
return prevProps[`ellipsis:${key}`] !== this.asProps[`ellipsis:${key}`];
|
|
75
|
-
});
|
|
76
|
-
if (prevProps.ellipsis !== this.asProps.ellipsis || hasChanges) {
|
|
77
|
-
this.cleanUpEllipsis();
|
|
78
|
-
this.initEllipsis();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
componentWillUnmount() {
|
|
82
|
-
this.cleanUpEllipsis();
|
|
83
|
-
}
|
|
84
|
-
render() {
|
|
85
|
-
var _ref = this.asProps, _ref2;
|
|
86
|
-
const SText = Box;
|
|
87
|
-
const {
|
|
88
|
-
color,
|
|
89
|
-
underline,
|
|
90
|
-
lineThrough,
|
|
91
|
-
hint,
|
|
92
|
-
hintProps,
|
|
93
|
-
children,
|
|
94
|
-
ellipsis,
|
|
95
|
-
ellipsisProps,
|
|
96
|
-
resolveColor
|
|
97
|
-
} = this.asProps;
|
|
98
|
-
const {
|
|
99
|
-
isEllipsized
|
|
100
|
-
} = this.state;
|
|
101
|
-
const cropPosition = ellipsisProps?.cropPosition ?? "end";
|
|
102
|
-
let withHint = hint !== false;
|
|
103
|
-
const maxLineValue = ellipsisProps?.maxLine;
|
|
104
|
-
if (hint !== true && hintProps === void 0 && maxLineValue !== void 0 && maxLineValue > 1) {
|
|
105
|
-
withHint = false;
|
|
106
|
-
}
|
|
107
|
-
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SText, _ref2.cn("SText", {
|
|
108
|
-
...assignProps({
|
|
109
|
-
"tag": "span",
|
|
110
|
-
"data-ui-name": "Text",
|
|
111
|
-
"ref": this.innerRef,
|
|
112
|
-
"use:decoration": this.getTextDecoration(underline, lineThrough),
|
|
113
|
-
"use:color": resolveColor(color),
|
|
114
|
-
"use:ellipsis": ellipsis !== void 0 ? ellipsis : Boolean(ellipsisProps),
|
|
115
|
-
"isEllipsized": isEllipsized,
|
|
116
|
-
"maxLine": maxLineValue,
|
|
117
|
-
"trim": cropPosition
|
|
118
|
-
}, _ref)
|
|
119
|
-
})), isEllipsized && withHint && /* @__PURE__ */ React.createElement(Hint, _ref2.cn("Hint", {
|
|
120
|
-
"triggerRef": this.innerRef,
|
|
121
|
-
...hintProps
|
|
122
|
-
}), children));
|
|
123
|
-
}
|
|
124
|
-
handleEllipsized(isEllipsized) {
|
|
125
|
-
this.setState({
|
|
126
|
-
isEllipsized
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
initEllipsis() {
|
|
130
|
-
const {
|
|
131
|
-
ellipsis,
|
|
132
|
-
ellipsisProps,
|
|
133
|
-
hint
|
|
134
|
-
} = this.asProps;
|
|
135
|
-
const shouldInit = hint !== false || ellipsisProps?.cropPosition === "middle";
|
|
136
|
-
if (shouldInit && (ellipsis || ellipsisProps) && this.innerRef.current) {
|
|
137
|
-
this.ellipsis = ellipsis instanceof Ellipsis ? ellipsis : new Ellipsis(this.innerRef.current, ellipsisProps ?? {});
|
|
138
|
-
this.ellipsis.on("isEllipsized", this.handleEllipsized);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
cleanUpEllipsis() {
|
|
142
|
-
this.ellipsis?.off("isEllipsized", this.handleEllipsized);
|
|
143
|
-
this.ellipsis?.cleanUp();
|
|
144
|
-
this.setState({
|
|
145
|
-
isEllipsized: false
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
getTextDecoration(underline, lineThrough) {
|
|
149
|
-
if (underline) {
|
|
150
|
-
return "underline";
|
|
151
|
-
}
|
|
152
|
-
if (lineThrough) {
|
|
153
|
-
return "line-through";
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
_defineProperty(TextRoot, "enhance", [resolveColorEnhance()]);
|
|
158
|
-
_defineProperty(TextRoot, "styles", styles);
|
|
159
|
-
_defineProperty(TextRoot, "displayName", "Text");
|
|
160
|
-
const Text = createComponent(TextRoot);
|
|
161
|
-
export {
|
|
162
|
-
Text as default
|
|
163
|
-
};
|
package/lib/types/Text.d.ts
DELETED