@alfalab/core-components-typography 4.0.0 → 4.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.
Files changed (112) hide show
  1. package/colors.css +33 -33
  2. package/colors.module-70706104.js +6 -0
  3. package/common.module-78c2a0fa.js +6 -0
  4. package/component.js +6 -2
  5. package/cssm/colors.module.css +13 -13
  6. package/cssm/component.js +5 -0
  7. package/cssm/hooks/index.d.ts +1 -0
  8. package/cssm/hooks/index.js +14 -0
  9. package/cssm/hooks/use-skeleton.module.css +19 -0
  10. package/cssm/hooks/useSkeleton.d.ts +12 -0
  11. package/cssm/hooks/useSkeleton.js +59 -0
  12. package/cssm/index.js +5 -0
  13. package/cssm/text/component.d.ts +10 -2
  14. package/cssm/text/component.js +39 -7
  15. package/cssm/text/index.js +5 -0
  16. package/cssm/text/index.module.css +8 -0
  17. package/cssm/title/component.d.ts +19 -2
  18. package/cssm/title/component.js +16 -2
  19. package/cssm/title/index.js +5 -0
  20. package/cssm/title-mobile/component.js +5 -0
  21. package/cssm/title-mobile/index.js +5 -0
  22. package/cssm/title-responsive/component.js +5 -0
  23. package/cssm/title-responsive/index.js +5 -0
  24. package/cssm/types.d.ts +12 -1
  25. package/esm/colors.css +33 -33
  26. package/esm/colors.module-ac92fbac.js +4 -0
  27. package/esm/common.module-95067533.js +4 -0
  28. package/esm/component.js +6 -2
  29. package/esm/hooks/index.d.ts +1 -0
  30. package/esm/hooks/index.js +5 -0
  31. package/esm/hooks/use-skeleton.css +20 -0
  32. package/esm/hooks/useSkeleton.d.ts +12 -0
  33. package/esm/hooks/useSkeleton.js +52 -0
  34. package/esm/index.js +6 -2
  35. package/esm/text/component.d.ts +10 -2
  36. package/esm/text/component.js +39 -9
  37. package/esm/text/index.css +26 -18
  38. package/esm/text/index.js +5 -1
  39. package/esm/title/common.css +5 -5
  40. package/esm/title/component.d.ts +19 -2
  41. package/esm/title/component.js +15 -3
  42. package/esm/title/index.css +19 -19
  43. package/esm/title/index.js +7 -3
  44. package/esm/title-mobile/component.js +7 -3
  45. package/esm/title-mobile/index.css +11 -11
  46. package/esm/title-mobile/index.js +6 -2
  47. package/esm/title-responsive/component.js +7 -3
  48. package/esm/title-responsive/index.css +31 -31
  49. package/esm/title-responsive/index.js +6 -2
  50. package/esm/types.d.ts +12 -1
  51. package/hooks/index.d.ts +1 -0
  52. package/hooks/index.js +13 -0
  53. package/hooks/use-skeleton.css +20 -0
  54. package/hooks/useSkeleton.d.ts +12 -0
  55. package/hooks/useSkeleton.js +60 -0
  56. package/index.js +6 -2
  57. package/modern/colors.css +33 -33
  58. package/modern/colors.module-1a9450b1.js +4 -0
  59. package/modern/common.module-151b3759.js +4 -0
  60. package/modern/component.js +6 -2
  61. package/modern/hooks/index.d.ts +1 -0
  62. package/modern/hooks/index.js +4 -0
  63. package/modern/hooks/use-skeleton.css +20 -0
  64. package/modern/hooks/useSkeleton.d.ts +12 -0
  65. package/modern/hooks/useSkeleton.js +51 -0
  66. package/modern/index.js +6 -2
  67. package/modern/text/component.d.ts +10 -2
  68. package/modern/text/component.js +40 -8
  69. package/modern/text/index.css +26 -18
  70. package/modern/text/index.js +5 -1
  71. package/modern/title/common.css +5 -5
  72. package/modern/title/component.d.ts +19 -2
  73. package/modern/title/component.js +16 -2
  74. package/modern/title/index.css +19 -19
  75. package/modern/title/index.js +7 -3
  76. package/modern/title-mobile/component.js +7 -3
  77. package/modern/title-mobile/index.css +11 -11
  78. package/modern/title-mobile/index.js +6 -2
  79. package/modern/title-responsive/component.js +7 -3
  80. package/modern/title-responsive/index.css +31 -31
  81. package/modern/title-responsive/index.js +6 -2
  82. package/modern/types.d.ts +12 -1
  83. package/package.json +4 -1
  84. package/src/hooks/index.ts +1 -0
  85. package/src/hooks/use-skeleton.module.css +5 -0
  86. package/src/hooks/useSkeleton.tsx +78 -0
  87. package/src/text/component.tsx +74 -22
  88. package/src/text/index.module.css +8 -0
  89. package/src/title/component.tsx +46 -18
  90. package/src/types.ts +14 -0
  91. package/text/component.d.ts +10 -2
  92. package/text/component.js +40 -9
  93. package/text/index.css +26 -18
  94. package/text/index.js +5 -1
  95. package/title/common.css +5 -5
  96. package/title/component.d.ts +19 -2
  97. package/title/component.js +16 -3
  98. package/title/index.css +19 -19
  99. package/title/index.js +7 -3
  100. package/title-mobile/component.js +7 -3
  101. package/title-mobile/index.css +11 -11
  102. package/title-mobile/index.js +6 -2
  103. package/title-responsive/component.js +7 -3
  104. package/title-responsive/index.css +31 -31
  105. package/title-responsive/index.js +6 -2
  106. package/types.d.ts +12 -1
  107. package/colors.module-1c06b16d.js +0 -6
  108. package/common.module-00fb3f71.js +0 -6
  109. package/esm/colors.module-d9f55bc3.js +0 -4
  110. package/esm/common.module-39c4c6a5.js +0 -4
  111. package/modern/colors.module-d0f9b310.js +0 -4
  112. package/modern/common.module-47d6bc91.js +0 -4
@@ -1,4 +1,4 @@
1
- /* hash: 1jvl1 */
1
+ /* hash: xl0md */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -20,78 +20,78 @@
20
20
  --font-family-styrene: 'Styrene UI', system-ui, -apple-system, 'Segoe UI', Roboto,
21
21
  'Helvetica Neue', Helvetica, sans-serif;
22
22
  } :root {
23
- } .typography__styrene-xlarge_1mab3 {
23
+ } .typography__styrene-xlarge_1b4jn {
24
24
  font-size: 48px;
25
25
  line-height: 64px;
26
26
  font-weight: 500;
27
27
  font-feature-settings: 'ss01';
28
28
  font-family: var(--font-family-styrene);
29
- } .typography__styrene-large_1mab3 {
29
+ } .typography__styrene-large_1b4jn {
30
30
  font-size: 40px;
31
31
  line-height: 48px;
32
32
  font-weight: 500;
33
33
  font-feature-settings: 'ss01';
34
34
  font-family: var(--font-family-styrene);
35
- } .typography__styrene-medium_1mab3 {
35
+ } .typography__styrene-medium_1b4jn {
36
36
  font-size: 32px;
37
37
  line-height: 40px;
38
38
  font-weight: 500;
39
39
  font-feature-settings: 'ss01';
40
40
  font-family: var(--font-family-styrene);
41
- } .typography__styrene-small_1mab3 {
41
+ } .typography__styrene-small_1b4jn {
42
42
  font-size: 24px;
43
43
  line-height: 32px;
44
44
  font-weight: 500;
45
45
  font-feature-settings: 'ss01';
46
46
  font-family: var(--font-family-styrene);
47
- } .typography__styrene-xsmall_1mab3 {
47
+ } .typography__styrene-xsmall_1b4jn {
48
48
  font-size: 20px;
49
49
  line-height: 24px;
50
50
  font-weight: 500;
51
51
  font-feature-settings: 'ss01';
52
52
  font-family: var(--font-family-styrene);
53
- } .typography__system-xlarge_1mab3 {
53
+ } .typography__system-xlarge_1b4jn {
54
54
  font-size: 48px;
55
55
  line-height: 52px;
56
56
  font-weight: 700;
57
- } .typography__system-large_1mab3 {
57
+ } .typography__system-large_1b4jn {
58
58
  font-size: 40px;
59
59
  line-height: 48px;
60
60
  font-weight: 700;
61
- } .typography__system-medium_1mab3 {
61
+ } .typography__system-medium_1b4jn {
62
62
  font-size: 30px;
63
63
  line-height: 36px;
64
64
  font-weight: 700;
65
- } .typography__system-small_1mab3 {
65
+ } .typography__system-small_1b4jn {
66
66
  font-size: 22px;
67
67
  line-height: 26px;
68
68
  font-weight: 700;
69
- } .typography__system-xsmall_1mab3 {
69
+ } .typography__system-xsmall_1b4jn {
70
70
  font-size: 18px;
71
71
  line-height: 22px;
72
72
  font-weight: 700;
73
- } .typography__margins-xlarge_1mab3 {
73
+ } .typography__margins-xlarge_1b4jn {
74
74
  margin: 0 0 var(--gap-xl);
75
- } .typography__margins-large_1mab3 {
75
+ } .typography__margins-large_1b4jn {
76
76
  margin: var(--gap-4xl) 0 var(--gap-xl);
77
- } .typography__margins-medium_1mab3 {
77
+ } .typography__margins-medium_1b4jn {
78
78
  margin: var(--gap-4xl) 0 var(--gap-xl);
79
- } .typography__margins-small_1mab3 {
79
+ } .typography__margins-small_1b4jn {
80
80
  margin: var(--gap-3xl) 0 var(--gap-m);
81
- } .typography__margins-xsmall_1mab3 {
81
+ } .typography__margins-xsmall_1b4jn {
82
82
  margin: var(--gap-3xl) 0 var(--gap-m);
83
- } .typography__rowLimit1_1mab3 {
83
+ } .typography__rowLimit1_1b4jn {
84
84
  -webkit-line-clamp: 1;
85
85
  display: -webkit-box;
86
86
  -webkit-box-orient: vertical;
87
87
  overflow: hidden;
88
88
  word-break: break-all;
89
- } .typography__rowLimit2_1mab3 {
89
+ } .typography__rowLimit2_1b4jn {
90
90
  -webkit-line-clamp: 2;
91
91
  display: -webkit-box;
92
92
  -webkit-box-orient: vertical;
93
93
  overflow: hidden;
94
- } .typography__rowLimit3_1mab3 {
94
+ } .typography__rowLimit3_1b4jn {
95
95
  -webkit-line-clamp: 3;
96
96
  display: -webkit-box;
97
97
  -webkit-box-orient: vertical;
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
2
  import { Title as Title$1 } from './component.js';
3
- import { c as commonStyles } from '../common.module-47d6bc91.js';
3
+ import { c as commonStyles } from '../common.module-151b3759.js';
4
+ import 'react-merge-refs';
4
5
  import 'classnames';
5
- import '../colors.module-d0f9b310.js';
6
+ import '../hooks/useSkeleton.js';
7
+ import '@alfalab/core-components-skeleton/modern';
8
+ import '@alfalab/hooks';
9
+ import '../colors.module-1a9450b1.js';
6
10
 
7
- const styles = {"styrene-xlarge":"typography__styrene-xlarge_1mab3","styrene-large":"typography__styrene-large_1mab3","styrene-medium":"typography__styrene-medium_1mab3","styrene-small":"typography__styrene-small_1mab3","styrene-xsmall":"typography__styrene-xsmall_1mab3","system-xlarge":"typography__system-xlarge_1mab3","system-large":"typography__system-large_1mab3","system-medium":"typography__system-medium_1mab3","system-small":"typography__system-small_1mab3","system-xsmall":"typography__system-xsmall_1mab3","margins-xlarge":"typography__margins-xlarge_1mab3","margins-large":"typography__margins-large_1mab3","margins-medium":"typography__margins-medium_1mab3","margins-small":"typography__margins-small_1mab3","margins-xsmall":"typography__margins-xsmall_1mab3","rowLimit1":"typography__rowLimit1_1mab3","rowLimit2":"typography__rowLimit2_1mab3","rowLimit3":"typography__rowLimit3_1mab3"};
11
+ const styles = {"styrene-xlarge":"typography__styrene-xlarge_1b4jn","styrene-large":"typography__styrene-large_1b4jn","styrene-medium":"typography__styrene-medium_1b4jn","styrene-small":"typography__styrene-small_1b4jn","styrene-xsmall":"typography__styrene-xsmall_1b4jn","system-xlarge":"typography__system-xlarge_1b4jn","system-large":"typography__system-large_1b4jn","system-medium":"typography__system-medium_1b4jn","system-small":"typography__system-small_1b4jn","system-xsmall":"typography__system-xsmall_1b4jn","margins-xlarge":"typography__margins-xlarge_1b4jn","margins-large":"typography__margins-large_1b4jn","margins-medium":"typography__margins-medium_1b4jn","margins-small":"typography__margins-small_1b4jn","margins-xsmall":"typography__margins-xsmall_1b4jn","rowLimit1":"typography__rowLimit1_1b4jn","rowLimit2":"typography__rowLimit2_1b4jn","rowLimit3":"typography__rowLimit3_1b4jn"};
8
12
  require('./index.css')
9
13
 
10
14
  const Title = (props) => (
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
2
  import { Title } from '../title/component.js';
3
- import { c as commonStyles } from '../common.module-47d6bc91.js';
3
+ import { c as commonStyles } from '../common.module-151b3759.js';
4
+ import 'react-merge-refs';
4
5
  import 'classnames';
5
- import '../colors.module-d0f9b310.js';
6
+ import '../hooks/useSkeleton.js';
7
+ import '@alfalab/core-components-skeleton/modern';
8
+ import '@alfalab/hooks';
9
+ import '../colors.module-1a9450b1.js';
6
10
 
7
- const styles = {"styrene-xlarge":"typography__styrene-xlarge_1ovqs","styrene-large":"typography__styrene-large_1ovqs","styrene-medium":"typography__styrene-medium_1ovqs","styrene-small":"typography__styrene-small_1ovqs","styrene-xsmall":"typography__styrene-xsmall_1ovqs","system-xlarge":"typography__system-xlarge_1ovqs","system-large":"typography__system-large_1ovqs","system-medium":"typography__system-medium_1ovqs","system-small":"typography__system-small_1ovqs","system-xsmall":"typography__system-xsmall_1ovqs"};
11
+ const styles = {"styrene-xlarge":"typography__styrene-xlarge_wg0v8","styrene-large":"typography__styrene-large_wg0v8","styrene-medium":"typography__styrene-medium_wg0v8","styrene-small":"typography__styrene-small_wg0v8","styrene-xsmall":"typography__styrene-xsmall_wg0v8","system-xlarge":"typography__system-xlarge_wg0v8","system-large":"typography__system-large_wg0v8","system-medium":"typography__system-medium_wg0v8","system-small":"typography__system-small_wg0v8","system-xsmall":"typography__system-xsmall_wg0v8"};
8
12
  require('./index.css')
9
13
 
10
14
  const TitleMobile = (props) => (
@@ -1,4 +1,4 @@
1
- /* hash: 13pup */
1
+ /* hash: 1a7b3 */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -16,53 +16,53 @@
16
16
  --font-family-styrene: 'Styrene UI', system-ui, -apple-system, 'Segoe UI', Roboto,
17
17
  'Helvetica Neue', Helvetica, sans-serif;
18
18
  } :root {
19
- } .typography__styrene-xlarge_1ovqs {
19
+ } .typography__styrene-xlarge_wg0v8 {
20
20
  font-size: 34px;
21
21
  line-height: 40px;
22
22
  font-weight: 500;
23
23
  font-feature-settings: 'ss01';
24
24
  font-family: var(--font-family-styrene);
25
- } .typography__styrene-large_1ovqs {
25
+ } .typography__styrene-large_wg0v8 {
26
26
  font-size: 30px;
27
27
  line-height: 36px;
28
28
  font-weight: 500;
29
29
  font-feature-settings: 'ss01';
30
30
  font-family: var(--font-family-styrene);
31
- } .typography__styrene-medium_1ovqs {
31
+ } .typography__styrene-medium_wg0v8 {
32
32
  font-size: 26px;
33
33
  line-height: 32px;
34
34
  font-weight: 500;
35
35
  font-feature-settings: 'ss01';
36
36
  font-family: var(--font-family-styrene);
37
- } .typography__styrene-small_1ovqs {
37
+ } .typography__styrene-small_wg0v8 {
38
38
  font-size: 20px;
39
39
  line-height: 28px;
40
40
  font-weight: 500;
41
41
  font-feature-settings: 'ss01';
42
42
  font-family: var(--font-family-styrene);
43
- } .typography__styrene-xsmall_1ovqs {
43
+ } .typography__styrene-xsmall_wg0v8 {
44
44
  font-size: 16px;
45
45
  line-height: 20px;
46
46
  font-weight: 500;
47
47
  font-feature-settings: 'ss01';
48
48
  font-family: var(--font-family-styrene);
49
- } .typography__system-xlarge_1ovqs {
49
+ } .typography__system-xlarge_wg0v8 {
50
50
  font-size: 34px;
51
51
  line-height: 40px;
52
52
  font-weight: 600;
53
- } .typography__system-large_1ovqs {
53
+ } .typography__system-large_wg0v8 {
54
54
  font-size: 30px;
55
55
  line-height: 36px;
56
56
  font-weight: 600;
57
- } .typography__system-medium_1ovqs {
57
+ } .typography__system-medium_wg0v8 {
58
58
  font-size: 26px;
59
59
  line-height: 32px;
60
60
  font-weight: 600;
61
- } .typography__system-small_1ovqs {
61
+ } .typography__system-small_wg0v8 {
62
62
  font-size: 20px;
63
63
  line-height: 28px;
64
64
  font-weight: 600;
65
- } .typography__system-xsmall_1ovqs {
65
+ } .typography__system-xsmall_wg0v8 {
66
66
  font-size: 16px;
67
67
  line-height: 20px;
68
68
  font-weight: 600;
@@ -1,6 +1,10 @@
1
1
  export { TitleMobile } from './component.js';
2
2
  import 'react';
3
3
  import '../title/component.js';
4
+ import 'react-merge-refs';
4
5
  import 'classnames';
5
- import '../colors.module-d0f9b310.js';
6
- import '../common.module-47d6bc91.js';
6
+ import '../hooks/useSkeleton.js';
7
+ import '@alfalab/core-components-skeleton/modern';
8
+ import '@alfalab/hooks';
9
+ import '../colors.module-1a9450b1.js';
10
+ import '../common.module-151b3759.js';
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
2
  import { Title } from '../title/component.js';
3
- import { c as commonStyles } from '../common.module-47d6bc91.js';
3
+ import { c as commonStyles } from '../common.module-151b3759.js';
4
+ import 'react-merge-refs';
4
5
  import 'classnames';
5
- import '../colors.module-d0f9b310.js';
6
+ import '../hooks/useSkeleton.js';
7
+ import '@alfalab/core-components-skeleton/modern';
8
+ import '@alfalab/hooks';
9
+ import '../colors.module-1a9450b1.js';
6
10
 
7
- const styles = {"styrene-xlarge":"typography__styrene-xlarge_z4yoi","styrene-large":"typography__styrene-large_z4yoi","styrene-medium":"typography__styrene-medium_z4yoi","styrene-small":"typography__styrene-small_z4yoi","styrene-xsmall":"typography__styrene-xsmall_z4yoi","system-xlarge":"typography__system-xlarge_z4yoi","system-large":"typography__system-large_z4yoi","system-medium":"typography__system-medium_z4yoi","system-small":"typography__system-small_z4yoi","system-xsmall":"typography__system-xsmall_z4yoi","margins-xlarge":"typography__margins-xlarge_z4yoi","margins-large":"typography__margins-large_z4yoi","margins-medium":"typography__margins-medium_z4yoi","margins-small":"typography__margins-small_z4yoi","margins-xsmall":"typography__margins-xsmall_z4yoi"};
11
+ const styles = {"styrene-xlarge":"typography__styrene-xlarge_1j7fm","styrene-large":"typography__styrene-large_1j7fm","styrene-medium":"typography__styrene-medium_1j7fm","styrene-small":"typography__styrene-small_1j7fm","styrene-xsmall":"typography__styrene-xsmall_1j7fm","system-xlarge":"typography__system-xlarge_1j7fm","system-large":"typography__system-large_1j7fm","system-medium":"typography__system-medium_1j7fm","system-small":"typography__system-small_1j7fm","system-xsmall":"typography__system-xsmall_1j7fm","margins-xlarge":"typography__margins-xlarge_1j7fm","margins-large":"typography__margins-large_1j7fm","margins-medium":"typography__margins-medium_1j7fm","margins-small":"typography__margins-small_1j7fm","margins-xsmall":"typography__margins-xsmall_1j7fm"};
8
12
  require('./index.css')
9
13
 
10
14
  const TitleResponsive = (props) => (
@@ -1,4 +1,4 @@
1
- /* hash: 1av2i */
1
+ /* hash: 1tw64 */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -20,68 +20,68 @@
20
20
  --font-family-styrene: 'Styrene UI', system-ui, -apple-system, 'Segoe UI', Roboto,
21
21
  'Helvetica Neue', Helvetica, sans-serif;
22
22
  } :root {
23
- } /* TODO: поменять медиа-запросы на миксины */ .typography__styrene-xlarge_z4yoi {
23
+ } /* TODO: поменять медиа-запросы на миксины */ .typography__styrene-xlarge_1j7fm {
24
24
  font-size: 34px;
25
25
  line-height: 40px;
26
26
  font-weight: 500;
27
27
  font-feature-settings: 'ss01';
28
28
  font-family: var(--font-family-styrene);
29
- } .typography__styrene-large_z4yoi {
29
+ } .typography__styrene-large_1j7fm {
30
30
  font-size: 30px;
31
31
  line-height: 36px;
32
32
  font-weight: 500;
33
33
  font-feature-settings: 'ss01';
34
34
  font-family: var(--font-family-styrene);
35
- } .typography__styrene-medium_z4yoi {
35
+ } .typography__styrene-medium_1j7fm {
36
36
  font-size: 26px;
37
37
  line-height: 32px;
38
38
  font-weight: 500;
39
39
  font-feature-settings: 'ss01';
40
40
  font-family: var(--font-family-styrene);
41
- } .typography__styrene-small_z4yoi {
41
+ } .typography__styrene-small_1j7fm {
42
42
  font-size: 20px;
43
43
  line-height: 28px;
44
44
  font-weight: 500;
45
45
  font-feature-settings: 'ss01';
46
46
  font-family: var(--font-family-styrene);
47
- } .typography__styrene-xsmall_z4yoi {
47
+ } .typography__styrene-xsmall_1j7fm {
48
48
  font-size: 16px;
49
49
  line-height: 20px;
50
50
  font-weight: 500;
51
51
  font-feature-settings: 'ss01';
52
52
  font-family: var(--font-family-styrene);
53
- } .typography__system-xlarge_z4yoi {
53
+ } .typography__system-xlarge_1j7fm {
54
54
  font-size: 34px;
55
55
  line-height: 40px;
56
56
  font-weight: 600;
57
- } .typography__system-large_z4yoi {
57
+ } .typography__system-large_1j7fm {
58
58
  font-size: 30px;
59
59
  line-height: 36px;
60
60
  font-weight: 600;
61
- } .typography__system-medium_z4yoi {
61
+ } .typography__system-medium_1j7fm {
62
62
  font-size: 26px;
63
63
  line-height: 32px;
64
64
  font-weight: 600;
65
- } .typography__system-small_z4yoi {
65
+ } .typography__system-small_1j7fm {
66
66
  font-size: 20px;
67
67
  line-height: 28px;
68
68
  font-weight: 600;
69
- } .typography__system-xsmall_z4yoi {
69
+ } .typography__system-xsmall_1j7fm {
70
70
  font-size: 16px;
71
71
  line-height: 20px;
72
72
  font-weight: 600;
73
- } .typography__margins-xlarge_z4yoi {
73
+ } .typography__margins-xlarge_1j7fm {
74
74
  margin: 0 0 var(--gap-xl);
75
- } .typography__margins-large_z4yoi {
75
+ } .typography__margins-large_1j7fm {
76
76
  margin: var(--gap-3xl) 0 var(--gap-m);
77
- } .typography__margins-medium_z4yoi {
77
+ } .typography__margins-medium_1j7fm {
78
78
  margin: var(--gap-3xl) 0 var(--gap-m);
79
- } .typography__margins-small_z4yoi {
79
+ } .typography__margins-small_1j7fm {
80
80
  margin: var(--gap-3xl) 0 var(--gap-m);
81
- } .typography__margins-xsmall_z4yoi {
81
+ } .typography__margins-xsmall_1j7fm {
82
82
  margin: var(--gap-3xl) 0 var(--gap-m);
83
83
  } @media screen and (min-width: 1024px) {
84
- .typography__styrene-xlarge_z4yoi {
84
+ .typography__styrene-xlarge_1j7fm {
85
85
  font-size: 48px;
86
86
  line-height: 64px;
87
87
  font-weight: 500;
@@ -89,7 +89,7 @@
89
89
  font-family: var(--font-family-styrene);
90
90
  }
91
91
 
92
- .typography__styrene-large_z4yoi {
92
+ .typography__styrene-large_1j7fm {
93
93
  font-size: 40px;
94
94
  line-height: 48px;
95
95
  font-weight: 500;
@@ -97,7 +97,7 @@
97
97
  font-family: var(--font-family-styrene);
98
98
  }
99
99
 
100
- .typography__styrene-medium_z4yoi {
100
+ .typography__styrene-medium_1j7fm {
101
101
  font-size: 32px;
102
102
  line-height: 40px;
103
103
  font-weight: 500;
@@ -105,7 +105,7 @@
105
105
  font-family: var(--font-family-styrene);
106
106
  }
107
107
 
108
- .typography__styrene-small_z4yoi {
108
+ .typography__styrene-small_1j7fm {
109
109
  font-size: 24px;
110
110
  line-height: 32px;
111
111
  font-weight: 500;
@@ -113,7 +113,7 @@
113
113
  font-family: var(--font-family-styrene);
114
114
  }
115
115
 
116
- .typography__styrene-xsmall_z4yoi {
116
+ .typography__styrene-xsmall_1j7fm {
117
117
  font-size: 20px;
118
118
  line-height: 24px;
119
119
  font-weight: 500;
@@ -121,53 +121,53 @@
121
121
  font-family: var(--font-family-styrene);
122
122
  }
123
123
 
124
- .typography__system-xlarge_z4yoi {
124
+ .typography__system-xlarge_1j7fm {
125
125
  font-size: 48px;
126
126
  line-height: 52px;
127
127
  font-weight: 700;
128
128
  }
129
129
 
130
- .typography__system-large_z4yoi {
130
+ .typography__system-large_1j7fm {
131
131
  font-size: 40px;
132
132
  line-height: 48px;
133
133
  font-weight: 700;
134
134
  }
135
135
 
136
- .typography__system-medium_z4yoi {
136
+ .typography__system-medium_1j7fm {
137
137
  font-size: 30px;
138
138
  line-height: 36px;
139
139
  font-weight: 700;
140
140
  }
141
141
 
142
- .typography__system-small_z4yoi {
142
+ .typography__system-small_1j7fm {
143
143
  font-size: 22px;
144
144
  line-height: 26px;
145
145
  font-weight: 700;
146
146
  }
147
147
 
148
- .typography__system-xsmall_z4yoi {
148
+ .typography__system-xsmall_1j7fm {
149
149
  font-size: 18px;
150
150
  line-height: 22px;
151
151
  font-weight: 700;
152
152
  }
153
153
 
154
- .typography__margins-xlarge_z4yoi {
154
+ .typography__margins-xlarge_1j7fm {
155
155
  margin: 0 0 var(--gap-xl);
156
156
  }
157
157
 
158
- .typography__margins-large_z4yoi {
158
+ .typography__margins-large_1j7fm {
159
159
  margin: var(--gap-4xl) 0 var(--gap-xl);
160
160
  }
161
161
 
162
- .typography__margins-medium_z4yoi {
162
+ .typography__margins-medium_1j7fm {
163
163
  margin: var(--gap-4xl) 0 var(--gap-xl);
164
164
  }
165
165
 
166
- .typography__margins-small_z4yoi {
166
+ .typography__margins-small_1j7fm {
167
167
  margin: var(--gap-3xl) 0 var(--gap-m);
168
168
  }
169
169
 
170
- .typography__margins-xsmall_z4yoi {
170
+ .typography__margins-xsmall_1j7fm {
171
171
  margin: var(--gap-3xl) 0 var(--gap-m);
172
172
  }
173
173
  }
@@ -1,6 +1,10 @@
1
1
  export { TitleResponsive } from './component.js';
2
2
  import 'react';
3
3
  import '../title/component.js';
4
+ import 'react-merge-refs';
4
5
  import 'classnames';
5
- import '../colors.module-d0f9b310.js';
6
- import '../common.module-47d6bc91.js';
6
+ import '../hooks/useSkeleton.js';
7
+ import '@alfalab/core-components-skeleton/modern';
8
+ import '@alfalab/hooks';
9
+ import '../colors.module-1a9450b1.js';
10
+ import '../common.module-151b3759.js';
package/modern/types.d.ts CHANGED
@@ -1,2 +1,13 @@
1
1
  type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
2
- export { TextElementType };
2
+ type WidthUnit = number | string;
3
+ type TextSkeletonProps = {
4
+ /**
5
+ * Кол-во строк текста
6
+ */
7
+ rows?: number;
8
+ /**
9
+ * Ширина строки
10
+ */
11
+ width?: WidthUnit | WidthUnit[];
12
+ };
13
+ export { TextElementType, TextSkeletonProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-typography",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -14,7 +14,10 @@
14
14
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
15
15
  },
16
16
  "dependencies": {
17
+ "@alfalab/core-components-skeleton": "^4.1.0",
18
+ "@alfalab/hooks": "^1.13.0",
17
19
  "classnames": "^2.3.1",
20
+ "react-merge-refs": "^1.1.0",
18
21
  "tslib": "^2.4.0"
19
22
  }
20
23
  }
@@ -0,0 +1 @@
1
+ export * from './useSkeleton';
@@ -0,0 +1,5 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .skeletonText.skeletonText {
4
+ border-radius: var(--border-radius-pill);
5
+ }
@@ -0,0 +1,78 @@
1
+ import React, { useRef, useState } from 'react';
2
+
3
+ import { Skeleton } from '@alfalab/core-components-skeleton';
4
+ import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
5
+
6
+ import { TextSkeletonProps } from '../types';
7
+
8
+ import styles from './use-skeleton.module.css';
9
+
10
+ type TextSkeletonParams = {
11
+ height: number;
12
+ padding: string;
13
+ rows: number;
14
+ };
15
+
16
+ type SkeletonProps = {
17
+ wrapperClassName?: string;
18
+ dataTestId?: string;
19
+ };
20
+
21
+ export function useSkeleton(showSkeleton?: boolean, skeletonProps?: TextSkeletonProps) {
22
+ const [skeletonParams, setSkeletonParams] = useState<TextSkeletonParams>();
23
+ const textRef = useRef<HTMLElement>(null);
24
+
25
+ useLayoutEffect_SAFE_FOR_SSR(() => {
26
+ if (showSkeleton && textRef.current) {
27
+ const style = getComputedStyle(textRef.current);
28
+
29
+ const textHeight = textRef.current.offsetHeight;
30
+ const fontSize = parseInt(style.fontSize, 10);
31
+ const lineHeight = parseInt(style.lineHeight, 10);
32
+
33
+ const padding =
34
+ (lineHeight - fontSize) % 2 === 0
35
+ ? (lineHeight - fontSize) / 2
36
+ : (lineHeight - fontSize - 1) / 2;
37
+
38
+ const rows = skeletonProps?.rows
39
+ ? skeletonProps?.rows
40
+ : Math.ceil(textHeight / lineHeight);
41
+
42
+ setSkeletonParams({
43
+ height: lineHeight - padding * 2,
44
+ padding: `${padding}px 0`,
45
+ rows,
46
+ });
47
+ } else {
48
+ setSkeletonParams(undefined);
49
+ }
50
+ }, [showSkeleton, skeletonProps?.rows]);
51
+
52
+ const renderSkeleton = (props: SkeletonProps) => {
53
+ if (showSkeleton && skeletonParams) {
54
+ return (
55
+ <div className={props.wrapperClassName} data-test-id={props.dataTestId}>
56
+ {[...Array(skeletonParams.rows)].map((_, idx) => {
57
+ const width = Array.isArray(skeletonProps?.width)
58
+ ? skeletonProps?.width[idx]
59
+ : skeletonProps?.width;
60
+
61
+ return (
62
+ // eslint-disable-next-line react/no-array-index-key
63
+ <div key={idx} style={{ width, padding: skeletonParams.padding }}>
64
+ <Skeleton visible={true} className={styles.skeletonText}>
65
+ <div style={{ height: skeletonParams.height }} />
66
+ </Skeleton>
67
+ </div>
68
+ );
69
+ })}
70
+ </div>
71
+ );
72
+ }
73
+
74
+ return null;
75
+ };
76
+
77
+ return { renderSkeleton, textRef };
78
+ }